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

  1. Implement BAdI `USMD_SSW_PARA_RSLT_HANDLER`.
  2. Implement method `HANDLE_PARALLEL_RESULT`.
  3. Clear merge outputs and messages.
  4. Use `IV_SERVICE_NAME` to scope the logic if needed.
  5. Loop over `IT_STEP_ACTION`.
  6. Check `LS_STEP_ACTION-ACTION` for reject/other special actions.
  7. Set `EV_MERGE_ACTION` and `EV_MERGE_STEP`.
  8. Return to the MDG workflow merge point.

Referenced tables

ObjectPurpose
V_USMD201C_SSWDefines 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?

Keywords

USMD_SSW_PARA_RSLT_HANDLERIF_USMD_SSW_PARA_RSLT_HANDLERHANDLE_PARALLEL_RESULTIT_STEP_ACTIONEV_MERGE_ACTIONEV_MERGE_STEPIV_SERVICE_NAMEUSMD_SSW_SERVICE_PROCESSORSE18MDGIMGparallel workflowmerge actionmerge step