Show TOC

Background documentationWAIT UNTIL Locate this document in the navigation 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 seconds. 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

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 Handled

  • Cause: Undefined status of WAIT statement

    Runtime error: WAIT_ILLEGAL_CONTROL_BLOCK

  • Cause: Negative time entry for sec.

    Runtime error: WAIT_ILLEGAL_TIME_LIMIT