SAP MDG · RULE-BASED WORKFLOW
How does USMD_SSW_PARA_RESULT_HANDLER merge parallel approval results in SAP MDG?
Several approvals. One next step. Understand how MDG brings parallel workflow branches back together.
Use BAdI USMD_SSW_PARA_RESULT_HANDLER and its HANDLE_PARALLEL_RESULT method to evaluate parallel work-item results and return one next workflow step, action, and any required messages.
MDGIMGGeneral Settings → Process Modeling → Change Requests → Change Requests
Copy and adapt the Change Request Type; the guide uses MATL01 as an example.
MDGIMGGeneral Settings → Process Modeling → Workflow → Rule-Based Workflow → Configure Rule-Based Workflow → Define Change Request Steps for Rule-Based Workflow
Maintain parallel branches and the subsequent workflow steps.
SE18Enhancement Spot Element Definitions → USMD_SSW_SERVICE_PROCESSOR
Create and activate the filter-dependent USMD_SSW_PARA_RESULT_HANDLER implementation.
ILLUSTRATIVE ABAP SAMPLE
Merge the parallel branch actions
Adapt the action and step values to your Change Request process. The source guide identifies the BAdI and method but does not expose its complete implementation.
1METHOD if_usmd_ssw_para_rslt_handler~handle_parallel_result.
2
3DATA:
4 lv_approve_count TYPE i VALUE 0,
5 lv_reject_count TYPE i VALUE 0,
6 ls_step_action TYPE LINE OF ct_parallel_step_action.
7
8LOOP AT ct_parallel_step_action INTO ls_step_action.
9 CASE ls_step_action-action.
10WHEN '03'.
11 lv_approve_count = lv_approve_count + 1.
12WHEN '04'.
13 lv_reject_count = lv_reject_count + 1.
14 ENDCASE.
15ENDLOOP.
16
17IF lv_reject_count > 0.
18 cv_new_step = '90'.
19 cv_new_action = '04'.
20ELSEIF lv_approve_count = lines( ct_parallel_step_action ).
21 cv_new_step = '02'.
22 cv_new_action = '03'.
23ENDIF.
24
25ENDMETHOD.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I create parallel workflow tasks in SAP MDG?
- How do I merge two parallel approval work items?
- What BAdI merges parallel workflow results?