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: 

Commitwork

Former Member
0 Kudos

hi

what is the use of t he commit work in ABAP

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

commit work is useful to send the confirmation of changes done to data base..

usuually we use it like this

modify ztable from wa.

if sy-subrc eq 0.

<b>commit work.</b>

if we dont use it

then the data base changes will be done after the progam exectuion

if you use this commit work then , the changes will be done immediately after the execution of this statement

else.

roll back . " this is to with draw the changes done to database.

endif.

thanks & regards,

Venkatesh

3 REPLIES 3

Former Member
0 Kudos

Hi N Naresh

You will use this syntax in your program after you update , insert or delete data in the database . after that It like you confirm to change the data in the data base and you can not change it back again.

Regards

Wiboon

Message was edited by:

Wiboon Chaiyabutsakul

former_member223537
Active Contributor
0 Kudos

Hi,

It is to tell SAP to Update the tables as your confirm about the table contents/data.

If you are not sure about the data & you dont want to save it, then you can give ROLLBACK.

for eg.

You insert record in ZSD_SALES table.

Then you try to insert record in ZSD_DELIVERY table. But record already exists.

So you want to also remove data from ZSD_SALES table.

If you want to remove data then you will give ROLLBACK else you want to save the data in both tables then you will give COMMIT WORK.

Former Member
0 Kudos

Hi,

commit work is useful to send the confirmation of changes done to data base..

usuually we use it like this

modify ztable from wa.

if sy-subrc eq 0.

<b>commit work.</b>

if we dont use it

then the data base changes will be done after the progam exectuion

if you use this commit work then , the changes will be done immediately after the execution of this statement

else.

roll back . " this is to with draw the changes done to database.

endif.

thanks & regards,

Venkatesh