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

Regarding COMMIT WORK

soumya_jose3
Active Contributor
0 Likes
1,039

Hi,

I am using two BAPIs 'BAPI_ACC_ACTIVITY_ALLOC_POST' and 'BAPI_NETWORK_CONF_ADD' in my custom function module. These two BAPIs are used as explained below:

1) Fisrt the BAPI 'BAPI_ACC_ACTIVITY_ALLOC_POST' is called. If sy-subrc NE '0', the error messages are read.

2) Then the BAPI 'BAPI_NETWORK_CONF_ADD' is called. If sy-subrc NE '0', its error messages are read.

3) If there is no error for the two BAPIs called above, then the actual posting is done by calling the BAPI

'BAPI_ACC_ACTIVITY_ALLOC_POST'. If sy-subrc EQ 0, Commit work.

I would like to know if the Commit work in third step will commit the changes of the steps 1 and 2 as the the statement COMMIT WORK completes the current SAP LUW.

Or will it commit the step 3 only.

Thanks & Regards,

Soumya.

1 ACCEPTED SOLUTION
Read only

former_member242255
Active Contributor
0 Likes
900

it will commit the 2 steps work.

Regards,

Sravan

7 REPLIES 7
Read only

former_member242255
Active Contributor
0 Likes
901

it will commit the 2 steps work.

Regards,

Sravan

Read only

Former Member
0 Likes
900

Hi Soumya,

It will commit only for the 3ed step.

if subrc= 0 then you need to commit remainiing BAPI's aswell.

Regards!

Read only

Former Member
0 Likes
900

Hi Soumya,

COMMIT WORK will commit the SAP LUW.

if sy-subrc eq 0 in the third step then all the 3 steps will be commited.

Regrds,

Phani.

Read only

Former Member
0 Likes
900

hi,

yes it will commit step 1 and 2

Commit is used to write the changes from buffer to the database

thanks

Read only

0 Likes
900

Hi,

I need to commit the step 3 only. Will a roll back work before calling the BAPI in step 3 will help?

Regards,

Soumya.

Read only

0 Likes
900

Hi soumya,

you can rollback for the step 1& 2 if sy-subrc ne 0.

and then use the comit work if sy-subrc eq 0 for step 3.

Hope this will help you.

regards,

Phani.

Read only

Former Member
0 Likes
900

all d steps wud be committed

regards

Aakash Banga