For business applications, it is necessary to exchange the information with other systems in the same or other systems group. To do this, a mechanism needed to communicate between the SAP systems.

The systems communicate with function calls in the mechanism. The communication between the systems using function calls is called as Remote Function Call (RFC). The connection established using the Remote Function Call is called as RFC connection. In RFC, the calling system and called system is different.

RFC takes care of communications between two independent SAP systems or client-server communication between external client/server and SAP system. RFC consists of two interfaces:

  • ABAP Programs calling interface
  • Non-SAP programs calling interface

Remote function call in the ABAP program can be place by using CALL FUNCTION...DESTINATION statement.

Syntax: -

CALL FUNCTION 'remote-function'
DESTINATION <destination>
EXPORTING f1 =
IMPORTING f2 =
TABLES t1 =
EXCEPTIONS

The DESTINATION parameter describes the target SAP System where the function runs in a system. Logical destinations are defined via transaction SM59 and stored in Table RFCDES.

RFC Advantages:

  • Convert the data format recognized by the target remote system.
  • Calling necessary functions to establish communication between the systems.
  • Handle errors in the communication process.

RFC Types -

There are four types of RFC.

  • Synchronous RFC(sRFC)
  • Asynchronous RFC(aRFC)
  • Transactional RFC(tRFC)
  • Queued RFC(qRFC)

Synchronous RFC (sRFC) -

Synchronous RFC is reliable and consistent process to transfer the data between the systems. It requires both systems to be available to transfer the data.

The calling program in the source system waits until the requested process completed at the remote system. The program is free once the process is completed at the remote system. If the target system is not available then the process goes to sleep mode and wait until the system availability.

Asynchronous RFC (aRFC) -

Asynchronous RFC is not reliable process to transfer the data. Source system only sends the data without verifying the target system status. Source system won't get any acknowledgement from the target system about the data transfer.

The acknowledgements are not required in this RFC connection. The source system has no information about the data transferred or not to the target system. The calling program sends the request and releases immediately to work locally.

Transactional RFC (tRFC) -

The RFC connection is similar to asynchronous RFC. This RFC connection assigns transaction id for each request and uses the transaction id for recognizing the request at the remote system.

The remote system won’t process the request multiple times even though source system requests multiple times. If the target system is not available, the data held in source system until the target system available.

The report program "RSARFCSE" called in the background at regular intervals to place the unsuccessful requests again and again identified by their transaction id.

Queued RFC (qRFC) -

Queued RFC is an extension/advanced version of transactional RFC. In this RFC, requests are queued up and are processed in a sequence.

It guarantees that multiple Logical Unit of Work/Transaction are processed in the order specified by the application. This RFC can be serialized using queues hence it is called as Queued RFC.

RFC Connection Types -

There are three distinct types of trusted connections.

  1. Type 3 connection
  2. Type I connection
  3. Type T connection

Type 3 connection -

The connection type is used to specify connection between ABAP systems. Source system Host name/IP address, Logon information must specify in this connection type.

This is applicable for the RFCs between ABAP systems and external calls to ABAP systems.

Type I connection -

Used to specify ABAP systems connected to the same database as the current system. The entries are pre-defined and can't modified.

Type T connection -

The connection type helps to connect destination system external programs that use the RFC API to receive RFCs.

Start or registration is the activation type. Host name and program pathname to start the connection.

Debugging RFC -

It is not possible to debug a remote function call to another system. For ABAP-to-ABAP RFC calls, ABAP debugger can be used to monitor the execution of the RFC function in the remote system.

For remote calls, the ABAP debugger with the debugging interface runs on the local system to monitor the execution of the RFC function.