WAIT FOR ASYNCHRONOUS TASKS
WAIT FOR ASYNCHRONOUS TASKS
[MESSAGING CHANNELS] UNTIL log_exp [UP TO sec SECONDS].
This variant of the statement
WAIT is designed only for use after an
asynchronous RFC with callback routines. In
the event of an asynchronous function call, the statement interrupts program execution for as long as the result of the logical expression
log_exp remains false. Any
logical expression can be specified for
If the result of
log_exp is false and there is an asynchronous function call,
the program waits until a callback routine of a previous function (called asynchronously) has been executed
and then checks the logical expression again. If the result of the logical expression is true or the
callback routines of all functions called asynchronously beforehand have been executed, program execution
is continued with the following statement in
WAIT: If there is no asynchronous
function call, program execution is not interrupted and
sy-subrc is immediately set to 4.
|0||The logical expression
|4||The logical expression
|8||The logical expression
- If the logical expression is incorrect, the running program is stopped in its current state. After a callback routine, all data objects that were not changed in the callback routine have the same value as when the logical expression was last evaluated. Any methods called by functions within the logical expression are executed again during the next check.
WAITcauses a switch in the work process, which is linked to the rollout and roll-in of all loaded programs. For this reason, the time in
secshould not be set less than a second in order not to overload the system with too frequent changing of work processes.
We recommend that you always program the time for executing the callback routine of an
asynchronous RFC using
WAIT FOR ASYNCHRONOUS TASKSto avoid relying on the next implicit change in the work process.
Each time the statement
WAITis used, a database commit is triggered (except in updates). For this reason,
WAITmust not be used between Open SQL statements that open or close a database cursor.
This statement has an obsolete short form, in which
FOR ASYNCHRONOUS TASKSis not specified.
... MESSAGING CHANNELS
If this addition is specified, this variant of the statement
WAIT is combined
with the variant
WAIT FOR MESSAGING CHANNELS.
Program execution is continued if the logical expression is set to "true" by a callback routine for
an AMC message or by an asynchronously called function. If there is no asynchronous call or no receiver
is registered for AMC messages, the program is not interrupted and
sy-subrc is set to 4.
... UP TO sec SECONDS
UP TO restricts the program interruption to a maximum number of
seconds, specified in
sec, a data object
f is expected that must contain a positive number. The unit of the
sec is seconds and the time resolution is one millisecond. After
the specified time period has passed at the very latest, the program execution continues with the statement following
Cause: Negative time specified for