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

Doubt in COMMIT WORK

ThangaPrakash
Active Contributor
0 Likes
801

I have the below code, where the commit work is after the loop.

LOOP AT itab INTO str.

  UPDATE dtab FROM str.

ENDLOOP.

COMMIT WORK.

As per my understanding an update work process will be created after the COMMIT WORK. Is this can be viewed in SM50 ?

In case the work process created is not processed and ON HOLD. If i try to update the dtab table again, is there is a possibility I can get a lock error since the last work process in not processed.

Regards,

Thanga

4 REPLIES 4
Read only

Former Member
0 Likes
731

I dont think Commit Work is going to do that, its job is to complete one LUW and updates database with pending data in the temporary memory, in the above case the location of commit work is correct.

Read only

Former Member
0 Likes
731

Hi, UPDATE dtab FROM str. will work without commit work

Read only

Former Member
0 Likes
731


Hi Thanga,

If you are not using update task ( CALL FUNCTION IN UPDATE TASK ) / background tasks(CALL FUNCTION IN BACKGROUND TASK ), then commit work statement is optional. System will do implicit commit after the program ends. However to be on the safer side, you should explicitly code it.

https://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm

Please note that - If you are directly updating the table in your program without using update task, no entry exists in SM13-  Monitor Update task.

Regards,

DPM

Read only

former_member228804
Participant
0 Likes
731

Hello Thanga Prakash,

     Here your directly updating a table. Please make sure that you are not updating a standard table, as this may result into unimaginable consequences.

     If you wish to update a custom table you need not use COMMIT WOEK. No job will be triggered. The UPDATE processing will happen in a LUW.

Regards,

Dnyanesh.