CALL FUNCTION - IN BACKGROUND UNIT
CALL FUNCTION func IN BACKGROUND UNIT oref
Background Remote Function Call (bgRFC) of a remote-enabled function module specified in
func using the
RFC interface. Here,
oref is an
object reference variable pointing to an object whose class implements the interface IF_BGRFC_UNIT.
The object contains all the information required for the Remote Function Call, including the destination, whether to execute a transactional or queued call and, if required, the quantity of queues. If the same object is used for multiple calls, all called function modules are executed in one unit. Conversely, multiple objects of this type can be used in parallel in one internal session, which enables parallel processing.
Parallel processing is executed if queues or destinations in the used objects have different names. If, in successive calls, different objects are used for which the same queues and destinations are specified, they are processed in the same queue one after the other.
For more detailed information about bgRFC, see the
SAP NetWeaver documentation in SAP Help Portal.
Before the introduction of bgRFC, the parallel processing of multiple function modules was only possible
using the addition
AS SEPARATE UNITof the statement
CALL FUNCTION IN BACKGROUND TASK. This same function is provided by the parallel use of multiple objects, which means this addition is no longer necessary.
- If, within the same SAP LUW, bgRFC units and also updates are executed, the bgRFC units are dependent on the update. Only after the update has been processed can the associated bgRFC also be processed. When an incorrect update record is deleted, the corresponding bgRFC units are also deleted. The linkage of bgRFC with the update can be removed using the interface method IF_BGRFC_UNIT~SEPARATE_FROM_UPDATE_TASK of the bgRFC object.
bgRFCs registered in a
that were not started there using
COMMIT WORKare not executed by the
COMMIT WORKof the caller either.
ROLLBACK WORKmay not be executed in a unit. In addition, no implicit database commit can be triggered there.
orefpoints to an invalid object.