‎2008 Aug 28 8:05 AM
hi all,
There is an insert statement which was working fine 2 days back. But yesterday onwards it is not submitting the new record in the Z table. I have checked the sy-subrc which was 0, but if i add ( wait or commit ) statement under insert statement then it works fine.
can anyone plz suggest the possible reason of this unusual behaviour of system
thanks in advance,
Aditya Goel
‎2008 Aug 28 8:13 AM
‎2008 Aug 28 8:16 AM
Better to use commit work
If the program terminate after execution of insert statement the record doesn't commit to data base. that is the reason better to use commit work after insert statement.
‎2008 Aug 28 8:22 AM
yes u r absolutely right, one must use commit statement after insert. But i just want to know what could be the reason for not submitting the data in z table
‎2008 Aug 28 8:27 AM
I already told you, until unless program successfully execute then only the data will be summited to your ztable(if no commit work statement)
if you write commit work statement after insert statement, if your program anything goes wrong in middle at that point of time how many records are processed those records will be saved in your ztable.
‎2008 Aug 28 6:53 PM
Its better to use COMMIT after DML (Update, Insert, Delete) statements.
For DDL statements, you don't need a COMMIT. They are auto commit.
Thanks,
Kartavya
‎2008 Aug 29 7:32 AM
Hi ...
With out using COMMIT WORK insert will work properly. After the execution of the program IMPLICIT commit occurred.
Please check the table ofter execution of the program.
If it not work then please check the data you want to insert. If you use ACCEPTING DUPLICATE KEYS and data are same then sy-subrc will be 0 but no record will be inserted again... Please check the key fields.
Edited by: Subhankar Garani on Aug 29, 2008 8:34 AM