ABAP Keyword Documentation → ABAP - Reference → Processing External Data → Data Consistency → SAP LUW
ROLLBACK WORK
Other versions: 7.31 | 7.40 | 7.54
Syntax
ROLLBACK WORK.
Effect
The statement ROLLBACK WORK
closes the current
SAP LUW and opens a new one.
This cancels all changes requests made by the current SAP LUW. To do this, ROLLBACK WORK
carries out the following actions:
PERFORM ON ROLLBACK
. PERFORM ON COMMIT
. After the statement ROLLBACK WORK
is completed, the event TRANSACTION_FINISHED
from the system class CL_SYSTEM_TRANSACTION_STATE is triggered, whereby the parameter KIND has the value of the constant CL_SYSTEM_TRANSACTION_STATE=>ROLLBACK_WORK.
Notes
-
All open database cursors
in the database connections concerned are closed during
ROLLBACK
s, which means that a runtime error occurs when the system attempts to continue aSELECT
loop after aROLLBACK
. For the same reason, a FETCH after aROLLBACK
on the cursor that is now closed also causes a runtime error. Make sure that cursors that are still open are no longer used after theROLLBACK
. -
After a
ROLLBACK
statement,sy-subrc
is always zero. You do not need to query whethersy-subrc
is not equal to zero afterROLLBACK
. -
ROLLBACK
must not be used during the update (CALL FUNCTION ...IN UPDATE TASK
) or during the execution of subroutines that were registered usingPERFORM ... ON COMMIT
orPERFORM ... ON ROLLBACK
. -
The statement
ROLLBACK WORK
must not be executed in units or LUWs that are managed by transactional RFC calls (bgRFC, tRFC, or qRFC). -
The
ROLLBACK WORK
statement is executed implicitly if a message of type A is handled by the additionerror_message
when calling a function module withCALL FUNCTION
.
Exceptions
Non-Catchable Exceptions
-
Cause:
ROLLBACK WORK
is not permitted within aFORM
that is called with PERFORM ... ON COMMIT orPERFORM ... ON ROLLBACK
.
Runtime Error:ROLLBACK_IN_PERFORM_ON_COMMIT
-
Cause:
ROLLBACK WORK
is not permitted within an update.
Runtime Error:ROLLBACK_IN_POSTING