CALL FUNCTION - IN BACKGROUND TASK

Syntax

CALL FUNCTION func IN BACKGROUND TASK
                   [DESTINATION dest]
                   parameter_list
                   [AS SEPARATE UNIT].

Addition:

... AS SEPARATE UNIT

Effect

: Transactional call of a remote-enabled function module specified in func via the RFC interface. Using the addition DESTINATION, a unique destination can be specified in dest. If the destination is not specified, the destination "NONE" is used implicitly. Character-type data objects are expected for func and dest.

In the transactional call, the name of the called function, together with the name of the destination and the actual parameters transferred in parameter_list for the current SAP-LUW are registered in the database tables ARFCSSTATE and ARFCSDATA of the current SAP system under the unique transaction ID (abbreviation TID, stored in a structure of type ARFCTID from the ABAP Dictionary, viewed using transaction SM58). After registration, the calling program is continued following the statement CALL FUNCTION.

When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.

If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days.

Addition

... AS SEPARATE UNIT

Effect

: When the addition AS SEPARATE UNIT is used, the relevant function module is executed in a separate context, in which the global data of the function group is not influenced by previous calls. Each function module that is registered with the addition AS SEPARATE UNIT is assigned its own transaction ID. Without the addition AS SEPARATE UNIT, the normal description applies for the context of the called function modules, so that if the same destination is used when calling more than one function module in the same function group, then these calls access the global data for this function group together.

Notes