Dynamic Parallel Processing in Workflow
By Punit Jhanwar, YASH Technologies from link.
This blog is a step-by-step approach for using dynamic parallel processing in Workflow (For the concept of dynamic parallel processing, please click here).
For our demo purpose, we have taken a simple example. A multiline element ‘Material’ is passed on to workflow and our step ‘Activity’ has to be executed n times (n denotes the number of materials in the multiline container element ‘Material’). In simple words, if 10 materials are passed to the workflow, then 10 work items are to be generated. Following is the step-by-step approach in achieving the same:
1. Create workflow using the workflow builder.
2. Create a Multiline container element for Material number .
3. Create a step ‘Activity’ in the workflow definition.
4. Click on the tab ‘Miscellaneous’.
In the field “Multiline Element”, click on F4 and select MATNR.
5. Now go back to the tab ‘Control’. From the list box, select ‘Create task’
Enter the abbreviation and name for the task.
6. Let us have the material number displayed in the work item text. For this, we need to create a container element for the Material (not a multiline element).
In the properties, click on Import.
7. Insert the container element MATNR in the work item text .
8. Choose the business object and the corresponding method for the material display (we have chosen a dummy method for our demo purpose).
Click on Save and come back to the main screen of step ‘Activity’.
9. Define the binding between the activity and the task.
As seen in the above screenshot, there are two MATNR in the workflow container. One representing the multiline element that we have created for the workflow container and the other is an index of a MATNR. Since we have defined MATNR for the dynamic parallel processing, this step ‘Activity’ would execute for each entry in this multiline element MATNR. So MATNR() represents the index of the material during runtime.
10. Choose the User in the Agents and specify the user id.
11 . Activate the workflow .
12. Execute the workflow. Test run your workflow definition by providing some test data
13. Now check your SAP inbox (Transaction SWBP). There would be three work items for three materials.