‎2009 Sep 08 1:40 PM
Hi Experts!
I have function module which I call with 'IN BACKGROUND TASK' addition.
Is it correct to have commit work/rollback work operators in this module?
If not then what can be done co allow some logic with commit/rollback operators inside such FM.
Thanks in advance!
‎2009 Sep 08 1:45 PM
yes you can use.
just from SAP help manual for this--
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.
‎2009 Sep 08 1:45 PM
yes you can use.
just from SAP help manual for this--
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.
‎2009 Sep 08 7:05 PM
Soumyaprakash,
It is not mentioned in your quote if commit/rollback can be called inside the transactional function module.
Could you explain the difference of 'IN BACKGROUND TASK' from 'IN UPDATE TASK' which makes it possible to use these operators. Because it is restricted to use them within 'IN UPDATE TASK' modules.
Thanks!
‎2009 Sep 08 2:02 PM
Hi,
After succesfully calling your FM of BAPI you van use BAPI_TRANSACTION_COMMIT to commit your update.
Succes,
Rob