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: 

Simulation or Test, BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK

Former Member
0 Kudos
484

Hello,

I call the BAPI_TRANSACTION_COMMIT but would like to use the BAPI_TRANSACTION_ROLLBACK when the user chooses test mode on the selection screen. Objects are being filled with BAPI_ALM_ORDER_MAINTAIN. The BAPI_TRANSACTION_ROLLBACK is being called when there's an error, but will it work if I have a condition for test or simulate?

Thanks,

AJ

1 REPLY 1

Former Member
0 Kudos
229

Yes.. this will work..

When the User selected Test or Simulation from the selection screen check box execute the BAPI BAPI_ALM_ORDER_MAINTAIN so that you can validate the data.. then execute BAPI_TRANSACTION_ROLLBACK so that the document is not commited.. the entire process is rolled back..

if the Simulation or Test is not checked from the selection screen then execute the Bapi

BAPI_ALM_ORDER_MAINTAIN , check for errors in the RETURN internal table if none.. then execute

BAPI_TRANSACTION_COMMIT

This will work.. i have done this in lot of objects.. to make sure the data is correct