Previous Topic: Add WHILE ConditionNext Topic: Add FOR Condition


Add REPEAT UNTIL Condition

The combination of the REPEAT and UNTIL statements repeats an action or group of actions until a specific condition is satisfied. The test for the condition takes place after the iteration. Therefore, REPEAT–UNTIL always has at least one iteration.

The REPEAT–UNTIL statements can contain multiple TARGETING statements that target repeating group views.

The REPEAT–UNTIL statement uses the following format:

REPEAT
[TARGETING repeating-group-view-1 [FROM THE BEGINNING]
[UNTIL FULL]]
[AND TARGETING repeating-group-view-1 [FROM THE BEGINNING]
[UNTIL FULL]] . . .
action-statement-list
UNTIL condition-1

The following example of REPEAT–UNTIL statements repeats the referenced business algorithm find space until a value is met.

REPEAT
USE find space
WHICH IMPORTS: Entity View processing warehouse
WHICH EXPORTS: Entity View processing warehouse
UNTIL processing warehouse number_of_available_bins IS EQUAL TO 0

The following REPEAT–UNTIL statements use a FOR EACH action:

REPEAT
FOR EACH product details
ASSOCIATE processing . . .
WITH received . . .
UNTIL. . .

Finally, the following example targets the group view order_line_export:

REPEAT
TARGETING order_line_export FROM THE BEGINNING UNTIL FULL.
UNTIL . . .