‎2010 Aug 19 3:13 PM
Is it mandatory to issue 'Commit Work' statement to terminate the program in SAP LUW? If not provided would the program go into infinite loop?
‎2010 Aug 19 3:33 PM
First of all COMMIT WORK doesn't terminate the program in SAP LUW rather it terminates the LUW.
If you don't use an explicit COMMIT at the end of the program an implicit COMMIT occurs. Read SAP documentation on COMMIT WORK, SAP Logical Unit of Work.
BR,
Suhas
‎2010 Aug 19 3:34 PM
No, COMMIT WORK is intended to flush update queues and allow SAP dispatcher to then assign the data to update processes that write the data to the database tables. If one is doing an update from a customer program, generally one writes a COMMIT WORK at the appropriate point(s) in the code.
Edited by: BreakPoint on Aug 19, 2010 5:25 PM
Correct my statement about program ending.
‎2010 Aug 19 8:34 PM
I will give you a while to explain about update debugging before locking the thread (special exception for you...
But generally if the OP has shown no inclination to do a basic search then answering it is spoon-feeding.
The question also appears to be 1: 1 copy&pasted from an interview catalogue.....
Cheers,
Julius
‎2010 Aug 19 9:20 PM
every time a dialog (dynpro) is closed, automatically triggers a commit work!
When you use:
CALL TRANSACTION
LEAVE TO TRANSACTION
Automatically triggers a commit work..
You dont need to use COMMIT WORK, at least, that want to implement advanced update techniques (Asynchronus, update function modules, etc)
‎2010 Aug 19 11:05 PM
... just before the thread gets locked:
There is no such thing as an implicit commit work. The implicit commit is a database commit, that means after every process interruption as i.e. processing of any screen and the end of program execution all database activities are committed, they can not be rolled back.
The explicit ABAP statement COMMIT WORK will termiante the current LUW and, additionally start execution of all asynchronous database operations (Call function in update task), start all PERFORM ON COMMIT routines.
Most BAPI calls need a subsequent COMMIT WORK, better issued by function Call BAPI_TRANSACTION_COMMIT.
The documentation has more information. One major truth is: In 'simple' programs that do some INSERTS, UPDATES and MODYFYs on database tables, you do not need any COMMIT WORK. And if screen processing happens afterwards, you can not ROLL BACK.
Regards,
Clemens
‎2010 Aug 19 11:09 PM
‎2010 Aug 19 6:48 PM