ABAP - Keyword Documentation →  ABAP - Programming Language →  Processing External Data →  ABAP Database Access →  Data Consistency →  Database LUW → 
Mail Feedback

Database Commit

In AS ABAP, database commits are triggered either implicitly or explicitly.

Hint

A database commit closes all opened database cursors. In particular, in SELECT loops and after the statement OPEN CURSOR, database commits should not be triggered by mistake in one of the ways listed here.

Implicit Database Commits  

The implicit database commits in an AS ABAP are caused by the fact that an AS ABAP uses its own work processes to log on to the database system. A work process can only ever execute a single database LUW but cannot interfere with the database LUWs belonging to other work processes. Since an ABAP program can be executed by different work processes during its runtime, the database LUW for the current work process must be completed for every action that can lead to a change of work process. As a result, a database commit is performed implicitly in the following situation:

The implicit database commit takes place on all currently open database connections of the current work process. The situations above cause a work process to be switched while a program is running, but it is also possible for entire programs to be executed in a different work process, such as when a program is called in a background work process in background processing. Here, a database commit is also made when the work process is switched.

Hints

Explicit Database Commits  

Database commits can be triggered explicitly in ABAP programs in the following ways:

COMMIT statements are not allowed in AMDP methods.

Hints

Database Commit on Secondary Connections  

Implicit deactivations of a secondary connection or a service connection at the end of an internal session trigger a database commit in the transaction context of this database connection. For more information, see Database Connections.

If the internal session is switched on the standard connection, there is no database commit and no database rollback.