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: 

Use of commit statement

Former Member
0 Kudos
250

Hi Gurus,

Can we use COMMIT statements generally in our normal SE38 Report Programs....Is there any specific instance in which a COMMIT statement can be used. Please let me know.

Also wanted to know if we can use COMMIT statements inside User Exits.

Thanks

5 REPLIES 5

Former Member
0 Kudos
165

Whats your requirement actually..

If in Program(SE38) if updating/inserting data by INSERT/MODIFY/UPDATE stmt, then u need to use COMMIT WORK...

if updating/inserting by BAPI then then use BAPI for Commit.

manthanraja
Active Participant
0 Kudos
165

generally commit should be avoided inside a user exit ..

Also it is better to go through the documentation before you use commit inside a user exit

(coz it might lead to data inconsistency)

also

the commit need only be used when needed inside any se-38 program.

(after INSERT/MODIFY/UPDATE)

also

refer the links below for more info on user exit commits

Hope this helps

Regards

Manthan.

Former Member
0 Kudos
165

hi,

you can use commit in se38.

there are 2 to 3 ways of commiting.

commit and wait.

use can use bapi to commit.

you can also use commit work.

if u r updating any record or inserting or deleting a record from a database table then you need to commit.

Thanks,

Tanmaya

Former Member
0 Kudos
165

Hi ,

You can write COMMIT WORK after a select statement.

Regards,

Srini.

kesavadas_thekkillath
Active Contributor
0 Kudos
165

Hi you can find a great deal in SAP help regarding this.

Hi,

a transaction flow must adhere to its ACID(Atomicity,Consistency,Integrity and Durabiliy) properties.

The ACID properties of a DBMS allow safe sharing of data to the tables.

and also you may be aware of the states of transaction like start,abort,rollback,commit...

In the transaction flow diagram the commit state comes at last.

Just think if you give a commit work in between the flow and if the data gets replicated in db

and if the transaction gets aborted after the exit, does this make any sense.

In the transactional states the rollback state always comes before commit state.

Its not possible to roll back after a commit state.

As far as i knoe Its not recommended to give a commit in between a transactional flow( ex:in bapi,exits,badi etc )