The below post is a use case on how to use SWITCH in MULTIPLE CONDITION.
Step1. Create a class in SE24 and implement the interface IF_WORKFLOW so that this class can participate in workflow.
Implement the methods with below code.
Put the below code in the constructor method.
Put the below code which triggers the work flow and passes the sales doc type to the work flow.
Step2. Create a work flow in SWDD transaction.
Create two container elements as follows.
Go to the header of the work flow. Maintain the start event and finish the Binding. Activate and save. Go back.
As a step then create a multiple condition.
Provide the type as – SWITCH and for each outcome provide the comparision value.
The comaprision value can be a complex logical expression which is not possible in multiple condition type CASE.
Put a send mail step.
Activate the workflow.
Step3. Here id the Tx- SBWP
Here is the small test program. Execute.
Step : provide the sales doc number and run.
Work flow started.
So here we have a mail in Tx- SBWP.
Go to Tx- SWI1 and check the log. Execute this.
Select and click on the icon.
Click on the graph icon.
So its a sales doc type is OR.
Run the program again with a different sales doc number.
here we have another mail.
Go to Tx- SWI1 and check the log of the work flow.
Select the icon.
And here is the work flow path in the multiple condition.