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: 

bapi commit

Former Member
0 Kudos

i am using a bapi in my user exit . Do i need to call the bapi commit ? i cant test the user exit now so i am not sure if the bapi really works or not .

1 ACCEPTED SOLUTION

former_member214999
Participant
0 Kudos

Deepthi,

If you are using this in the user exit, you dont need to use commit. It will get commited along with the main program. If you want to test it, you can use SE37 and use test sequence.

SE37 FM->test->test sequence . here use your BAPI and also BAPI transaction commit.

3 REPLIES 3

former_member214999
Participant
0 Kudos

Deepthi,

If you are using this in the user exit, you dont need to use commit. It will get commited along with the main program. If you want to test it, you can use SE37 and use test sequence.

SE37 FM->test->test sequence . here use your BAPI and also BAPI transaction commit.

Former Member
0 Kudos

Function BAPI_TRANSACTION_COMMIT does nothing else but a simple COMMIT WORK.

COMMIT WORK not only commits all database changes (insert, update, delete) to the database making them available for all other and later processes and transactions. In BAPI function modules, many database changens are not done directly but using the ABAP syntax PERFORM ... ON COMMIT:

That means, the form is not executed until the next COMMIT WORK ( or Call of BAPI_TRANSACTION_COMMIT).

All INSERT, UPDATE and DELETE is committed automatically at the end of transaction or execution of a report. PERFORM ... ON COMMIT needs the explicit COMMIT WORK.

Thats the reason why you will never find objects (orders, assets,...) created using BAPI in test environment using SE37 althoug you receive a success message. You must do it in program and after the BAPI call issue COMMIT WORK or call function BAPI_TRANSACTION_COMMIT.

You should be aware, that COMMIT WORK will commit everything to the database in the current LUW (transaction, logical unit of work), not only what you created.

If your routine is a child routine of a standard process, never use COMMIT WORK. The calling transaction will know the right time to commit and all changes you did are committed as well - or rolled back if an error occurred.

Regards,

0 Kudos

There is a input paramter in bapi , commit_control . I have set to 'E' and its getting committed even without the need of bapi_transaction_commit. Thanks for your responses .