‎2007 Oct 17 7:41 AM
hi all,
can u please expalin me wat is commit work and roll back
‎2007 Oct 17 7:44 AM
<b>COMMIT WORK</b>
The statement COMMIT WORK completes the current SAP LUW and opens a new one, storing all change requests for the current SAP LUW in the process.
<b>ROLLBACK</b>
The statement ROLLBACK WORK closes the current SAP-LUW and opens a new one. In doing so, all change requests of the current SAP-LUW are canceled. To do this, ROLLBACK WORK carries out the following actions:
Executes all subprograms registered with PERFORM ON ROLLBACK.
Deletes all subprograms registered with PERFORM ON COMMIT.
Raises an internal exception in the Object Services that makes sure that the attributes of persistent objects are initialised.
Deletes all update function modules registered with CALL FUNCTION ...IN UPDATE TASK from the VBLOG database table and deletes all transactional remote Function Calls registered with CALL FUNCTION ... IN BACKGROUND TASK from database tables ARFCSSTATE and ARFCSDATA.
Removal of all SAP locks set in the current program in which the formal parameter _SCOPE of the lock function module was set to the value 2.
Triggers a database rollback, which also ends the current database-LUW.
‎2007 Oct 17 7:44 AM
<b>COMMIT WORK</b>
The statement COMMIT WORK completes the current SAP LUW and opens a new one, storing all change requests for the current SAP LUW in the process.
<b>ROLLBACK</b>
The statement ROLLBACK WORK closes the current SAP-LUW and opens a new one. In doing so, all change requests of the current SAP-LUW are canceled. To do this, ROLLBACK WORK carries out the following actions:
Executes all subprograms registered with PERFORM ON ROLLBACK.
Deletes all subprograms registered with PERFORM ON COMMIT.
Raises an internal exception in the Object Services that makes sure that the attributes of persistent objects are initialised.
Deletes all update function modules registered with CALL FUNCTION ...IN UPDATE TASK from the VBLOG database table and deletes all transactional remote Function Calls registered with CALL FUNCTION ... IN BACKGROUND TASK from database tables ARFCSSTATE and ARFCSDATA.
Removal of all SAP locks set in the current program in which the formal parameter _SCOPE of the lock function module was set to the value 2.
Triggers a database rollback, which also ends the current database-LUW.
‎2007 Oct 17 7:45 AM
Hi Suprith
During a program execution, when you change the database, that new data is not immediately written to the database..
When we use COMMIT WORK, it updates the database.. if it is successfull the sy-subrc value is 0.. if it fails we use ROLL-BACK.
ROLLBACK reverts back everything.. means all database changes that were tried in the last commit.
Thanks and Best Regards,
Sree