Unit 12: Integrating the UNTIL Loop for Reapproval 

Use

If the requester decides to revise and resubmit the notification of absence to their superior, the step Check notification of absence must be executed again.

There are different ways of solving this problem. The solution outlined here is only one example.

To assign values to the container element, container operations must be executed on the workflow container.

For information on the workflow log, see Definition of the Workflow Container in the SAP Business Workflow documentation.

For further information, refer to Maintaining an UNTIL loop in the SAP Business Workflow documentation.

Procedure

You start the Workflow Builder and open your workflow definition in Change mode. Proceed as described in Unit 7: Including "Check Notification of Absence" in the Workflow Definition.

Create container element in the workflow container

  1. Choose the entry Double-click to create by double-clicking in the Workflow Container.
  2. The dialog box for entering a container element is displayed.

  3. Make the following entries:
  4. Element: Flag

    Name: Flag

    Description: Flag for approval status

    Reference table: SYST

    Reference field: INPUT

  5. Choose .

You have now added a local container element to the workflow container, which is ready to store a flag, based on its data type reference. However, you have not yet determined a value for this container element.

Integrating the UNTIL loop as a step

  1. Choose under step type. The cursor changes shape.
  2. Move the cursor to the Undefined step before the event workflow end and click.
  3. By doing so, you add an UNTIL loop to your workflow definition. The step definition is shown in the right-hand part of the screen.

    Entering the basic data

  4. Enter Resubmission required? in the Step description field.
  5. Click on the condition area to open the condition editor.
  6. The bottom half of the screen contains the empty condition, whereas the top half shows the system fields as well as the content of the workflow container. The field in the Expression 1 column is ready for input and marked .

  7. Choose the Flag container element as the first expression by double-clicking it.
  8. The first expression is now entered in the condition in the lower part of the screen. The Expression 2 field is now ready for input and marked .

  9. Choose as the operator.
  10. Enter the constant X in the field for Expression 2 and confirm by pressing Enter .
  11. Choose .
  12. You have now defined the condition Flag = X .

    For further information, see Condition Editor.

    The comparison between the container element Flag and the constant X returns either the result true or the result false. Two outcomes are therefore possible.

  13. Enter the following texts for the outcomes:
  14. True: Flag equal to X - no resubmission

    False: Flag not equal to X - resubmission

    If the result of the evaluated condition is false, the loop is processed again. If the notification of absence is to be resubmitted to the superior, the container element flag must not have the value X . For this purpose, you will insert container operations in the workflow definition in the next unit.

  15. Choose .

You have now inserted an isolated UNTIL loop into the workflow definition, which does not yet contain any steps. You must change the workflow definition so that all of the steps that are required to check and resubmit the notification of absence are within the UNTIL loop.

In order to understand the steps required, you must familiarize yourself with block operations.

Block operations

  1. Choose to display the entire workflow definition in the workflow area on the screen.
  2. Display the block structure of your workflow definition. Choose Graphic ® Blocks ® Show.

The workflow definition is block-oriented. Every block represents a basic structural element that is a self-contained and consistent arrangement of steps and outcomes.

If you, for example, create a new step that has one outcome, this pair (step, outcome) represents a block. Operations that are performed on one step (delete, cut,..) always affect the entire block associated with that step.

In the above example, in which the block consists of the pair (step, outcome), using the delete function will also delete the corresponding outcome as well.

You should test the operations listed under Edit ® Block on blocks:

You can undo changes at any time by choosing . Another possibility is to exit the Workflow Builder without saving your work and to call it again.

For further information, refer to Block Orientation in the Workflow Definition.

Copying steps to the UNTIL loop

The step Check notification of absence, which follows the outcome Request completed, is the first step in a new block. To implement the resubmission, the workflow must send the notification of absence to this step after it has been revised by the requester. You have used an UNTIL loop for this purpose. The step Check notification of absence must be located within this loop. In order to do so, first cut the block that begins with this step. Then paste the cut block in the UNTIL loop.

  1. Select the step Check notification of absence.
  2. Choose to cut the block.
  3. Select the Undefined outcome in the UNTIL loop and choose .
  4. Choose to align the graphic.
  5. Choose to view the entire workflow definition in the workflow area on the screen.
  6. You will notice that your workflow definition now contains steps within the UNTIL loop.

  7. Choose .

The workflow definition is checked, saved, and, provided it does not contain any errors, activated. The system displays a message if problems are encountered during the test.

Result

The integration of the UNTIL loop is now complete. The workflow up to this point, however, delivers an incorrect result, since the Flag container element is not assigned a value during execution. The result of the evaluated condition in the UNTIL loop is always false and the workflow can never be completed. To ensure that the workflow is executed correctly, you will add further container operations to the workflow definition in the next unit.