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

Commitwork

Former Member
0 Likes
692

hi

what is the use of t he commit work in ABAP

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
646

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
Read only

Former Member
0 Likes
646

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

Read only

Former Member
0 Likes
646

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.

Read only

Former Member
0 Likes
647

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