Show TOC

Background documentationTransactional RFC Client Programs Locate this document in the navigation structure


After having been connected to an SAP system (via RfcOpenConnection), an RFC client program must use the following two RFC calls for working with the tRFC interface:

  • RfcGetTransactionID

    With this call, the RFC library tries to get a TID created by the SAP system. If errors occur, the RFC client program has to reconnect later and must try to repeat this call. Otherwise, the RFC client program can assign this TID with the RFC data, and if the next call is not successful, it can be repeated later.

  • RfcInvokeInTransaction

    With this call, the RFC library will pack all RFC data belonging to an RFC function together with the TID and send them to the SAP system using the tRFC protocol. If an error occurs, the RFC client program has to reconnect later and must try to repeat this RFC call (RfcInvokeInTransaction). In this case, it has to use the old TID and must not get a new TID with RfcGetTransactionID. Otherwise, there is no guarantee that this RFC function will be executed exactly once in the SAP system. After this call is executed successfully, the transaction will be completed once and for all. The RFC client program can then update its own TID management (e.g. delete the TID entry).

Contrary to tRFC between SAP systems, a transaction from an RFC client program contains only one RFC function.

This graphic is explained in the accompanying text.

tRFC Communication with External Systems