Logical Unit of Work (LUW)

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

An LUW ends

Database commit and rollback

Within an LUW, database changes are not made until after a database commit. Prior to this, any database change can be canceled by a database rollback.

In the R/3 System, a database commit is triggered either automatically or by the ABAP/4 command COMMIT WORK or the appropriate Native SQL command for the database system.
Similarly, a database rollback is triggered either automatically or by the ABAP/4 command ROLLBACK WORK or the appropriate Native SQL command for the database system.

A database commit is triggered automatically by

A database rollback is triggered automatically by

After each database commit or rollback, the database locks set in the LUW are released (see Database Locking).