ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Access → Data Consistency → SAP LUW
Forbidden Statements in Updates
In updates (that is, when an
module triggered using
COMMIT WORK is being processed), the following applies:
- There can be no database commits or database rollbacks.
- The update controller cannot be modified.
If a database commit or database rollback occurs during an update, it terminates with a runtime error. Any statements that disrupt the update controller can produce undefined behavior.
Any statements that would produce a database commit or database rollback or would disrupt the update controller are, therefore, forbidden and produce a runtime error as soon as they are called and before the runtime error can occur in another place. The following statements are relevant here:
- The statements
- The statements
- Executing the Native SQL statements COMMIT WORK and ROLLBACK WORK produces the runtime error POSTING_ILLEGAL_STATEMENT during the update.
- Type "A" messages caught using the predefined exception
error_messagein function module calls execute the statement ROLLBACK WORK implicitly and produce the runtime message
7.31 | 7.40 | 7.54
- The runtime errors occur directly in those statements that would produce incorrect behavior during the update, which makes any errors easier to find than if the exception waited until, for example, an implicit database commit to occur.
- Using the statement
MESSAGEto send messages for the message types "I", "W", "E", and "A" produces an implicit database rollback, but no direct runtime error can be triggered here for reasons of downward compatibility. The behavior of messages in updates applies instead.
- See also Authorization Checks in Updates.