Skip to content

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 update function module triggered using COMMIT WORK is being processed), the following applies:

  • 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
produce a database commit or database rollback explicitly and hence produce the runtime errors COMMIT_IN_POSTING or ROLLBACK_IN_POSTING directly during the update.
  • The statements
produce either an implicit database commit or disrupt the update controller and hence produce the runtime error POSTING_ILLEGAL_STATEMENT directly during the update.
  • 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_message in function module calls execute the statement ROLLBACK WORK implicitly and produce the runtime message MESSAGE_ROLLBACK_IN_POSTING in updates.

Other versions: 7.31 | 7.40 | 7.54


Notes

  • 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 MESSAGE to 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.