Start of Content Area

Background documentation WAIT UNTIL  Locate the document in its SAP Library structure

Syntax

WAIT UNTIL log_exp [UP TO sec SECONDS].

Addition:

... UP TO sec SECONDS

Effect

This variant of the statement WAIT is only intended to be used after an asynchronous RFC with callback routines. It interrupts the program execution for as long as the result of the logical expression log_exp is false. Any logical expression can be specified for log_exp.

If the result of log_exp is false, the program waits until a callback routine of a function that was previously called asynchronously has been executed, and then checks the logical expression again. If the result of the logical expression is true, or if the callback routines of all functions that were previously called asynchronously have been executed, then the program execution continues with the statement following WAIT.

Addition

... UP TO sec SECONDS

Effect

Specifying UP TO restricts the program interruption to a maximum number of seconds, specified in sec. A data object of type f is expected for sec, which must contain a positive integer. After the specified time period has passed at the very latest, the program execution continues with the statement following WAIT.

System Fields

sy-subrc

Meaning

0

The logical condition log_exp was fulfilled.

4

No asynchronous function calls exist.

8

Maximum time exceeded while specifying the addition UP TO.

 

This graphic is explained in the accompanying text 

        The statement WAIT causes a switch in the work process, which is linked to the rollout and rollin of all loaded programs. For this reason, the time given in sec must not be less than one second, to avoid burdening the system with too many work process switches.

        Each time the statement WAIT is used, a database commit is performed. For this reason, WAIT must not be used between Open SQL statements that open or close a database cursor.

        There is also one variant of the statement WAIT that can be used independently of the asynchronous RFC.

Exceptions

Exceptions that cannot be processed


RFC Example


 

End of Content Area