Sie sind auf Seite 1von 5

Dynamic Parallel Processing in Workflow

Dynamic Parallel Processing


Sometimes we need to process a dialog step (activity) several times in parallel and we may not be aware of how many times
exactly this step has to be processed. Consider this scenario: For a sales order, we need to check the available quantity of the
line items (materials). For each value of this list, a particular function has to be performed. So we need to create different work
items for each material. This is called dynamic parallel processing, since the number of line items is known only during runtime.
To achieve this, follow these steps:
1. We need to define a multiline container for the material.
2. Go to "Others" tab of the dialog step (activity)
3. Enter this workflow container element on this tab.
Restriction : The multiline element should not contain more than 99 values. At runtime, the workflow system generates from the
step as many parallel work items as there are values in the multiline container element at that time. The number of values need
not be known at definition time. If the table is empty, this step is ignored.
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).

Continued...
Dynamic Parallel Processing in Workflow
...Previous
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.

Das könnte Ihnen auch gefallen