Show TOC

Transactional RFC (tRFC)Locate this document in the navigation structure

Use

When using transactional RFC (tRFC), the called function module is executed exactly once in the called system (service property: Exactly Once).

The remote system need not be available at the time when the RFC client program is executing a tRFC. The tRFC component stores the called RFC function together with the corresponding data in the database of the SAP system, including a unique transaction identifier (TID).

If a call is sent, and the receiving system is down, the call remains in the local queue until a later time. The calling dialog program can proceed without waiting to see whether or not the remote call was successful. If the receiving system does not become active within a certain amount of time, the call is scheduled to run in batch.

Transactional RFCs use the suffix IN BACKGROUND TASK.

As with synchronous calls, the DESTINATION parameter defines a program context in the remote system. As a result, if you call a function repeatedly (or different functions once) at the same destination, the global data for the called functions may be accessed within the same context.

The system logs the remote call request in the database tables ARFCSSTATE and ARFCSDATA with all of its parameter values. You can display the log file using transaction SM58. When the calling program reaches a COMMIT WORK, the remote call is forwarded to the requested system.

All tRFCs with a single destination that occur between one COMMIT WORK and the next belong to a single logical unit of work (LUW).

tRFC Process Flow Diagram

You can use transactional RFCs, for example, for complex processes that require updating of related database tables during different phases in a transaction.

Transactional RFC processing ensures that all the planned updates are carried out when the program reaches the COMMIT WORK statement.

Caution

Function modules that are to be called transactionally, cannot have any EXPORT parameters in the definition, since an IMPORTING parameter in the calling program leads to a syntax error.

Note also that you cannot make asynchronous calls to functions that perform call-backs.

System Availability

If the remote system is unavailable, the SAP System schedules the report RSARFCSE for background processing with the relevant transaction ID as variant. This report, which forwards asynchronous calls for execution, is called repeatedly until it succeeds in connecting with the desired system.

When scheduled in batch, RSARFCSE runs automatically at set intervals (the default is every fifteen minutes, for up to 30 attempts). You can customize this interval and the length of time the program should go on trying. Use enhancement programs SABP0000 and SABP0003 to do this.

To configure a destination, call transaction SM59, select the screen for a destination and choose Start of the navigation path Edit Next navigation step TRFC Options End of the navigation path. Thus you can determine the number of connection attempts up to the task and the time between repeat attempts.

If the system is not reachable within the specified amount of time, the system stops calling RSARFCSE, and the status CPICERR is written to the ARFCSDATA table. Within another specified time (the default is eight days), the corresponding entry in the ARFCSSTATE table is deleted (this limit can also be customized). (It is still possible to start such entries in transaction SM59 manually.)

More Information

You can find a description of the statements for tRFC in: