Application Development 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: 

Rollback for BAPI

Former Member
0 Kudos
96

In my application, I use 3 BAPIs executed one after the other. If any one of these BAPIs fail, I should rollback whatever database updates I did using the other BAPIs. Is it possible to achieve this? and how?

call BAPI A

if BAPI-A success

call BAPI-B

if BAPI-B suceess

call BAPI-C

if BAPI-C success

commit BAPI-A BAPI-B BAPI-C

else

rollback BAPI-A BAPI-B

else

rollback BAPI-A

endif.

Points will be rewarded.

2 REPLIES 2

Former Member
0 Kudos
24

it is possiable.

if BAPI-A success

call BAPI-B

commit BAPI-A BAPI-B BAPI-C

if BAPI-B suceess

commit BAPI-A BAPI-B BAPI-C

call BAPI-C

if BAPI-C success

commit BAPI-A BAPI-B BAPI-C

else

rollback BAPI-A BAPI-B

endif.

else

rollback BAPI-A

endif.

else

rollback BAPI-A

endi.

Former Member
0 Kudos
24

BAPI_COMMIT or BAPI_ROLLBACK will work for the last executed BAPI only -


> is this correct?

when i execute bapi_transaction_rollback for BAPI A, how will rollback BAPI know which bapi update to be rolled back?