SAP MDG · WORKFLOWS
How do I implement the SAP MDG parallel result handler BAdI to merge parallel workflow branch results?
Implement BAdI USMD_SSW_PARA_RSLT_HANDLER in method HANDLE_PARALLEL_RESULT. Loop through IT_STEP_ACTION, and if any branch action is '04', set EV_MERGE_STEP to '21' and EV_MERGE_ACTION to '04'; otherwise set EV_MERGE_STEP to '21' and EV_MERGE_ACTION to '03'.
Implement BAdI USMD_SSW_PARA_RSLT_HANDLER in method HANDLE_PARALLEL_RESULT. Loop through IT_STEP_ACTION, and if any branch action is '04', set EV_MERGE_STEP to '21' and EV_MERGE_ACTION to '04'; otherwise set EV_MERGE_STEP to '21' and EV_MERGE_ACTION to '03'.
Implement the SAP MDG parallel result handler in BAdI `USMD_SSW_PARA_RSLT_HANDLER` by evaluating `IT_STEP_ACTION` and setting the merged workflow outcome in `EV_MERGE_STEP` and `EV_MERGE_ACTION`. The supplied customer example uses a simple and deterministic rule: any parallel rejection (`'04'`) overrides approval (`'03'`), with merge step `'21'`.
Process flow
- Identify the parallel merge point in the MDG workflow.
- Confirm the workflow action codes used for approve and reject.
- Implement a class with `IF_BADI_INTERFACE` and `IF_USMD_SSW_PARA_RSLT_HANDLER`.
- Code `
HANDLE_PARALLEL_RESULT` to inspect `IT_STEP_ACTION`. - Set `EV_MERGE_STEP` and `EV_MERGE_ACTION` according to the business rule.
- Activate the BAdI implementation and test mixed parallel results.
Referenced tables
| Object | Purpose |
|---|---|
IT_STEP_ACTION | Input table passed to `HANDLE_PARALLEL_RESULT` containing the parallel branch actions to be merged |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1class ZCL_SUP_CRE_PARA_HANDL definition
2 public
3 final
4 create public .
5
6public section.
7
8 interfaces IF_BADI_INTERFACE .
9 interfaces IF_USMD_SSW_PARA_RSLT_HANDLER .
10protected section.
11private section.
12ENDCLASS.
13
14
15
16CLASS ZCL_SUP_CRE_PARA_HANDL IMPLEMENTATION.
17
18
19 method IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT.
20 LOOP AT it_step_action INTO data(ls_step_action).
21 if ls_step_action-action = '04'.
22 ev_merge_step = '21'.
23 ev_merge_action = '04'.
24 RETURN.
25 endif.
26 ENDLOOP.
27 ev_merge_step = '21'.
28 ev_merge_action = '03'.
29 endmethod.
30ENDCLASS.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I code
USMD_SSW_PARA_RSLT_HANDLERin SAP MDG? - How do I decide the final merge action after parallel MDG workflow approvals?
- How do I implement
HANDLE_PARALLEL_RESULTfor reject-overrides-approve logic in SAP MDG?
Possible questions
- What is the BAdI for SAP MDG parallel workflow result handling?
- Which method is used to merge parallel approval results in MDG?
- How do I make any reject win in a parallel MDG workflow branch?
- How do I set EV_MERGE_STEP and EV_MERGE_ACTION in
HANDLE_PARALLEL_RESULT? - Can I use a service-specific merge rule with IV_SERVICE_NAME?