SAP MDG · WORKFLOWS
How do I implement parallel result handling in SAP MDG workflow using `USMD_SSW_PARA_RSLT_HANDLER`?
Implement BAdI `USMD_SSW_PARA_RSLT_HANDLER` in method `HANDLE_PARALLEL_RESULT`, read `IT_STEP_ACTION`, and return one merged result. In the supplied pattern, service names `ZMDGS_WF_MERGE` and `ZMDGC_WF_MERGE` use step `21`: if any branch returns action `04`, merge as reject; if any branch returns action `06`, propagate `06`; otherwise merge as approve `03`.
Implement BAdI `USMD_SSW_PARA_RSLT_HANDLER` in method `HANDLE_PARALLEL_RESULT`, read `IT_STEP_ACTION`, and return one merged result. In the supplied pattern, service names `ZMDGS_WF_MERGE` and `ZMDGC_WF_MERGE` use step `21`: if any branch returns action `04`, merge as reject; if any branch returns action `06`, propagate `06`; otherwise merge as approve `03`.
Use BAdI `USMD_SSW_PARA_RSLT_HANDLER` to consolidate parallel MDG workflow branch results in `HANDLE_PARALLEL_RESULT`. The supplied class `ZCL_MDG_S_C_PARALEL_WF` clears the outputs, checks `IV_SERVICE_NAME`, loops through `IT_STEP_ACTION`, and returns one merged action/step for the workflow merge point.
Process flow
- Implement BAdI `
USMD_SSW_PARA_RSLT_HANDLER`. - Implement method `
HANDLE_PARALLEL_RESULT`. - Clear merge outputs and messages.
- Use `IV_SERVICE_NAME` to scope the logic if needed.
- Loop over `IT_STEP_ACTION`.
- Check `LS_STEP_ACTION-ACTION` for reject/other special actions.
- Set `EV_MERGE_ACTION` and `EV_MERGE_STEP`.
- Return to the MDG workflow merge point.
Referenced tables
| Object | Purpose |
|---|---|
V_USMD201C_SSW | Defines the Service Name filter value used for the parallel result handler. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1class ZCL_MDG_S_C_PARALEL_WF 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_MDG_S_C_PARALEL_WF IMPLEMENTATION.
17
18
19METHOD if_usmd_ssw_para_rslt_handler~handle_parallel_result.
20 DATA: ls_step_action TYPE usmd_s_step_action.
21 CLEAR: ev_merge_action, ev_merge_step, et_message.
22 CASE iv_service_name.
23 WHEN 'ZMDGS_WF_MERGE' or 'ZMDGC_WF_MERGE'.
24* Check whether at least on steward rejects the request. The result is to reject.
25 LOOP AT it_step_action INTO ls_step_action.
26 IF ls_step_action-action = '04'.
27 ev_merge_action = '04'.
28 ev_merge_step = '21'.
29 RETURN.
30 ELSEIF ls_step_action-action = '06'.
31 ev_merge_action = '06'.
32 ev_merge_step = '21'.
33 RETURN.
34 ENDIF.
35 ENDLOOP.
36 " in this case, no steward rejects, the result is to approve
37 ev_merge_action = '03'.
38 ev_merge_step = '21'.
39 WHEN OTHERS.
40 ENDCASE.
41
42
43ENDMETHOD.
44ENDCLASS.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I merge parallel MDG workflow branch results?
- How do I make SAP MDG reject if any parallel approver rejects?
- How do I implement `
HANDLE_PARALLEL_RESULT` for a parallel approval workflow?
Possible questions
- What input does `
HANDLE_PARALLEL_RESULT` receive? - Which BAdI is used to merge parallel MDG workflow results?
- How do I set the merge step and merge action in MDG parallel processing?
- How do I add service-specific logic in `
HANDLE_PARALLEL_RESULT`? - What are the common action codes used in the supplied examples?