Show TOC

RFC CallsLocate this document in the navigation structure

Use

In all SAP systems, CALL FUNCTION represents an integral part of the ABAP language. This statement executes a function (a function module) in the same system.

Remote Function Call (RFC) is an extension of CALL FUNCTION in a distributed environment. Existing function modules can be executed using an RFC from a remote system. This is done by adding a DESTINATION to the CALL FUNCTION statement:

The destination parameter displays an entry in the RFCDES table. This entry contains all necessary parameters to connect to and log in the destination system.

Note

Table RFCDES is configured using transaction SM59 ( Remote Destinations).

Interface Functions

RFC frees the ABAP programmer from having to program his own communications routines. When you make an RFC call, the RFC interface takes care of:

  • Converting all parameter data to the representation needed in the remote system. This includes character string conversions, and any hardware-dependent conversions needed (for example, integer, floating point). All ABAP data types are supported.

  • Calling the communication routines needed to talk to the remote system.

  • Handling communications errors, and notifying the caller, if desired. (The caller requests notification using the EXCEPTIONS parameter of the CALL FUNCTION statement.)

The RFC interface is effectively invisible to the ABAP programmer. Processing for calling remote programs is built into the CALL FUNCTION statement. Processing for being called is generated automatically (in the form of an RFC stub) for every function module registered as remote. This stub serves as an interface between the calling program and the function module.

A distinction is made between an RFC client and RFC server. RFC client is the instance that calls up the Remote Function Call to execute the function that is provided by an RFC server. In the following, the functions that can be executed remotely will be called RFC functions and the functions provided via RFC API will be called RFC calls.

Context Management

Every remote function module call made using the RFC interface defines its own context in the target system. The function group of the function module is loaded into an internal session of the context, and is retained. What this means is that, if repeated calls of function modules belonging to the same destination and the same function group are made, the global data of this function group can be accessed collectively.

A connection and its context is retained until it is explicitly closed, or until the calling program is finished. Function module RFC_CONNECTION_CLOSE can be used to explicitly close a connection.