‎2009 Jun 15 8:52 AM
Hi,
Is it mandatory to write Commit Work after Insert or Update into DataBase Table.?
Without writing also it is working fine.
Can you please let me know..what is the exact significance of this.....
Please explain in Brief...
I have seen so many links...But dint get exactly ....what the significance is...
Thanks,
Sandip
‎2009 Jun 15 8:59 AM
Commit work.
Will do an explicit db commit.
Both insert and update also perfom an implicit db commit.
The significance of explicit commitw ork comes in to picture when your DB updates faila nd you want to rollback .
So best way is to check sy-subrc after insert/update and if it fails then rollback work else do a commit.
‎2009 Jun 15 8:59 AM
Commit work.
Will do an explicit db commit.
Both insert and update also perfom an implicit db commit.
The significance of explicit commitw ork comes in to picture when your DB updates faila nd you want to rollback .
So best way is to check sy-subrc after insert/update and if it fails then rollback work else do a commit.
‎2009 Jun 15 9:11 AM
Hi Sandeep,
The COMMIT WORK statement always sets sy-subrc to 0 if the AND WAIT addition is not specified. It triggers a database exception in programs that are called using CALL DIALOG. This executes all high-priority (VB1) update function modules in the order of their registration and in a common database LUW.It triggers a database commit that also terminates the current database LUW and closes all database cursors.
If u r doing any operation in DB, to save that COMMIT used.
Thanks,
Sneha.
‎2009 Jun 15 9:22 AM
Hi
U should read the information (or SAP Help) about LUW (Logical Unit of Work).
Here u can find out all answeres you need.
Max
‎2009 Jun 15 10:00 AM
All the statements will be added to logical unit of work and this logical unit of work is submitted to database after periodic interval, if you want you can write COMMIT to have it done explicitly.
This is done when you want database to reflect new values instantonously.