Working with Multiple Condition
1. Create a workflow from SWDD T.code.
2. Create a loop( until ) step.
3. Set a counter element LV_COUNTER inside the Loop( Until ) Step.
For a Detailed Explanation on how to create a:
- Loop( Until ) Step
- Workflow Container Element LV_COUNTER
- Set the LV_COUNTER in Loop( Until ) Step
- Please Refer to points from 1 to 18: Working with Container Operation and Loop (Until) Steps - PART1.
4. We have to select the ‘Multiple Condition’ to create multiple branches for execution on different conditions.
5. Multiple condition step.
- First we have to enter ‘step name’.
- Select type as ‘Switch’.
- And create conditions as shown below.
- Here we are creating three conditions.
- First reminder(a branch created in workflow layout with the same description) is sent if the value of the counter (lv_counter) is 3.
- Second reminder(a branch created in workflow layout with the same description) is sent if the value of the counter (lv_counter) is 2.
- Third reminder(a branch created in workflow layout with the same description) is sent if the value of the counter (lv_counter) is 1.
- To fill the condition section follow the steps as shown below.
- First, enter the outcome name.
- Then click on the condition to provide the condition necessary to execute this branch.
- Conditions provided to each outcome will be shown in the condition preview column.
- Also provide other value outcome names.
- Here we can handle condition which does not match any of the conditions defined in the Comparison table.
- It just acts like when others in ‘case statement used in an ABAP code’.
- Save this step and go back to the workflow layout screen.
6. Now next process will be creating ‘send mail steps’ for all three reminders.
- Select the ‘Send Mail’ step.
- In the mail step, there is a tab named ‘Mail’.
- Here we have the Recipients section:
- Recipient types: The recipient type will allow us to choose recipients depending on Organization Unit, job, position, work center or user.
- We can also choose the recipient as ‘WF initiator’ (Workflow initiator- the user who starts the workflow).
- Expression: Here we can browse the workflow container element which will hold the email addresses of the valid recipients during runtime.
- Now Create the ‘the Send Mail’ step in the First Reminder branch as shown below.
- Now create the ‘Send Mail’ steps for Reminder 2 and Remainder 3.
7. Now the workflow layout looks as shown below.
- Click on create the ‘Container Operation step’.
- The First view of the ‘Container operation’ step looks as follows.
- In this step, we have to fill in step name, outcome name, etc.
- There is a check box to include or exclude this step in the workflow log(After execution).
- Now we have to fill the decrement expression in the ‘Operation’ section as shown below.
- Here we are decrementing the value count of the variable ‘LV_COUNTER’ (Initial value is ‘3’).
- Result Element: The Result Element is the variable or Parameter in which the result is stored after calculation.
- Assignment: This section provides ‘=’ and ‘<-‘ symbols to assign to the result.
- Expression Section: Here we can provide a ‘Workflow Container’ element or we can directly assign numeric values.
- Operator Section: This section consists of ‘Arithmetic Operators’ which we can assign to the expression.
- Examples: +,-,/,*.
- Save it and go back to the workflow layout.
10. Check, Save and Activate.
11. Now the workflow is ready to execute.
- Execute the workflow.
- After execution we will find 3 remainder mails in SBWP ( SAP business workplace ).
Comments
Post a Comment