SAP RFC
Calling an SAP RFC
A Remote Function Call is the call of a function module that runs in a different system than the calling program (although it would be possible to call it from the same system). The connection is established via the network protocol TCP/IP. Lobster Integration uses the SAP RFC Java Class Library to implement RFC calls.
In the SAP system, the RFC interface system provides this functionality. The RFC interface system enables function calls between two SAP systems (R/2 or R/3) or between an SAP system and a non-SAP system.
An RFC is defined by an interface that can contain three different types of data.
Fields of a certain type (e.g. text, number, date, ...) and of a certain length.
Structures represent a list of fields.
Tables contain several values of different fields.
An interface description can roughly be divided into three parts.
Input parameters that are passed by the caller. These can be fields or structures.
Output parameters that are returned to the calling system after the execution of the function module. These can be fields or structures.
Tables for both input and output tables.
The following example will explain how an RFC works. Using the RFC RFC_READ_TABLE, two fields are to be read from an SAP system from table T005K. The following screenshot shows the structure of this table.
The following screenshot shows the RFC interface description of the RFC with name RFC_READ_TABLE.
The RFC has the five input parameters
DELIMITER,
NO DATA,
QUERY_TABLE,
ROWCOUNT and
ROWSKIPS.
In addition, the RFC has the following table parameters.
DATA. This table stores the data of the table.
FIELDS. In this table, the fields to be delivered are selected and the structure of these fields is defined.
OPTIONS. This table contains optional WHERE conditions for the query.
The function module has no output parameter that can be displayed in the form of a field or a structure.
Lobster Integration is able to send RFC calls to an SAP system and process the response of the SAP system. This mechanism is used in Lobster Integration on the input side to fetch data from an SAP system. The data supplied by the SAP system can then be processed in different formats by the calling profile. For details refer to section SAP (Input Agent Cron).
If an SAP RFC is called in a Response of a profile, the response of the SAP system can be transferred to a subsequent profile via Message for further processing. For details refer to section Response "SAP".
Lobster Integration can query the interface definition of an RFC in an SAP system and import the structure.
Attention: Lobster Integration RFC calls contain only the sending of the import parameters and the table parameters to the function module, as well as the return of the export parameters and the table parameters from the function module to Lobster Integration. If the function module tries to access SAP GUI functionality, such as copying files between SAP and the desktop computer, this function module call will fail when called from Lobster Integration.
Debugging an SAP RFC
Lobster Integration offers the option of recording SAP RFC calls executed by it both on the input and the output side for debugging purposes.
The recording is activated by setting the checkbox Trace messages for phase 1 and 6 in the logging settings. For phase 6, the checkbox SAP must also be set. See sections System logging and Profile logging.
On the input side (phase 1), SAP RFC calls are recorded in two files, which are stored in directory ./debug/sap. The files have the names __debugIRfcIn.xml and __debugIRfcOut.xml.
On the output side (phase 6), SAP RFC calls are recorded in HTML format in the Lobster Integration message log.
Note: Debugging only affects communication with the SAP system. It is not possible to debug the ABAP component of the RFC in Lobster Integration.