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: 

WAIT statement

TMNielsen
Contributor
0 Kudos
1,170

Hello all

<b>Thomas Jung</b> wrote in an earlier posting about WAIT:

The big advantage it has is that it release the dialog work process while the program is waiting.

Are there any disadvantages ?

Best regards

Thomas Madsen Nielsen

1 ACCEPTED SOLUTION

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
226

The only disadvantage I can think of is that it was really designed to be used with Asynchronous RFC calls. I guess if you use it outside of this context and you have problems, you might not be able to get help from SAP. However I have never had any problems with it.

5 REPLIES 5

Former Member
0 Kudos
226

Yes, it makes the program run longer!

Seriously, none to my knowledge. We use it to allow an external job monitor to monitor the progress of an ABAP that schedules other jobs dynamically.

The external monitor knows about job A, but not jobs B and C that A spawns. So instead, job A uses the WAIT statement to periodically wait for the completion of jobs B and C. Seems to work very well.

Scott

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos
227

The only disadvantage I can think of is that it was really designed to be used with Asynchronous RFC calls. I guess if you use it outside of this context and you have problems, you might not be able to get help from SAP. However I have never had any problems with it.

0 Kudos
226

I believe that only the WAIT UNTIL variant of the WAIT statement was designed for asynchronous RFC. There are no documented restricted uses of WAIT UP TO n SECONDS that I can see.

Scott

0 Kudos
226

The following is from the on-line help in our 46C system:

Notes

WAIT should only be used with asynchronous Remote Function Calls (CALL FUNCTION func ...STARTING NEW TASK task name) and the addition PERFORMING form ON END OF TASK. It has no effect in other environments.

Since the ABAP debugger has its own internal flow logic (just like related roll area changes), this can have a considerable effect on the execution of the WAIT statement in debugging mode.

0 Kudos
226

Yes, I saw that documentation too, however it is a note for the variant WAIT UNTIL <logical expression> only.

It makes perfect sense there, because only a parallel thread invoked by asynchronous remote function call could update the flag typically used in such a logical expression.

There are no such restrictions regarding WAIT UP TO n SECONDS.

Scott