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

Commit Work

Former Member
0 Likes
816

Hi Guy's,

Any one help me what is the use of "commit work" key word.

Thanks,

Sai.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
787

Check this URL.

http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/7849b8bec911d4b2e80050dadfb92b/content.htm

http://www.sap-img.com/fu018.htm

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 8:37 AM

7 REPLIES 7
Read only

Former Member
0 Likes
788

Check this URL.

http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/7849b8bec911d4b2e80050dadfb92b/content.htm

http://www.sap-img.com/fu018.htm

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 8:37 AM

Read only

rainer_hbenthal
Active Contributor
0 Likes
787

Database changes are only temporary until report end. At normal report end, all database changes are committet and persistent. If the report abends, all database changes are taken back. With "commit work" you can enforce that all database changes until this point are commitet ad therefor are persistent, even if the report abends afterwards.

For more information use the online help.

Read only

Former Member
0 Likes
787

HI,

Simply Commit Work is used to make the permanent changes to the database.

In the same way RollOut means revert the last changes.

<REMOVED BY MODERATOR>

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 8:37 AM

Read only

Former Member
0 Likes
787

hi....

commit work is used mainly in case of database changes...

if in the report at certain point you want to make chages to databasethen you can use commit work....to update changes to your database.....

mot of the times in bapis you have to use expicit commit work for database changes....

Read only

Former Member
0 Likes
787

Hi,

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.

The database changes that occur within a database LUW are not actually written to the database until after the database commit. Until this happens, you can use a database rollback to reverse the changes.

The Open SQL statements INSERT, UPDATE, MODIFY, and DELETE allow you to program database changes in this case we need to use commit work statement to reflect the changes.

Look at this piece of code you will get clear idea of COMMIT WORK statement , here if update happens it will commit else rollback.

IF g_ret_check = 'X'.
        UPDATE zo9_user_status
                SET  sub_date = sy-datum
                     sub_time = sy-uzeit
                     status = g_wa_outtab-status
                WHERE  representative = g_wa_outtab-representative AND
                       selection_id = g_wa_outtab-selection_id AND
                       sub_date = g_wa_outtab-sub_date AND
                       sub_time = g_wa_outtab-sub_time AND
                       superior = g_wa_outtab-superior.

        IF sy-subrc EQ 0.
          COMMIT WORK.
          l_error = 'X1'.

        ELSE.
          l_error = 'X2'.
          CLEAR l_error.
          ROLLBACK WORK.
        ENDIF.

This will help you.

<REMOVED BY MODERATOR>

Thanks,

Dhanashri.

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 8:38 AM

Read only

Former Member
0 Likes
787

hiii

COMMIT WORK is used to save updation.if it will get an error then roll back will done.or else save.

you can check or can do commit work by using following FM also.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
     EXPORTING
       WAIT          = WAIT
     IMPORTING
       RETURN        = RETURN

<REMOVED BY MODERATOR>

thx

twinkal

Edited by: Alvaro Tejada Galindo on Jun 20, 2008 9:26 AM

Read only

Former Member
0 Likes
787

hi this used when the lock object mechanism is called ....means when a master record is inserting or modifying or deleteing ...then we will lock the record and unlock the record during the process internally ..to retain the changes we will use the commit work..