Skip to Content
author's profile photo Former Member
Former Member

Rollback for BAPI

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 04:31 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 05:13 AM

    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?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.