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

what is LUW

Former Member
0 Likes
4,071

hi ,

what is LUW . where do we practically use it .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,061

Hi

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)

SAP memory and ABAP memoryUsing SAP memory. User-specific memory retained for the duration of the session. Can only be used for simple field values.

Using ABAP memory. Can be used to transfer data between internal modi. Can be used to transfer any ABAP/4 variables ( Fields, strings, internal tables, complex objects)

SAP memoryYou use the SPA/GPA parameters to pass data. These paramters are saved globally in memory. The paramters are indetified by a three-character code.

In dialog programs you can SET and GET these parameters in the attribute window of the screen field, by marking the SET and GET fields and put the name of the parameter in the ParameterId field.

In a program ( Dialog or Report ) you can use the GET PARAMETER and SET PARAMETER statements:

set parameter id 'RV1' field <fieldname>

get parameter id 'RV1' field <fieldname>

also check this link

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

Cheers

Snehi Chouhan

5 REPLIES 5
Read only

Former Member
0 Likes
1,061

To take a non-technical example, when you walk up to an ATM to withdraw money from your account, there are 2 transactions - (1) credit cash, and (2) debit your account. Those two transactions are 1 LUW, and until both are completed successfully, you don't want to commit the transactions to the database. If the first one is committed, and the second one fails, you'll have money that is not debited from your account.

SAP's implementation of a LUW is pretty complex.

Here is some help about it.

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

Let one user is modifying a record and the second user is trying to delete the same record at the same time.

If the second user is successful in deleting the record, then the first user will face problem in modifying the record.

To avoid such problems, SAP has introduced LUW (Logical unit of Work)

LUW is defined as Locking Mechanism to protect transaction integrity.

Types of LUWs:

Database transaction or LUW.

Update transaction or SAPLUW.

ABAP/4 Transaction.

database transaction

Database transaction or LUW is defined as a period in which operation requested must be performed as one unit.

At the end of LUW, either the database changes are committed or rolled back.

SAP LUW

One SAP LUW can have several databases LUW. So a set of database transactions either committed or rolled back.

The special ABAP/4 command ‘Commit work’ marks the end of SAP LUW.

ABAP/4 Transaction

It is made up of a set of related task combined under one transaction code.

ABAP/4 transaction functions like one complete object containing screens, menus and transaction code.

Check this documentation..

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

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.

Read only

Former Member
0 Likes
1,062

Hi

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)

SAP memory and ABAP memoryUsing SAP memory. User-specific memory retained for the duration of the session. Can only be used for simple field values.

Using ABAP memory. Can be used to transfer data between internal modi. Can be used to transfer any ABAP/4 variables ( Fields, strings, internal tables, complex objects)

SAP memoryYou use the SPA/GPA parameters to pass data. These paramters are saved globally in memory. The paramters are indetified by a three-character code.

In dialog programs you can SET and GET these parameters in the attribute window of the screen field, by marking the SET and GET fields and put the name of the parameter in the ParameterId field.

In a program ( Dialog or Report ) you can use the GET PARAMETER and SET PARAMETER statements:

set parameter id 'RV1' field <fieldname>

get parameter id 'RV1' field <fieldname>

also check this link

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

Cheers

Snehi Chouhan

Read only

Former Member
0 Likes
1,061

Hi,

Check these links on LUW's

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

http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4c2a79e11d1950f0000e82de14a/frameset.htm

http://help.sap.com/saphelp_47x200/helpdata/en/41/7af4b9a79e11d1950f0000e82de14a/frameset.htm

An SAP LUW is a logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW.

There are various bundling techniques that you can use to ensure that all of the database updates belonging to an SAP LUW are made in the same single database LUW.

Let one user is modifying a record and the second user is trying to delete the same record at the same time. If the second user is successful in deleting the record, then the first user will face problem in modifying the record. To avoid such problems, SAP has introduced LUW (Logical unit of Work)

LUW is defined as Locking Mechanism to protect transaction integrity.

Types of LUWs:

Database transaction or LUW.

Update transaction or SAPLUW.

ABAP/4 Transaction.

database transaction

Database transaction or LUW is defined as a period in which operation requested must be performed as one unit.

At the end of LUW, either the database changes are committed or rolled back.

SAP LUW

One SAP LUW can have several databases LUW. So a set of database transactions either committed or rolled back.

The special ABAP/4 command ‘Commit work’ marks the end of SAP LUW.

ABAP/4 Transaction

It is made up of a set of related task combined under one transaction code.

ABAP/4 transaction functions like one complete object containing screens, menus and transaction code.

Regards

Sandeep reddy

Read only

Former Member
0 Likes
1,061

hi,

A u201CLUWu201D(logical unit of work) is the span of time during which any database updates must be performed in an u201Call or nothingu201D manner .Either they are all performed (committed),or they are all thrown away (rolled back).In the ABAP/4 world , LUWs and

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).

Update transaction (or u201CSAP LUWu201D)

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.

pls reward if helpful.

Read only

Former Member
0 Likes
1,061

Hi,

Please go through this link....

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

If its useful reward points