Skip Headers

Oracle9iAS InterConnect Adapter for SAP R/3 Installation and User's Guide
Release 2 (9.0.2)

Part Number A95438-01
Go To Documentation Library
Home
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

5
Remote Function Call

Remote Function Call is a feature of SAP R/3 that allows function modules to be invoked locally or remotely. This chapter describes how the SAP adapter may be integrated with SAP R/3 Remote Function Call.

This chapter discusses the following topics:

Introduction to Remote Function Call

A function module is a unit of functionality in SAP. Remote Function Call is a feature of R/3 that allows you to invoke function modules remotely. This allows the R/3 system to be integrated with other systems. The interface of every function is maintained by the SAP system in its data dictionary. A key concept in Remote Function Call is the Remote Function Call Program ID. This is a symbolic ID associated with an end point that services Remote Function Calls. The receiving server first needs to register the ID with the calling SAP system. Users in the SAP system may now invoke a call to a function at this Remote Function Call destination.

SAP Adapter Interaction with R/3

The following two sections describe the interaction between the SAP adapter and R/3 Remote Function Call.

SAP Adapter Application Acting as a Client

To make your SAP adapter application act as a client calling a Remote Function Call interface, you must define a subscribed event or an implemented procedure in your application. It is preferable to use implemented procedures for this application. Triggering of your event/procedure fires a call to the underlying SAP Remote Function Call interface.

Before you can define these events or procedures, you need to do is to set up a default login into the R/3 system.

SAP Adapter Application Acting as a Server

To make your SAP adapter application act as a server implementing a Remote Function Call interface, you must define a published event or an invoked procedure in your application. For use with Remote Function Call, an invoked procedure is preferred. A call to this Remote Function Call interface triggers your event/procedure and causes an appropriate message to be sent to the SAP adapter hub.


Note:

The interfaces you define must already be in the SAP system's data dictionary. The SAP system does not need to provide an implementation for these interfaces; however, it must know the signatures. You must setup the default login parameters. Another parameter you need to set up is the Remote Function Call program ID. These parameters are set in the R/3 Configuration Editor.


Remote Function Call Configuration

The following configuration parameters must set using the Configuration Editor for working with Remote Function Call.

Calling From SAP adapter to R/3

This section describes default login parameters for R/3.

Default Login to R/3

Default Login to R/3 allows you to program your development application to automatically connect to R/3 servers.

Default Login to R/3 authenticates a user's runtime credentials. This group only appears under a user-defined profile. All the parameters on this page are identical to those that appear when logging into R/3 for a regular session.

Table 5-1 Login to R/3 Field Descriptions
Field Description

Enable Login Settings

Enables or disables the selected login feature.

Client

Enter your client number for the R/3 system.

User

Enter your user ID for the R/3 system.

Password

Specifies your user password for the R/3 system.

Host

Specifies the Host ID when connecting to the R/3 system.

Language

Required by R/3. By default this parameter retrieves the language information from the user's operating system.

Additional Connection Parameters

Passes additional string connection parameters when Control Broker acts as a Remote Function Call client connecting to an R/3 server.

Debugging - ABAP/4

This feature is useful for debugging or diagnostic purposes. However, it is of limited use in a production environment, as the message does not display on the client machine. ABAP/4 Debug Calls are also known as Remote Function Call Debug Calls. Use this selection when you are debugging Function Modules. Selecting ABAP/4 Debug Calls automatically sets the ABAP_DEBUG connection parameter allowing Function Module calls to go through the SAPGUI debugger.

Calling from R/3 to the SAP Adapter

Default login to R/3 needs to be set.

See Also:

"Default Login to R/3"

Table 5-2 Calling from R/3 to SAP adapter
Field Description

Host

Specifies the TCP/IP host running the SAP gateway.

RFC Program ID

Specifies the Remote Function Call Program ID that the SAP Agent uses to register itself with the Remote Function Call Gateway.

Additional Connection Parameters

Passes additional string connection parameters to RfcAccept when Control Broker acts as a Remote Function Call Server to an R/3 Client.

Optimize Remote Function Call Function Modules

In an unoptimized SAP environment, the Remote Function Call table retrieval is slow. To build the Remote Function Call namespace, R/3 downloads three separate tables: area, groups, and functions. Of the three tables, only the function tables contain any relationship about which group and area it belongs to. The areas and groups tables contain extra areas and groups that do not belong to the function. The groups table contains more than 5,000 entries, while the final usable groups are around 700 entries. The browser, working back from the function table, removes the unused groups and areas. Accessing a local R/3 system takes around 5 to 6 seconds for all the tables to be built. However, remotely accessing an R/3 system could take up 4 to 5 minutes.

To reduce the time spent downloading information at development time, functions are provided that allow selective retrieval of areas, groups, and functions. In support of lookup-on-demand for the groups and the areas, the SAP adapter has two custom function modules: one to retrieve the areas and the second to download groups for a specific area.

If you decide not to upload the browsing enhancement functions, the retrieval preloads the table. While preloading the Remote Function Call table is time consuming on a remote R/3 system, it provides advantages for local system since the whole table is prebuilt one time. For this reason, a registry setting key RFCTablePreloadEnabled is added in the FM Setting area. Selecting this function prebuilds the tables despite the existence of Control Broker custom functions.

At runtime, the area and groups tables are not required and these two processes can be skipped to optimize the download process. On a local R/3 system, the preloading of the function table is fast. However, on a remote R/3 system, the preloading of the function table takes time for the table to completely download. To enhance the performance, the runtime use of preload or lookup-on-demand are based on either populating the preloaded table or using the setting TablePreloadEnabled.

Although long group names exist (starting from version 4.0) the native Remote Function Call function (that retrieves the list of functions from a long name group) does not differentiate between itself and a short name version that matches the first part of its name. If you query for functions belonging to a short name group, or a long name group which matches a short name group's name, the returned function list is a union of both groups' functions.

The SAP adapter can build the groups table with the short name groups or long names. The short name groups are preferred as they also call functions from the long name group. R/3 release 4.5 has the proper support for long name group and no longer returns the functions that belong to the groups that have the same short format name.


Note:

Because 4.0x support for long name groups is not complete, using a group exposed on 4.0x and running it against a 4.5 machine might cause the function to be undefined since the long, or the short, name group on 4.5 contains only the functions that belongs to them and not the union of all the functions belong to both groups.


Enhance Remote Function Call Function Module Remote Browsing

To enhance your Remote Function Call Function Module Remote browsing, the SAP adapter includes the text files for Z_RFC_GET_AREAS (areas.asc) and Z_RFC_GET_GROUPS (ginstall_directorySAPALE_Filesroups3x.asc or groups4x.asc) in the install_directory/oai/9.0.2/sap/rfc_files directory.

Why a Function Group?

The function modules must be in the same function group (usually custom built) and the global data (shared by the entire function group) must contain the following statement:

tables:tfdir, taplt, tlibt

Creating a Function Group

Use the following steps to create the ZMAS function group.

  1. Select Tools > ABAP/4 Workbench > Function Builder in the SAPGUI.

  2. Select Goto > Function groups > Create group.

  3. Enter the function group name in the Function field, for example, ZMAS.

  4. Enter the group description in Short field and click Save.

    The Create object catalog entry dialog displays.

  5. Complete the necessary fields for this dialog.

  6. Verify where to store the object with your System Administrator. You can select one of the following:

    • Local object--A non transportable temporary object.

    • Development classes--Allow entities to take part in the R/3 transport mechanism. Changes to objects in these classes are recorded and can be transported to other systems.

  7. Create two function modules: Z_RFC_GET_AREAS and Z_RFC_GET_GROUPS.

Creating the Z_RFC_GET_AREAS Function Module

Use the following steps to create the Z_RFC_GET_AREAS function module.

  1. Select Tools > ABAP/4 Workbench in the SAPGUI.

  2. Select Function Builder.

    The Function Library: Initial Screen dialog displays.

  3. Enter the function module name, Z_RFC_GET_AREAS, in the Function module field and click Create.

  4. Type in the following values for each of the object components selections:

    Attributes
    Import/Export Parameter Interface
    Table Parameters/Exceptions Interface
    Documentation
    

Attributes

Table 5-3 describes attributes classifications.

Table 5-3 Attributes Classifications
Classification

Function Group:

ZMAS

NA

Application:

Z

NA

ShortText:

Retrieve areas for remote callable Remote Function Call functions

Processing type

Remote Function Call supported

 

NA

Immediate Start

 

Table Parameters/Exceptions Interface

Table 5-4 describes table parameters.

Table 5-4 Table Parameters
Table Parameters Ref. Structure Short Text

AREAS

TAPLT

Lot of areas and descriptions

Documentation

Figure 5-1 displays the Z_RFC_GET_GROUPS function module display. Enter the following values:

Figure 5-1 Function Module Display:Z_RFC_GET_GROUPS

Text description of rfcdocumentationareas.gif follows.

Text description of the illustration rfcdocumentationareas.gif

Uploading the Function Module Source Code

Use the following steps to upload the function module source code:

  1. Select Back or F3 to return to the previous dialog.

  2. Click the Source Code tab.

  3. Click Change.

  4. Upload the Source Code provided with Control Broker using Utilities > More Utilities > UpLoad/DownLoad >UpLoad.

  5. Enter the path and file name, install_directory/oai/9.0.2/sap/rfc_files/areas.asc.

  6. Click Ctrl+F3 to activate the function module.

Creating the Z_RFC_GET_GROUPS Function Module

Use the following steps to create the Z_RFC_GET_GROUPS function module.

  1. Select Tools->ABAP/4 Workbench in the SAPGUI.

  2. Select Function Builder.

    The Function Library: Initial Screen dialog displays.

  3. Enter the function module name, Z_RFC_GET_GROUPS, in the Function module field.

  4. Click Create.

  5. Type in the following values for each of the Object components selections:

    Attributes
    Import/Export Parameter Interface
    Table Parameters/Exceptions Interface
    Documentation
    

Attributes

Table 5-5 describes attributes definitions.

Table 5-5 Attributes Definitions
Classification Function Group: ZMAS

NA

Application:

Z

NA

ShortText:

Retrieve groups for remote callable Remote Function Call functions

Processing type

Remote Function Call supported

 

NA

Immediate Start

 

Import/Export Parameter Interface

Figure 5-2 displays the Z_RFC_GET_GROUPS import and export parameters.

Figure 5-2 Function Module Display:Import/Export Parameters Z_RFC_GET_GROUPS

Text description of rfcimportexposrtgroups.gif follows.

Text description of the illustration rfcimportexposrtgroups.gif

Table 5-6 Import parameter definitions
Import parameter Reference field Proposal Optional Short Text

AREANAME

RS38L-APPL

 

 

Get all Groups

ALLGROUPS

RS38L-APPL

SPACE

X

Area Name

Table Parameters/Exceptions Interface

Figure 5-3 displays the Remote Function Call parameters group.

Figure 5-3 Remote Function Call Table Parameters Group

Text description of rfctableparamsgroups.gif follows.

Text description of the illustration rfctableparamsgroups.gif

Table 5-7 Table Parameter definitions
Table Parameters Ref. Structure Short Text

GROUPS

RFCGROUP

Table of Groups and their descriptions

Exception

 

 

NO_GROUP_FOUND

 

No Group was Found according to the Criteria

Figure 5-4 Remote Function Call Exception Group

Text description of rfcfunctmod.gif follows.

Text description of the illustration rfcfunctmod.gif

Uploading the Function Module Source Code

Use the following steps to upload the function module source code:

  1. Click the Source Code tab.

  2. Click Change.

  3. Upload the Source Code provided with Control Broker using the SAP command Utilities > More Utilities > UpLoad/DownLoad >UpLoad.

  4. Enter the path and file name:

    R/3 Version 3.x

        install_directory/oai/9.0.2/sap/rfc_files/groups3x.asc
    

    - OR -

    R/3 Version 4.x

       install_directory/oai/9.0.2/sap/rfc_files/groups4x.asc
    
  5. Click Ctrl+F3 to activate the function module.

Set Global Data

Use the following steps to set global data:

  1. Select Back or F3 to return to the previous screen.

  2. Select Global Data.

  3. Click Change.

  4. Locate the line:

    function-pool zmas.MESSAGE-ID .., 
    

    and insert the following:

    tables:tfdir, taplt, tlibt.
    
  5. Verify you have access to this global data by performing a simple check:

    1. Click Tools->ABAP/4 Workbench->Function Builder.

    2. Set the function module to Z_RFC_GET_AREAS.

    3. Check Global data.

    4. Click Display.

    5. Verify that the following displays:

      function-pool zmas.MESSAGE-ID ..
      tables:tfdir, taplt, tlibt.
      

Clean Your R/3 System

It is recommended that you remove all tables you insert in an R/3 system so that in the future you can create tables for this sample. For example, to remove ZORDERS and ZCOMMISS tables, you must first erase the function groups and the function modules.

Erasing Function Groups and Function Modules

To erase function groups and modules:

  1. Open the SAPGUI initial dialog.

  2. Select Tools->ABAP Workbench to erase the Z_ACCNT_DEPT function group.

  3. Click Function Builder to display the Function Builder: Initial Screen dialog.

  4. Select Goto->Function groups->Delete group.

    The Change Function Group dialog displays.

  5. Enter Z_ACCNT_DEPT in the Function group field and click the check mark.

    The Delete Function: Group: Delete Function dialog displays. It shows the two function modules belonging to the group.

  6. Click Delete to delete the Z_COMMISS_ADD and the Z_COMMISS_UPDATE function modules.

  7. Repeat steps 3 and 4 to erase any other function group and any other function modules.

Erasing a Table

After erasing the function groups and modules, erase a table using the SAPGUI with the following steps:

  1. Press F3 to return to the ABAP Workbench dialog.

  2. Click Dictionary.

  3. Type ZORDERS in the Object name field.

  4. Click trash can. A confirmation dialog displays.

  5. Repeat steps 3 and 4 to erase the ZCOMMISS table.


    Note:

    Remember to type ZCOMMISS in the object name text box.



Go to previous page Go to next page
Oracle
Copyright © 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Table Of Contents
Contents
Go To Index
Index