โ2007 Jul 25 4:12 PM
hi sap experts tell me
what is the functionality of explicit commit and implicit commit
what is the syntax for them
when we use them
thanks in advance
prakash
โ2007 Jul 25 4:17 PM
Implicit Database Commits
A work process can only execute a single database LUW. The consequence of this is that a work process must always end a database LUW when it finishes its work for a user or an external call. Work processes trigger an implicit database commit in the following situations:
ยท When a dialog step is completed
Control changes from the work process back to the SAP GUI.
ยท When a function module is called in another work process (RFC).
Control passes to the other work process.
ยท When the called function module (RFC) in the other work process ends.
Control returns to the calling work process.
ยท When a WAIT statement interrupts the work process.
Control passes to another work process.
ยท Error dialogs (information, warning, or error messages) in dialog steps.
Control passes from the work process to the SAP GUI.
Explicit Database Commits
There are two ways to trigger an explicit database commit in your application programs:
ยท Call the function module DB_COMMIT
The sole task of this function module is to start a database commit.
ยท Use the ABAP statement COMMIT WORK
This statement starts a database commit, but also performs other tasks (refer to the keyword documentation for COMMIT WORK).
Implicit Database Rollbacks
The following cases lead to an implicit database rollback:
ยท Runtime error in an application program
This occurs whenever an application program has to terminate because of an unforeseen situation (for example, trying to divide by zero).
ยท Termination message
Termination messages are generated using the ABAP statement MESSAGE with the message type A or X. In certain cases (updates), they are also generated with message types I, W, and E. These messages end the current application program.
Explicit Database Rollbacks
You can trigger a database rollback explicitly using the ABAP statement ROLLBACK WORK. This statement starts a database rollback, but also performs other tasks (refer to the keyword documentation for ROLLBACK WORK).
From the above, we can draw up the following list of points at which database LUWs begin and end.
A Database LUW Begins
ยท Each time a dialog step starts (when the dialog step is sent to the work process).
ยท Whenever the previous database LUW ends in a database commit.
ยท Whenever the previous database LUW ends in a database rollback.
A Database LUW Ends
ยท Each time a database commit occurs. This writes all of the changes to the database.
ยท Each time a database rollback occurs. This reverses all of the changes made during the LUW.
Database LUWs and Database Locks
As well as the database changes made within it, a database LUW also consists of database locks. The database system uses locks to ensure that two or more users cannot change the same data simultaneously, since this could lead to inconsistent data being written to the database. A database lock can only be active for the duration of a database LUW. They are automatically released when the database LUW ends. In order to program SAP LUWs, we need a lock mechanism within the R/3 System that allows us to create locks with a longer lifetime (refer to The SAP Locking Concept).
regards,
srinivas
*reward for useful answers*</b>
โ2007 Jul 25 4:17 PM
Implicit Database Commits
A work process can only execute a single database LUW. The consequence of this is that a work process must always end a database LUW when it finishes its work for a user or an external call. Work processes trigger an implicit database commit in the following situations:
ยท When a dialog step is completed
Control changes from the work process back to the SAP GUI.
ยท When a function module is called in another work process (RFC).
Control passes to the other work process.
ยท When the called function module (RFC) in the other work process ends.
Control returns to the calling work process.
ยท When a WAIT statement interrupts the work process.
Control passes to another work process.
ยท Error dialogs (information, warning, or error messages) in dialog steps.
Control passes from the work process to the SAP GUI.
Explicit Database Commits
There are two ways to trigger an explicit database commit in your application programs:
ยท Call the function module DB_COMMIT
The sole task of this function module is to start a database commit.
ยท Use the ABAP statement COMMIT WORK
This statement starts a database commit, but also performs other tasks (refer to the keyword documentation for COMMIT WORK).
Implicit Database Rollbacks
The following cases lead to an implicit database rollback:
ยท Runtime error in an application program
This occurs whenever an application program has to terminate because of an unforeseen situation (for example, trying to divide by zero).
ยท Termination message
Termination messages are generated using the ABAP statement MESSAGE with the message type A or X. In certain cases (updates), they are also generated with message types I, W, and E. These messages end the current application program.
Explicit Database Rollbacks
You can trigger a database rollback explicitly using the ABAP statement ROLLBACK WORK. This statement starts a database rollback, but also performs other tasks (refer to the keyword documentation for ROLLBACK WORK).
From the above, we can draw up the following list of points at which database LUWs begin and end.
A Database LUW Begins
ยท Each time a dialog step starts (when the dialog step is sent to the work process).
ยท Whenever the previous database LUW ends in a database commit.
ยท Whenever the previous database LUW ends in a database rollback.
A Database LUW Ends
ยท Each time a database commit occurs. This writes all of the changes to the database.
ยท Each time a database rollback occurs. This reverses all of the changes made during the LUW.
Database LUWs and Database Locks
As well as the database changes made within it, a database LUW also consists of database locks. The database system uses locks to ensure that two or more users cannot change the same data simultaneously, since this could lead to inconsistent data being written to the database. A database lock can only be active for the duration of a database LUW. They are automatically released when the database LUW ends. In order to program SAP LUWs, we need a lock mechanism within the R/3 System that allows us to create locks with a longer lifetime (refer to The SAP Locking Concept).
regards,
srinivas
*reward for useful answers*</b>
โ2007 Jul 25 4:22 PM
Functionality or the purpose of explicit and implicit commit are same.. i.e. to make database change permanent...
Explicit commit executed with statement COMMIT WORK.
Implicity commit are triggered automatically when
1. each screen change, and especially after the ABAP/4 commands CALL SCREEN, CALL DIALOG, CALL TRANSACTION, MESSAGE or
a Remote Function Call