Start of Content Area

Procedure documentation 11: Processing a Condition (Switch)  Locate the document in its SAP Library structure

Use

If all the bookings were successful, the booking confirmations for all the individual flights are bundled into a confirmation for the whole flight trip, which is then sent to the travel agency.

If one or more flights in the flight trip could not be booked, a corresponding notification is to be sent to the travel agency. The flights that were successfully booked must also be cancelled.

To be able to define different processing steps depending on whether the booking was successful or not, define a switch with two branches.

·        Branch 1 is executed if the booking is successful

In this case, the number of bookings sent for the individual flights is identical to the number of booking confirmations received.

To determine whether this is the case, compare the MsgCount and ConfCount counters in a condition.

·        In all other cases the Otherwise branch is executed

In the next lesson you insert the relevant steps into these two branches.

Procedure

...

       1.      Insert a switch (This graphic is explained in the accompanying text) after the SendParallel block.

       2.      Enter AllConfirmationsReceived as the step name.

       3.      Enter SuccessAllFlightsBooked as the outcome name for Branch 1.

Defining a Condition

       4.      Double-click the Condition field.

This displays the condition editor.

       5.      Call the input help for the field under Left Operand.

This displays the expression editor.

       6.      Select Simple Variable followed by MsgCount.

       7.      Following the same procedure, select ConfCount as the right operand.

= (equals sign) is the default setting for the operand.

(MsgCount = ConfCount) is displayed in the switch properties area.

You do not need to define a condition for the Otherwise branch because it will be executed automatically if the condition for Branch 1 is not satisfied.

See also:

Switch

Condition Editor

Using the Expression Editor

 

End of Content Area