Show TOC

Background documentationEstablishing an RFC Connection from an SAP System Locate this document in the navigation structure

 

Call from an ABAP program:

Syntax Syntax

  1. CALL FUNCTION “ABC” DESTINATION “RFCEXTERNAL”
  2. 	IMPORT...
  3. 	EXPORT...
  4. 	TABLES...
  5. 	EXCEPTIONS...
End of the code.

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

Note Note

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.

End of the note.
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:

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

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

      3. 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'.

        Note Note

        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.

        End of the note.
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.