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: 

commit work

Former Member
0 Kudos

Hi all,

Please help me in this issue,

When we using Update ABAP statement what is the need of using again a commit statement if we dont use commit statement.

Thanks & Regards

Reddy

1 ACCEPTED SOLUTION

mohammed_moqeeth
Active Participant
0 Kudos

Hello Reddy,

COMMIT is used when you code directly in ABAP and make changes in the database and want to reflect in the database immediately.

When you perform COMMIT , all the LUW s work will be reflected to the database,

COMMIT WORK is the key word to make the database change. And whereas ROLLBACK is the opposite to commit work,

This statement will apply any outstanding database updates and wait until they have actually been put on the database before proceeding to the next statement.

An ordinary commit work will initiate the process to update the databases in a separate task and will press on in your abap.

COMMIT WORK: ( Asynchronous)

Your program does not wait for any acknowledgement. it just start executing the next statment after COMMIT WORK.

<u><b>For your kind reference please check the below link</b></u>

<b>http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3b64358411d1829f0000e

829fbfe/content.htm</b>

<b>

Reward points for all useful answers....

Cheers !

Moqeeth.</b>

4 REPLIES 4

Former Member
0 Kudos

it will update the database immediatly if we use commit statement

it will use generally for synchronous update case

Former Member
0 Kudos

Hi Reddy,

When we update a database, in the real time usage of the data, the updates should reflect the table immediately. Otherwise wrong data would be shown to persons who access it at the same time.

In order to ensure correct data availability at all times we do a commit immediately after the update.

Take the case of a airport using a database. lets say u've checked out the availability of tickets and it shows 2 tickets available. now if you have purchased a ticket. the database table is updated with the remaining one and if the commit is not performed, another person also sees 2 tickets and if he tries to book the two tickets that would be a mess. so u probably would have understood the importance of commiting after update.

<b>Reward points if I answered your question properly</b>

Kiran

Former Member
0 Kudos

A commit is related to the SAP LUW (Logical Unit of Work) concept. Do a commit whenever an LUW is complete. For most custom table updates, this is the end of the program and since a commit is done when the program completes, there is no need to code it.

Rob

mohammed_moqeeth
Active Participant
0 Kudos

Hello Reddy,

COMMIT is used when you code directly in ABAP and make changes in the database and want to reflect in the database immediately.

When you perform COMMIT , all the LUW s work will be reflected to the database,

COMMIT WORK is the key word to make the database change. And whereas ROLLBACK is the opposite to commit work,

This statement will apply any outstanding database updates and wait until they have actually been put on the database before proceeding to the next statement.

An ordinary commit work will initiate the process to update the databases in a separate task and will press on in your abap.

COMMIT WORK: ( Asynchronous)

Your program does not wait for any acknowledgement. it just start executing the next statment after COMMIT WORK.

<u><b>For your kind reference please check the below link</b></u>

<b>http://help.sap.com/saphelp_erp2005vp/helpdata/en/fc/eb3b64358411d1829f0000e

829fbfe/content.htm</b>

<b>

Reward points for all useful answers....

Cheers !

Moqeeth.</b>