Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPWAIT_ARFC - WAIT ARFC

ABAPWAIT_ARFC - WAIT ARFC

ABAP Short Reference   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

WAIT FOR ASYNCHRONOUS TASKS

Short Reference



WAIT FOR ASYNCHRONOUS TASKS
         $[MESSAGING CHANNELS$]
         $[PUSH CHANNELS$]
         UNTIL log_exp $[UP TO sec SECONDS$].


Additions

1. ... MESSAGING CHANNELS

2. ... PUSH CHANNELS

3. ... UP TO sec SECONDS

Effect

This variant of the statement WAIT is intended only for use after an asynchronous RFC with callback routines. Any logical expression can be specified for log_exp after UNTIL.

  • If the result of log_exp is false and there is an asynchronous function call with a callback routine, the program waits until a callback routine of a function previously called asynchronously has been executed and then checks the logical expression again:
  • If the new check on the result of the logical expression is true, sy-subrc is set to 0 and the execution of the program is continued with the statement that follows WAIT.

  • If the new check on the result of the logical expression is false and the callback routines of all functions previously called asynchronously have not yet been executed, one of the remaining callback routines must be executed before the program continues.

  • If the new check on the result of the logical expression is false and the callback routines of all functions previously called asynchronously were executed, sy-subrc is set to 4 and the execution of the program continues with the statement that follows WAIT.

  • If the result of log_exp is false and there is no asynchronous function call with a callback routine, the execution of the program is not interrupted, regardless of the result of log_exp, and sy-subrc is set to the value 4.
  • If the logical expression is true, the execution of the program is not interrupted, regardless of whether there is a function call with a callback routine, and sy-subrc is set to the value 0.

If the statement WAIT interrupts the program, the work process is changed, and a database commit is executed, except in updates. For this reason, WAIT must not be used between statements that open or close a database cursor.

System Fields

sy-subrc Meaning
0 The logical expression log_exp is true.
4 The logical expression log_exp is false. The current internal session also does not contain any asynchronous function calls with callback routines, and no receiver is registered for AMC messages or APC messages for the use of the additions MESSAGING CHANNELS or PUSH CHANNELS.
8 The logical expression log_exp is false and when the addition UP TO was specified, the maximum time was exceeded.

Notes

  • If the logical expression is false and there is an asynchronous function call with a callback routine, the statement WAIT FOR changes the work process and hence executes all callback routines registered up until now.
  • When a program is interrupted, the running program is paused 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 functional method calls within the logical expression are executed again during the next check.

Addition 1

... MESSAGING CHANNELS

Addition 2

... PUSH CHANNELS

Effect

If these additions are specified, this variant of the statement WAIT is combined with the variants WAIT FOR MESSAGING CHANNELS or WAIT FOR PUSH CHANNELS. The program flow described for the variants is added to the program flow described above. The WAIT statement then also waits for AMC messages or APC messages to be executed and does not just wait for asynchronously called functions to be executed.

Addition 3

... UP TO sec SECONDS

Effect

If UP TO is specified, a maximum time sec can be specified in seconds while the statement waits for asynchronously called functions to be ended. sec expects a data object of the type f that must contain a positive number. The unit of the number specified in sec is seconds and the time resolution is one millisecond.

If none of the asynchronously called functions are ended within the specified time, their callback routine specifies that the result of the logical expression log_exp is true, sy-subrc is set to 8, and the execution of the program is continued with the statement that follows WAIT.

Notes

  • If there are no asynchronous function calls with a callback routine, the addition UP TO sec SECONDS is ignored.
  • The addition UP TO sec SECONDS is ignored with respect to the execution of the callback routines. The time needed for these routines to execute can be longer than the time specified.
  • If the addition UP TO sec SECONDS is used to cancel the wait time, it does not mean that any outstanding callback routines are no longer executed at all. A later change of the work process in the same program can result in the callback routines of the asynchronous functions executed until now being executed. Only the callback routines of those asynchronous functions not ended at the end of the program are not executed.

Exceptions

Non-Catchable Exceptions

  • Cause: Negative time specified for sec.
    Runtime Error: WAIT_ILLEGAL_TIME_LIMIT






Addresses (Business Address Services)   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 9001 Date: 20230207 Time: 224512     sap01-206 ( 138 ms )