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

Process CALL TRANSACTION and then a BAPI

Former Member
0 Likes
703

Hi!

I wonder does anyone know a good solution about this. I have to run a CALL TRANSACTION (MR21 transaction) and right after the CALL TRANSACTION (if it was successful) a BAPI also.

However, if the BAPI fails, I have to rollback the modifications of the CALL TRANSACTION.

Will a ROLLBACK WORK solve this problem? I don't think, because MR21 transaction will post a COMMIT at the end.

Can it be rollbacked somehow?

Thank you

Tamá

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
633

HI,

After call transaction there is no rollback.

What you can do is record the transaction two manners.

One recording with save and other without save. Initially run the recording without save and then check if the return table has any messages after using call transaction. If it doesnot have any messages execute the recording with save and then the bapi. If it has error donot execute the bapi.

Also instead of this call transaction you can search for available bapis which suits MR21 where yu will be having the option for test run.

Sorry misread your question.....Solution is search bapi for MR21. If both bapi doesnt have any error the commit

BAPI_M_REVAL_CREATEPRICECHANGE - Try for MR21

Edited by: Keshav.T on Jan 5, 2011 7:45 PM

2 REPLIES 2
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
634

HI,

After call transaction there is no rollback.

What you can do is record the transaction two manners.

One recording with save and other without save. Initially run the recording without save and then check if the return table has any messages after using call transaction. If it doesnot have any messages execute the recording with save and then the bapi. If it has error donot execute the bapi.

Also instead of this call transaction you can search for available bapis which suits MR21 where yu will be having the option for test run.

Sorry misread your question.....Solution is search bapi for MR21. If both bapi doesnt have any error the commit

BAPI_M_REVAL_CREATEPRICECHANGE - Try for MR21

Edited by: Keshav.T on Jan 5, 2011 7:45 PM

Read only

Former Member
0 Likes
633

I once had a similar requirement (although it was a matter of running a number of CALL TRANSACTIONs in a row with no BAPI call. If any transaction failed, then all the previous transactions had to be rolled back. There could be hudreds or thousands.

The only way was to reverse (apply the changes in the opposite sense) the successful transactions.

Rob