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: 

Do - End Do

Hello All,

I am using DO End Do while i am executing enqueue and dequeue.

Ex:

loop it into wa.

do x times.

enqueue. (table enqueue by write mode)

if- sy-subrc <> 0.

x = x + 1.

exit.

endif.

update table(Customized table)

Dequeue.

end do.

end loop.

If enqueue table fails, it should be executing do statement again and again.

Instead of exit command can i use any other??

i dont want to miss any record in internal table to Customized table.

Thank You.

Sunny.

6 REPLIES 6

Sandra_Rossi
Active Contributor

If there's an issue with enqueue, do you really want to do an endless loop? (for instance table of locks full) You should exit after a certain number of failures to avoid endless loops.

p244500
Active Contributor
0 Kudos

Hi,

You can do this but if its fail it will goes infinitive loop. You have to limit for time same loop and exit it. Further you can read this link. Waiting for lock objects to release – using lock modes U and V

0 Kudos

How these lock modes will help? If the lock fails in test mode, it may fail forever too...

0 Kudos

Have you tried WAIT statement?

0 Kudos

Dear Praneeth,

What happens if you use WAIT statement? You can later try waiting 240, 60, 30 or 15 seconds.

WAIT UP TO 120 SECONDS.

Thanks.

Sincerely,

joanna

0 Kudos

No need to post multiple answers, there's a menu to EDIT your answer.