What does it do? This COMMIT> or ROLLBACK> statement performs a database commit> or database rollback> on the specified database connection>. The database connection can be specified as follows:
con> Specified directly and statically as con>.
(con_syntax)> Specified as the content of a parenthesized data object con_syntax > of type c> or string>. The following can be specified for con> or in con_syntax>, all of which are transformed to uppercase letters internally:
default> specified statically or DEFAULT> specified dynamically for the standard connection> of the current work process. BEGIN_SECTION VERSION 5 OUT
The name of secondary connection > specified statically or dynamically. The name must exist in the column CON_NAME> of the DDIC database table DBCON>>. END_SECTION VERSION 5 OUT BEGIN_SECTION VERSION 5 OUT
The name of a service connection> to the standard database> specified statically or dynamically. The name of the service connection must consist of the prefix R/3*> followed by a maximum of any 26 alphanumeric characters in uppercase letters. END_SECTION VERSION 5 OUT BEGIN_SECTION VERSION 5 OUT
A name (in uppercase letters) assigned for a secondary connection or service connection by the addition AS> of the static Native SQL statement CONNECT TO>>. It should be noted here that a connection with a name of this type is a separate database connection that can exist in parallel with a connection not named using AS>. END_SECTION VERSION 5 OUT
Latest notes:
It is important to note that the statements COMMIT CONNECTION default> and ROLLBACK CONNECTION default> perform a pure database commit or rollback on the standard connection. Unlike COMMIT WORK>> and ROLLBACK WORK>>, they do not close the current SAP LUW>.
The statements COMMIT CONNECTION> and ROLLBACK CONNECTION> are suitable for a simple close of a database LUW. If database LUWs are monitored by the application log>, the function modules DB_COMMIT>> and DB_ROLLBACK>> are better suited because they raise an appropriate event.
With COMMIT CONNECTION> and ROLLBACK CONNECTION>, connections activated in Native SQL or AMDP can only be processed if their names do not contain lowercase letters. This affects service connections> and names defined using the addition AS> of the statement CONNECT TO>>. The names of secondary connections> do not contain any lowercase letters.
The statements COMMIT CONNECTION> and ROLLBACK CONNECTION> empty global temporary tables> on the specified secondary connection and prevent the runtime error COMMIT_GTT_ERROR> in implicit database commits > on this connection.
The statements COMMIT CONNECTION> and ROLLBACK CONNECTION> change the state of an active secondary connection> or service connection> to inactive. The way the following connection is used in the same ABAP_ISESS opens a new database LUW.
For detailed information about database connections, see Database Connections>. ABAP_HINT_END
Example ABAP Coding
Triggering a database commit and releasing the exclusive lock after modifying AB-SQL statements by using COMMIT CONNECTION default> on the standard connection. ABEXA 00116 ABAP_EXAMPLE_END