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

WAIT statement

TMNielsen
Contributor
0 Likes
2,488

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
Read only

thomas_jung
Developer Advocate
Developer Advocate
0 Likes
1,544

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
Read only

Former Member
0 Likes
1,544

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

Read only

thomas_jung
Developer Advocate
Developer Advocate
0 Likes
1,545

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.

Read only

0 Likes
1,544

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

Read only

0 Likes
1,544

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.

Read only

0 Likes
1,544

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