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

BAPI Commit & Rollback

Former Member
0 Likes
785

Hi All,

Emp-id 001 is updating a record with key empid=001 USING BAPI UPDATE_EMPLOYEE .

This BAPI has UPDATE Emp-id command.

Emp-id 002 is updating a record with key empid=002 USING BAPI UPDATE_EMPLOYEE .

Now, Emp-id 002 calls BAPI_TRANSACTION_ROLLBACK.

So will both the records be rollbacked. Because i want that depending on the record(primary key) it should rollback only that record.

This is a scenario of two users executing program simultaneously.

Please provide any pointers, inputs.

Best regards,

Prashant

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
607

Prashant,

The commits and rollbacks are specific to the session even if the same program is being executed. So, here the changes of emp1 will be committed and that of emp2 will be rolled back. Each session / user will have their own LUW.

Regards,

Ravi

Note : Please mark the helpful answers

4 REPLIES 4
Read only

Former Member
0 Likes
608

Prashant,

The commits and rollbacks are specific to the session even if the same program is being executed. So, here the changes of emp1 will be committed and that of emp2 will be rolled back. Each session / user will have their own LUW.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
607

Hi Prashant,

After the first user updates the record, call the commit function using 'BAPI_TRANSACTION_COMMIT'.

Now after the second user updates, if the rollback is called, only the second change will be rolled back, the first change will not be reverted. That is only those changes till the previous commit will be rolled back

Thanks,

Susmitha

Read only

Former Member
0 Likes
607

Hi !

Commit and Rollback allways refer to the SAME "logical unit of work" (LUW).

Parallel and other LUWs do not have any influence !

Rollback can only go back up to the last COMMIT.

Regards

Rainer

Points are welcome if that helped a bit.

Read only

0 Likes
607

Susmitha,

The info you are giving is misleading.

The changes done by the user1 and user2 are different. The loigc of COMMIT and ROLLBACK is not applicable here at all as there are different sessions and different LUW's.

Regards,

Ravi