Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Calling commit/rollback work inside FM 'IN BACKGROUND TASK'

Former Member
0 Likes
3,171

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!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,259

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.

3 REPLIES 3
Read only

Former Member
0 Likes
1,260

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.

Read only

1,259

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!

Read only

Former Member
0 Likes
1,259

Hi,

After succesfully calling your FM of BAPI you van use BAPI_TRANSACTION_COMMIT to commit your update.

Succes,

Rob