Establishing an RFC Connection from an SAP System

Call from an ABAP program:

CALL FUNCTION “ABC” DESTINATION “RFCEXTERNAL”

   IMPORT...
   EXPORT...
   TABLES...
   EXCEPTIONS...

The destination “RFCEXTERNAL” identifies an entry in the RFCDES table.

The RFCDES table in Release 3.0C onwards

From Release 3.0C onwards, you can define an RFC server program which is already started, registered at an SAP gateway and waiting for RFC call requests by using transaction sm59.

You must define an RFC server program with registering as activating action, and a program-ID.

Program-ID

The program-ID is an identifier of the RFC server program for the SAP gateway to distinguish between different RFC server programs. It is recommended to use both the name of the RFC server program and the host name of the RFC server program.

Information about the SAP Gateway

The SAP gateway of the relevant application server will be used if nothing else is specified. It is recommended to define the SAP gateway explicitly, because an RFC server program usually registers at a specific SAP gateway.

Configurations

SAP recommends you to specify the complete name of the RFC server program (including the full path name) when defining an entry in the RFCDES table using transaction sm59.

The RFC server program can be started by the currently running SAPGUI, by the currently running application server or by an SAP gateway, but it has to communicate via a specified SAP gateway.

Consequently, the following prerequisites must be met:

·        The user under which the SAPGUI or the application server or the SAP gateway runs must have execution rights for the RFC server program.

·        Both SAP gateway and RFC server program are running on the same computer:

Ў        The IP address of this computer must be specified in the hosts file.

Ў        The service name of the SAP gateway must be specified in the services file.

·        The SAP gateway and the RFC server program are running on different computers:

Ў        The IP-addresses of both computers must be specified in both hosts files.

Ў        The service name of the SAP gateway must be specified in the services file.

Ў        The SAP gateway must have the authority to start the RFC server program on the target computer via remote shell:

                                                  i.       The user of the SAP gateway must be defined on the target computer.

                                                ii.       The.rhosts file which contains the host name of the gateway computer must exist in this user’s home directory on the target computer

                                               iii.       Since the remote shell command is different on different UNIX platforms (remsh, rsh, etc.), the command can be defined in the gateway profile parameter gw/remsh, if necessary (e.g. gw/remsh=/usr/ucb/remsh).
The default is ‘remsh’.

For very large hosts files on OS/2, it is recommended to define the entries for all computers involved at the beginning of this file, because it may take a long time to get all IP-addresses used.

Starting an RFC server program

An RFC server program can be started by the currently running SAPGUI, by the currently running SAP application server or by an SAP gateway, as described in the above section.

Using the registering feature of the SAP gateway (from Release 3.0C onwards), RFC server programs can be started before, register at this SAP gateway and then wait for RFC call requests from System Release 3.0C onwards.

Here, the RFC server program of the RFCDES table (transaction sm59) must be defined as registering for activating action. See The SAPRFC.INI File for more details.