SAP NetWeaver RFC SDK 7.50
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Transaction (tRFC & qRFC) API

Functions for sending transactional and queued RFCs into R/3. More...

Classes

struct  _RFC_TRANSACTION_HANDLE
 Handle to a data container for a tRFC/qRFC LUW. More...
 

Functions

DECL_EXP RFC_RC SAP_API RfcGetTransactionID (RFC_CONNECTION_HANDLE rfcHandle, RFC_TID tid, RFC_ERROR_INFO *errorInfo)
 Retrieves a unique 24-digit transaction ID from the backend. More...
 
DECL_EXP
RFC_TRANSACTION_HANDLE SAP_API 
RfcCreateTransaction (RFC_CONNECTION_HANDLE rfcHandle, RFC_TID tid, SAP_UC const *queueName, RFC_ERROR_INFO *errorInfo)
 Creates a container for executing a (multi-step) transactional call. More...
 
DECL_EXP RFC_RC SAP_API RfcInvokeInTransaction (RFC_TRANSACTION_HANDLE tHandle, RFC_FUNCTION_HANDLE funcHandle, RFC_ERROR_INFO *errorInfo)
 Adds a function module call to a transaction. More...
 
DECL_EXP RFC_RC SAP_API RfcSubmitTransaction (RFC_TRANSACTION_HANDLE tHandle, RFC_ERROR_INFO *errorInfo)
 Executes the entire LUW in the backend system as an "atomic unit". More...
 
DECL_EXP RFC_RC SAP_API RfcConfirmTransaction (RFC_TRANSACTION_HANDLE tHandle, RFC_ERROR_INFO *errorInfo)
 Removes the TID contained in the RFC_TRANSACTION_HANDLE from the backend's ARFCRSTATE table. More...
 
DECL_EXP RFC_RC SAP_API RfcConfirmTransactionID (RFC_CONNECTION_HANDLE rfcHandle, RFC_TID tid, RFC_ERROR_INFO *errorInfo)
 Convenience function to remove the TID contained in a previous RFC_TRANSACTION_HANDLE from the backend's ARFCRSTATE table, without the need of still having the RFC_TRANSACTION_HANDLE at hand. More...
 
DECL_EXP RFC_RC SAP_API RfcDestroyTransaction (RFC_TRANSACTION_HANDLE tHandle, RFC_ERROR_INFO *errorInfo)
 Releases the memory of the transaction container. More...
 

Detailed Description

Functions for sending transactional and queued RFCs into R/3.

Function Documentation

DECL_EXP RFC_RC SAP_API RfcConfirmTransaction ( RFC_TRANSACTION_HANDLE  tHandle,
RFC_ERROR_INFO errorInfo 
)

Removes the TID contained in the RFC_TRANSACTION_HANDLE from the backend's ARFCRSTATE table.

After RfcSubmitTransaction() has finally succeeded, call RfcConfirmTransaction() to clean up the transaction handling table in the backend.

Warning
Attention: after this call, the backend is no longer protected against this TID. So another RfcSubmitTransaction() with the same transaction handle would result in a duplicate.
Parameters
[in]tHandleA transaction handle that has successfully been submitted.
[out]*errorInfoAdditional error information in case of a network problem.
Warning
You may retry the Confirm step, if you get an error here, but do not retry the Submit step!
Returns
RFC_RC
DECL_EXP RFC_RC SAP_API RfcConfirmTransactionID ( RFC_CONNECTION_HANDLE  rfcHandle,
RFC_TID  tid,
RFC_ERROR_INFO errorInfo 
)

Convenience function to remove the TID contained in a previous RFC_TRANSACTION_HANDLE from the backend's ARFCRSTATE table, without the need of still having the RFC_TRANSACTION_HANDLE at hand.

After RfcSubmitTransaction() has finally succeeded, call RfcConfirmTransactionID() to clean up the transaction handling table in the backend. This function can be called after the RFC_TRANSACTION_HANDLE has already been deleted.

Warning
Attention: after this call, the backend is no longer protected against this TID. So another RfcSubmitTransaction() with the same transaction handle would result in a duplicate.
Parameters
[in]rfcHandleA connection into the same system, into which the corresponding transaction has been sent via RfcSubmitTransaction().
[in]tidA unique 24 character ID.
[out]*errorInfoAdditional error information in case of a network problem.
Warning
You may retry the Confirm step, if you get an error here, but do not retry the Submit step!
Returns
RFC_RC
DECL_EXP RFC_TRANSACTION_HANDLE SAP_API RfcCreateTransaction ( RFC_CONNECTION_HANDLE  rfcHandle,
RFC_TID  tid,
SAP_UC const *  queueName,
RFC_ERROR_INFO errorInfo 
)

Creates a container for executing a (multi-step) transactional call.

If queueName is NULL, tRFC will be used, otherwise qRFC. Use RfcInvokeInTransaction() to add one (or more) function modules to the transactional call. When sending this transactional call to the backend via RfcSubmitTransaction(), the backend will then treat all function modules in the RFC_TRANSACTION_HANDLE as one LUW.

Parameters
[in]rfcHandleClient connection to the backend, into which you want to send this tRFC/qRFC LUW.
[in]tidA unique 24 character ID.
[in]*queueNameFor tRFC set this to NULL, for qRFC specify the name of a qRFC inbound queue in the backend.
[out]*errorInfoError information in case there is a problem with the connection.
Returns
A data container that can be filled with several function modules.
DECL_EXP RFC_RC SAP_API RfcDestroyTransaction ( RFC_TRANSACTION_HANDLE  tHandle,
RFC_ERROR_INFO errorInfo 
)

Releases the memory of the transaction container.

Parameters
[in]tHandleA transaction handle that is no longer needed.
[out]*errorInfoNot much that can go wrong here...
Returns
RFC_RC
DECL_EXP RFC_RC SAP_API RfcGetTransactionID ( RFC_CONNECTION_HANDLE  rfcHandle,
RFC_TID  tid,
RFC_ERROR_INFO errorInfo 
)

Retrieves a unique 24-digit transaction ID from the backend.

If you specify NULL as connection handle, the API will attempt to generate a TID locally using the operating system's UUID algorithms. (Currently not possible on AIX systems.)

Parameters
[in]rfcHandleClient connection to a backend or NULL, if you want to create a TID locally.
[out]tidWill be filled with the transaction ID.
[out]*errorInfoError information in case there is a problem with the connection.
Returns
RFC_RC
DECL_EXP RFC_RC SAP_API RfcInvokeInTransaction ( RFC_TRANSACTION_HANDLE  tHandle,
RFC_FUNCTION_HANDLE  funcHandle,
RFC_ERROR_INFO errorInfo 
)

Adds a function module call to a transaction.

Can be used multiple times on one tHandle.

Parameters
[in]tHandleA transaction handle created via RfcCreateTransaction().
[in]funcHandleAn RFC_FUNCTION_HANDLE, whose IMPORTING, CHANGING and TABLES parameters have been filled.
Note
that tRFC/qRFC calls have no return values, so the EXPORTING parameters of this function handle will not be filled, nor will the changes to the CHANGING/TABLES parameters be returned.
Parameters
[out]*errorInfoActually there is nothing that can go wrong here except for invalid handles and out of memory.
Returns
RFC_RC
DECL_EXP RFC_RC SAP_API RfcSubmitTransaction ( RFC_TRANSACTION_HANDLE  tHandle,
RFC_ERROR_INFO errorInfo 
)

Executes the entire LUW in the backend system as an "atomic unit".

This step can be repeated until it finally succeeds (RFC_OK). The transaction handling in the backend system protects against duplicates (until you remove the TID from the backend's status tables using RfcConfirmTransaction()).

Parameters
[in]tHandleA transaction handle filled with one or several function modules.
[out]*errorInfoAdditional error information in case anything goes wrong.
Returns
RFC_RC