03-02-2007 7:20 AM
What is LUW and Uses of it?
explain COMMIT WORK and ROOL BACK with syntax?
03-02-2007 7:25 AM
hi,
An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW. In an application program, you end an SAP LUW with either the COMMIT WORK or ROLLBACK WORK statement. An SAP transaction is an application program that you start using a transaction code. It may contain one or more SAP LUWs. Whenever the system reaches a COMMIT WORK or ROLLBACK WORK statement that is not at the end of the last dialog step of the SAP transaction, it opens a new SAP LUW.
example
modify <tabname> from table <internal table>.
commit work.
03-02-2007 7:28 AM
hi,
in additon to my earlier post
The statement <b>ROLLBACK WORK</b> closes the current SAP-LUW and opens a new one. In doing so, all change requests of the current SAP-LUW are canceled.
The statement <b>COMMIT WORK</b> completes the current SAP LUW and opens a new one, storing all change requests for the current SAP LUW in the process
03-02-2007 7:31 AM
hi
LUW is logic unit of work. LUW holding a collection of dialog steps. A collection of LUW is nothing but a transaction.
LUM types:
-
Database LUW.
SAP LUW.
From one Databse LUW to another database LUW area can be saved using commit work.
Rollback also revert the data from one LUW another LUW. (Commit work creates a new LUW and save the data from new LUW to old LUW. It can't roll bak).
Regards
Bhupal Reddy
03-02-2007 7:52 AM
<b>A Logical Unit of Work (LUW or database transaction) is an inseparable sequence of database operations which must be executed either in its entirety or not at all. For the database system, it thus constitutes a unit.
LUWs help to guarantee database integrity. When an LUW has been successfully concluded, the database is once again in a correct state. If, however, an error occurs within an LUW, all database changes made since the beginning of the LUW are canceled and the database is then in the same state as before the LUW started.
An LUW begins
o each time you start a transaction
o when the database changes of the previous LUW have been confirmed (database
commit) or
o when the database changes of the previous LUW have been cancelled (database rollback)
An LUW ends
o when the database changes have been confirmed (database commit) or
o when the database changes have been canceled (database rollback)</b>
<b>COMMIT WORK. </b>
Executes a database commit and thus closes a logical processing unit or Logical Unit of Work ( LUW ) (see also Transaction processing ). This means that
all database changes are made irrevocable and cannot be reversed with ROLLBACK WORK and
all database locks are released.
COMMIT WORK also
calls the subroutines specified by PERFORM ... ON COMMIT * executes asynchronously any update requests (see CALL FUNCTION ... IN UPDATE TASK ) specified in these subroutines or started just before,
processes the function modules specified in CALL FUNCTION ... IN BACKGROUND TASK ,
cancels all existing locks (see SAP locking concept ) if no update requests exist,
closes all open database cursors (see OPEN CURSOR ) and
resets the time slice counter to 0.
COMMIT WORK belongs to the Open SQL command set.
Return code value
The SY-SUBRC is set to 0.
<b>ROLLBACK WORK.</b>
Closes a logical processing unit by reversing all database changes made since the last COMMIT .
You use this statement if you cannot be certain that all the database changes have been executed correctly.
The update routines are not performed.
ROLLBACK WORK belongs to the Open SQL command set.
<b>Note</b>
If the ROLLBACK statement occurs within a SELECT loop, the processing cannot continue because the database cursor is invalid. After the ROLLBACK statement, you should therefore ensure that all SELECT processing has been explicitly terminated.
03-02-2007 7:58 AM
hi Balu,
Check
SAP LUW (logical unit of work )
http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm
Regards,
Santosh
03-02-2007 8:16 AM
hi
good
go through this link,this ll give you complete ideea about the LUW
http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm
thanks
mrutyun^
03-02-2007 10:43 AM
<b>Logical Units of Work</b>
Database (LUW)
A database LUW is the mechanism used by the database to ensure that its data is always consistent.
SAP (LUW)
An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW.
http://help.sap.com/saphelp_46c/helpdata/en/41/7af4c2a79e11d1950f0000e82de14a/frameset.htm
<b>COMMIT</b> Syntax :
COMMIT WORK.
Executes a database commit and thus closes a Logical Unit of Work (LUW)
http://help.sap.com/saphelp_46c/helpdata/en/34/8e73b66df74873e10000009b38f9b8/frameset.htm
<b>ROLLBACK</b> Syntax:
ROLLBACK
Closes a logical processing unit by reversing all database changes made since the last COMMIT.
http://help.sap.com/saphelp_46c/helpdata/en/34/8e73d76df74873e10000009b38f9b8/frameset.htm
regards,
Siraj