5 Replies Latest reply: Oct 31, 2007 7:49 AM by Chitra Parameswaran RSS

What is LUW?

Ramganesan Karuppaiah
Currently Being Moderated

Hi,

 

 

Could you please explain me  abt LUW (Logical Unit of Work) and send me the related documents also.

 

 

Regards,

Ramganesan.

  • Re: What is LUW?
    karthikeyan palaniayya
    Currently Being Moderated

    hi

    What is LUW or Database LUW or Database Transaction ?- A “LUW” ( logical unit of work ) is the span of time during which any database updates must be performed . Either they are all performed ( committed ) , or they are all thrown away ( rolled back ).

     

    LUW ( or “database LUW” or “database transaction” )

    This is the set of updates terminated by a database commit. A LUW lasts, at most, from one screen change to the next ( because the SAP system triggers database commits automatically at every screen change ).

     

    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.

    Go To the link:

    http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm

     

    An LUW begins

     

    - Each time you start a transaction

    - When the database changes of the previous LUW have been confirmed (database commit) or

    - when the database changes of the previous LUW have been cancelled (database rollback)

     

    An LUW ends

     

    - When the database changes have been confirmed (database commit) or

    - When the database changes have been canceled (database rollback)

     

    What is SAP LUW or Update Transaction ?

    - Update transaction ( or “SAP LUW”)

    This is a set of updates terminated by an ABAP/4 commit. A SAP LUW may last much longer than a database LUW, since most update processing extends over multiple transaction screens.The programmer terminates an update transaction by issuing a COMMIT WORK statement.

    regards

    karthik

  • Re: What is LUW?
    Anji Reddy Vangala
    Currently Being Moderated

    Hi

    The R/3 system is multi user system and many users access the same information at the same time, which is mainly DATA. Consider the case where one user is modifying a record, and second user is trying to delete the same record. If the second user is successful in deleting the record then the first user will face problem for modifying the record that is already deleted. The avoid such situation, R/3 system has provided Logical Unit of Work, which is defined as a locking mechanism to protect transaction integrity. Of course, there are other measures, which ensures data integrity like check table i.e. foreign key relationship. Within SAP system there are three types of transaction and may be distinguished as:

     

    • Database transaction known as LUW. It can be defined as a period in which operation requested must be performed as a unit, i.e. all or nothing operation. At the end of LUW, either of the database changes are committed or rolled back.

    • Update transaction or SAP LUW. One SAP LUW can have several databases LUW. So a set of a database is either committed or rolled back. The special ABAP/4 command COMMIT WORK, marks the end of a SAP LUW.

    • ABAP/4 transaction. Is made up of a set of related task combined under one transaction code. ABAP/4 transactions are for programming environment, in which ABAP/4 transaction functions like one complete object containing screens, menus and transaction codes.

     

    R/3 system has provided in built locking mechanism, which defines the Logical Unit of Work. Also user can set his own locking mechanism. The LUW starts when a lock entry in the system table is created, and it ends when the lock is released.

     

    To provide the user the facility to communicate with the table in order to modify or delete or insert data, R/3 has provided tool called SCREEN PAINTER. This tool allows you to design screen, process screen through program and update the database table. SAP has provided one and only one way to update the database table, i.e. transaction. Though you can update database table by using open SQL statement through program, SAP usually doesn’t recommend this kind of updating. Many standard transactions are available to update standard table but if the need arises, the developer should be able to develop new transaction, which allows the updating of database tables. This can be achieved by using various components of screen painter.

     

     

    Regards

    Anji

  • Re: What is LUW?
    Srikanth Adivanna
    Currently Being Moderated

    hi ramaganeshan,

                             LUW works either all or none principle. LUW are of two types one is database LUW and another one is SAP LUW.

    Database LUW happens implicitly when ever screen changes in SAP b'coz for every screen change commit work happens .so it is done implicitly.

    SAP LUW  works with bundle (group of sceens) technique and it works either all or none .

    It means for example if I want to enter data in a particular transaction which contains 5 screens.I have entered 2 screens and come out of transaction with out completion of entire 5 screens.so it wont store in database as data is not completly filled in entire transaction. so it works either all or none way.

    I have given as per my knowledge .if u still have queries give the response.

     

                           Reward me if it is usful.

    Thanks,

    Srikanth A

  • Re: What is LUW?
    Chitra Parameswaran
    Currently Being Moderated

    Hi Ramganesan,

     

    Check this.

     

    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)

     

    COMMIT WORK.

    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.

     

    ROLLBACK WORK.

    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.

    Note

    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.

     

    A detailed documentation for the LUWs.

    http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4bfa79e11d1950f0000e82de14a/content.htm

     

     

    Reward If Useful.

     

    Regards,

    Chitra

Actions