Database commits are triggered either implicitly or explicitly in an ABAP system.
Implicit Database Commits
The implicit database commits in an ABAP system are caused by the fact that the SAP system is logged on to the database system via its
work processes. 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 each
time an action takes place that leads to a change of work process. As a result, a database commit is performed implicitly in the following situation:
- Completion of a dialog step
The program waits for a user action and does not occupy a work process during this time. The next free work process is assigned to the program in the next dialog step.
- Completion of a function module accessed with a synchronous Remote Function Call in a separate work process
The calling program is assigned a new work process.
- Execution of a RECEIVE statement in a callback routine specified in an asynchronous RFC
The current work process is interrupted so that the data can be received from the other application server.
- Interruption of the current work process with a WAIT statement.
After interruption, the program is assigned the next free work process.
Explicit Database Commits
Database commits can be triggered explicitly in ABAP programs in the following ways:
- Use of the corresponding database-specific native sql statement.
- Calling the function module DB_COMMIT.
This function module, which has no parameters, encapsulates the corresponding native sql statement.