Application Development 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: 

* Commit work on table using UPDATE statement.*

Former Member
0 Kudos

HI,

This is Anil . I have problem regarding Commit work and Wait up to 2 seconds.

I am using Commit work on one Update table statement but it is not working . While doing debugging it is working

(means it is updating Table.) but while running the transaction directly it is not updating the table.

Check the statements :

Commit work.

Some Select stmt on <table>.

IF <condition.>

Update <table > statement.

if sy-subrc EQ 0.

Commit work . ( This is not working while running transaction mean it is not updating table. While debuggint it it updating table.)

wait up to 2 seconds.

endif.

endif.

Will that above Commit work causing any problem or what is the reason it is not updating table.

Please give some suggestion in this case.

Regards,

Anilreddy.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

the below code with commit work is working finr for me.

only thing i suggest is to check sy-subrc value.

commit work.

update spfli set test = '1234' where carrid = 'AA'.

if sy-subrc eq 0.

commit work.

wait up to 2 seconds.

endif.

write: / sy-subrc.

5 REPLIES 5

Former Member
0 Kudos

Hi

the below code with commit work is working finr for me.

only thing i suggest is to check sy-subrc value.

commit work.

update spfli set test = '1234' where carrid = 'AA'.

if sy-subrc eq 0.

commit work.

wait up to 2 seconds.

endif.

write: / sy-subrc.

0 Kudos

HI Jyothi ,

Thank you for your inputs . But my doubt is why it is not updating the table even if you use commit work, and wait up to 2 seconds.

Anil.

0 Kudos

Anil,

Use the statement commit work and wait. This will solve your issue.

Regards

Farzan

0 Kudos

Hi,

Is this code is any user exit? or any update task, which may be failing?

If this is just an independent program, just use commit work. Should work . . . without wait also.

Best Regards,

Former Member
0 Kudos

Hi Anil,

Why dont you try with one more second?

Wait upto 3 seconds. i have seen two or three programs in my system which waits for 3 seconds.

Might be based on the system's efficiency.