Ansicht
Dokumentation

ABAPCALL_FUNCTION_BACKGROUND_TASK - CALL FUNCTION BACKGROUND TASK

ABAPCALL_FUNCTION_BACKGROUND_TASK - CALL FUNCTION BACKGROUND TASK

Vendor Master (General Section)   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

CALL FUNCTION, IN BACKGROUND TASK

Short Reference



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

Addition:

... AS SEPARATE UNIT

Effect

Transactional call (tRFC) of a remote-enabled function module specified in func using the RFC interface. The addition DESTINATION can be used to specify a unique destination in dest. If the destination is not specified, the destination NONE is used implicitly. func and dest expect character-like data objects.

The transactional call registers the name of the called function, together with the destination and the actual parameters passed in parameter_list for the current SAP LUW in the DDIC database tables ARFCSSTATE and ARFCSDATA of the current AS ABAP under a unique transaction ID, which is abbreviated as TID, stored in a structure of type ARFCTID from the ABAP Dictionary, viewed using transaction SM58. After registration, the calling program is continued after 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. The statement 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 an SAP LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed using transaction SM59. If the destination does not become available within the specified time, it is recorded in the DDIC database table ARFCSDATA as the entry CPICERR. By default, this entry in database table ARFCSSTATE is deleted after eight days.

Note

background RFC (bgRFC) executed with the statement CALL FUNCTION IN BACKGROUND UNIT is the enhanced successor technology of transactional RFC (tRFC) and makes this technology obsolete. It is strongly recommended that bgRFC is used instead of tRFC.

More Information

For more information about tRFC, see the RFC documentation in the SAP Help Portal.

Addition

... AS SEPARATE UNIT

Effect

When using the addition AS SEPARATE UNIT, the affected function module is executed in a separate RFC session, in which the global data of the function pool is not affected by previous calls. Each function module that is registered with the addition AS SEPARATE UNIT is given its own transaction ID. Without the addition AS SEPARATE UNIT, the usual description applies to the RFC session of the called function modules. This means that, when using the same RFC destination for multiple calls of function modules of to the same function pool, the global data of this function pool is accessed collectively.

Notes

  • The function module ID_OF_BACKGROUNDTASK can be used after a transactional RFC to determine the transaction ID (TID) of the current SAP LUW.
  • The transactional RFC (tRFC) is suitable for implementing LUWs in distributed environments (a typical application is ALE). It should be noted that, although the execution of the function modules within a transaction ID is specified, the order of the LUWs on the RFC servers is not necessarily the same as the order of the SAP LUWs on the RFC client. To achieve the same serialization on RFC servers as well, the tRFC can be extended to queued RFC (qRFC). For this, the function module TRFC_SET_QUEUE_NAME can be called before a transactional RFC. For more information about qRFC, see the RFC documentation in the SAP Help Portal.
  • If tRFC or qRFC are registered in a dialog module and not started with COMMIT WORK, they are not executed by the COMMIT WORK of the caller either.
  • The new variant CALL FUNCTION IN BACKGROUND UNIT (bgRFC) includes and enhances the existing tRFC and qRFC variants. For this reason, it is strongly recommended that bgRFC is used instead of tRFC.
  • When handling the registration entries in the DDIC database tables ARFCSSTATE and ARFCSDATA, it should be noted that they are subject to the regular administration rules for a database LUW. For example, the database LUW is ended by a database rollback, all registration entries of the current database LUW are deleted.





Vendor Master (General Section)   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 8860 Date: 20240419 Time: 225625     sap01-206 ( 149 ms )