SAP SAP LUW



Get Example source ABAP code based on a different SAP table
  


• CL_SYSTEM_TRANSACTION_STATE ABAP_CLASS

SAP LUW
An application program can be split into multiple program sections, which are processed in sequence using different work processes. Each switch of a work process is linked with an implicit database commit, which means that an application program is not linked with a single database LUW automatically.
BEGIN_SECTION VERSION 5 OUT More specifically, this applies to dialog-oriented applications with classic dynpros in SAP GUI in which each dialog step is assigned a database LUW.
END_SECTION VERSION 5 OUT
IMAGE ABDOC_SAP_LUW.gif 625 380
To ensure the data consistency of application programs that are executed across multiple work processes, the change statements are not executed directly in an SAP LUW. Instead, they are first registered and then executed by a single work process, that is, in a single database LUW.
BEGIN_SECTION VERSION 5 OUT
ITOC

Bundling Techniques
The following techniques are available for bundling the change statements in a database LUW:
Update (bundling using function modules) The statement CALL FUNCTION ... IN UPDATE TASK is used to register an update function module for later execution in an update work process ( synchronous and asynchronous update) or in the current work process (local update ). In updates, no forbidden statements can be executed and no authorization checks are performed. Synchronous and asynchronous updates are executed in their own update sessions. Local updates, on the other hand, only open a new ABAP_ISESS .
Transactional RFC (bundling using function modules) The statement CALL FUNCTION ... IN BACKGROUND UNIT is used to register a remote-enabled function module for later asynchronous execution in the background and through the RFC interface (background RFC).
Bundling using subroutines The statement PERFORM ... ON COMMIT is used to register a subroutine for later execution in a different work process.



Latest notes:

A function module can be specified as either an update function module or as remote-enabled, but not both at the same time. The update is used to realize SAP LUWs within AS ABAP, while the transactional RFC creates LUWs in distributed systems.
ABAP_HINT_END

Statements for SAP LUWs
Each opening of a new ABAP_ISESS , except for the statement CALL DIALOG , starts a new SAP LUW which can be controlled by the AB-SQL statements
COMMIT WORK
ROLLBACK WORK
SET UPDATE TASK LOCAL



Latest notes:

The statements COMMIT WORK and ROLLBACK WORK determine the limits of an SAP LUW. An ABAP program can be divided into any number of SAP LUWs, whereby the end of an ABAP program always ends the last SAP LUW as well. Calling ABAP programs with CALL TRANSACTION or SUBMIT ... AND RETURN provides the option of nesting SAP LUWs.
NON_V5_HINTS
The system class CL_SYSTEM_TRANSACTION_STATE contains methods that return the status of the current SAP LUW.
ABAP_HINT_END
END_SECTION VERSION 5 OUT

SAP LUWs and ABAP_ISESSNS_L
Each closing of an ABAP_ISESS ends the current SAP LUW.
BEGIN_SECTION VERSION 5 OUT If a program is ended or an ABAP_ISESS closed using
SUBMIT without AND RETURN or
LEAVE TO TRANSACTION
and procedures are still registered in the current SAP LUW, the SAP LUW is ended, and the procedures are not called or rolled back. Registered update function modules remain on the database but can no longer be executed.



Latest notes:

If a program is called using
SUBMIT with AND RETURN or
CALL TRANSACTION
a new SAP LUW opens, but not a new database LUW. This means that a database rollback in this SAP LUW can roll back all registration entries made by the statements CALL FUNCTION IN UPDATE TASK or CALL FUNCTION IN BACKGROUND TASK in the tables VB... or ARFCSSTATE and ARFCSDATA. Under certain circumstances, the statement ROLLBACK WORK in the called program can also affect the interrupted SAP LUW. To prevent this, an explicit database commit must be executed before the program is called. This problem does not occur in local updates.
ABAP_HINT_END
END_SECTION VERSION 5 OUT