Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Insert statement not working without using ( wait or commit ) statements

Former Member
0 Likes
928

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

6 REPLIES 6
Read only

Former Member
0 Likes
753

But always good programming prectice to use Commit.

Read only

Former Member
0 Likes
753

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.

Read only

0 Likes
753

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

Read only

0 Likes
753

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.

Read only

Former Member
0 Likes
753

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

Read only

Subhankar
Active Contributor
0 Likes
753

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