Vous êtes sur la page 1sur 2

6/22/2014 ABAP Keyword Documentation

http://help.sap.com/abapdocu_702/en/abaprollback.htm 1/2
SAP NetWeaver AS ABAP Rel ease 702, Copyri ght 2010 SAP AG. Al l ri ghts reserved.
ABAP Keyword Documentation ABAP - Ref erence Processing External Data Data Consistency SAP LUW
ROLLBACK WORK
Short Reference
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:
1. Executes all subroutines registered using PERFORM ON ROLLBACK.
2. Deletes all subroutines registered using PERFORM ON COMMIT.
3. Triggers an internal event in the Object Services that makes sure that the attributes of persistent objects are
initialized.
4. Deletes all update function modules registered using CALL FUNCTION ... IN UPDATE TASK from the
VB... database tables and deletes all transactional remote function calls registered using CALL FUNCTION
... IN BACKGROUND TASK|UNIT from the database tables ARFCSSTATE and ARFCSDATA.
5. Removes all SAP locks set in the current program for which the formal parameter _SCOPE of the lock function
module was set to the value 2.
6. Triggers a database rollback that also ends the current database LUW.
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 ROLLBACKs, which
means that a runtime error occurs when the system attempts to continue a SELECT loop after a ROLLBACK.
For the same reason, a FETCH after a ROLLBACK 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 the ROLLBACK.
After a ROLLBACK statement, sy-subrc is always zero. You do not need to query whether sy-subrc is not
equal to zero after ROLLBACK.
ROLLBACK must not be used during the update (CALL FUNCTION ... IN UPDATE TASK) or when
executing subroutines registered using PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK.
The statement ROLLBACK WORK must not be executed in units or LUWs that are managed by transactional
6/22/2014 ABAP Keyword Documentation
http://help.sap.com/abapdocu_702/en/abaprollback.htm 2/2
RFC calls (bgRFC, tRFC, or qRFC).
The ROLLBACK WORK statement is executed implicitly if a message of type A is handled by the addition
error_message when calling a function module with CALL FUNCTION.
Exceptions
Non-Catchable Exceptions
Cause: ROLLBACK WORK is not allowed within a FORM called using PERFORM ... ON COMMIT or PERFORM
... ON ROLLBACK.
Runtime Error: ROLLBACK_IN_PERFORM_ON_COMMIT
Cause: ROLLBACK WORK is not permitted within an update.
Runtime Error: ROLLBACK_IN_POSTING

Vous aimerez peut-être aussi