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

what is commit work & roll back

rupali_bhalerao
Explorer
0 Likes
6,934

Hi Experts,

I want to know the basic concept of commit work & roll back.

Regards,

Rupali.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,453

Try this link:

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/content.htm

Open SQL contains the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

These statements are part of the SAP transaction concept, and should only be used in this context.

As well as the COMMIT WORK and ROLLBACK WORK statements, there are other situations where data is implicitly written to the database or rolled back, and where database LUWs therefore begin and end.

Furthermore, the above statements also control SAP LUWs, which extend over several database LUWs.

The ABAP statements COMMIT WORK and ROLLBACK WORK only work like the corresponding Standard SQL statements if the entire application program is represented by a single implicit database LUW, that is, for example, in a single dialog step.

Regards

Neha

5 REPLIES 5
Read only

h_senden2
Active Contributor
4,453

Use the search functionality of this forum or the wiki, and you will find the answer.

But :

a commit work take care of real storage of you db actions in the database.

a roll back does the opposite.

regards,

Hans

Read only

Former Member
0 Likes
4,453

Hi Rupali,

This is regarding the changing the states of DB tables.

if you are trying to modify the DB table

if you modify any record the data base state changes.

if you use COMMIT WORK means the changes are update within the data base and new state is achieved.

for any reason if you think the changes are inappropriate and you want to come back to the previous state of the DB table then we use ROLLBACK key word.

for further info please go through LUW or COMMIT and ROLLBACK key word documentatin

regards

Ramchander Rao.k

Read only

Former Member
0 Likes
4,454

Try this link:

http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3b64358411d1829f0000e829fbfe/content.htm

Open SQL contains the statements

COMMIT WORK.

and

ROLLBACK WORK.

for confirming or undoing database updates. COMMIT WORK always concludes a database LUW and starts a new one. ROLLBACK WORK always undoes all changes back to the start of the database LUW.

These statements are part of the SAP transaction concept, and should only be used in this context.

As well as the COMMIT WORK and ROLLBACK WORK statements, there are other situations where data is implicitly written to the database or rolled back, and where database LUWs therefore begin and end.

Furthermore, the above statements also control SAP LUWs, which extend over several database LUWs.

The ABAP statements COMMIT WORK and ROLLBACK WORK only work like the corresponding Standard SQL statements if the entire application program is represented by a single implicit database LUW, that is, for example, in a single dialog step.

Regards

Neha

Read only

rupali_bhalerao
Explorer
0 Likes
4,453

thanx neha

Read only

0 Likes
4,453

Hi,

Differences between commit work and roll back are given below,

COMMIT WORK ROLLBACK COMMIT validates the modifications made by the current transaction. ROLLBACK erases the modifications made by the current transaction. After execution of COMMIT statement, the transaction cannot be ROLLBACK. Once ROLLBACK is executed database reaches its previous state, i.e. before the execution of the first statement of the transaction. COMMIT occurs when the transaction gets executed successfully. ROLLBACK occurs when the transaction is aborted in middle of the execution.

Regards,

Tanuja.