SAP MDG · WORKFLOWS

How do I implement SAP MDG parallel result handling in `USMD_SSW_PARA_RSLT_HANDLER` so that any reject overrides approval?

Implement `IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT` in BAdI `USMD_SSW_PARA_RSLT_HANDLER`. The common pattern is to loop over `IT_STEP_ACTION`, return `EV_MERGE_ACTION = '04'` if any branch rejected, otherwise set `EV_MERGE_ACTION = '03'`, and set `EV_MERGE_STEP` to the configured merge step.

Implement `IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT` in BAdI `USMD_SSW_PARA_RSLT_HANDLER`. The common pattern is to loop over `IT_STEP_ACTION`, return `EV_MERGE_ACTION = '04'` if any branch rejected, otherwise set `EV_MERGE_ACTION = '03'`, and set `EV_MERGE_STEP` to the configured merge step.

In SAP MDG, the parallel result handler BAdI consolidates the results of parallel workflow branches into one merged action. The supplied example `ZCL_SUP_CRE_PARA_HANDLER` uses a simple precedence rule: if any branch action in `IT_STEP_ACTION` is reject (`'04'`), the merged result is reject; otherwise it is approve (`'03'`). The merge step is set to `'02'`, and the method clears the output parameters before evaluating the branch actions.

Process flow

  1. Create or reuse a custom class that implements `IF_BADI_INTERFACE` and `IF_USMD_SSW_PARA_RSLT_HANDLER`.
  2. Implement method `IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT`.
  3. Declare typed constants for reject (`'04'`), approve (`'03'`), and the merge step (`'02'` in the example).
  4. Clear `EV_MERGE_ACTION`, `EV_MERGE_STEP`, and `ET_MESSAGE` at the start of the method.
  5. Loop over `IT_STEP_ACTION` and check `LS_STEP_ACTION-ACTION`.
  6. If any action equals reject, assign reject to `EV_MERGE_ACTION`, assign the merge step to `EV_MERGE_STEP`, and `RETURN`.
  7. If no reject is found, assign approve to `EV_MERGE_ACTION` and the merge step to `EV_MERGE_STEP`.
  8. Activate the class and assign the BAdI implementation in your MDG workflow scenario.

Referenced tables

ObjectPurpose
USMD_SSW_PARA_RSLT_HANDLERBAdI that aggregates parallel workflow branch results into one merged result.
IT_STEP_ACTIONInput table containing the individual branch actions to be evaluated by the merge handler.
EV_MERGE_ACTIONOutput field for the final merged workflow action.
EV_MERGE_STEPOutput field for the workflow step to continue from after the merge.
ET_MESSAGEOutput message table; the supplied examples clear it but do not populate it.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_SUP_CRE_PARA_HANDLER 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_HANDLER IMPLEMENTATION. 17 18 19METHOD if_usmd_ssw_para_rslt_handler~handle_parallel_result. 20 21 CONSTANTS: lc_reject TYPE usmd_crequest_action VALUE '04'. 22 CONSTANTS: lc_mergestep TYPE usmd_crequest_appstep VALUE '02'. 23 CONSTANTS: lc_approve TYPE usmd_crequest_action VALUE '03'. 24 25 DATA: ls_step_action TYPE usmd_s_step_action. 26 27 CLEAR: ev_merge_action, ev_merge_step, et_message. 28* Check whether at least on steward rejects the request. The result is to reject. 29 LOOP AT it_step_action INTO ls_step_action. 30 IF ls_step_action-action = lc_reject. 31 ev_merge_action = lc_reject. 32 ev_merge_step = lc_mergestep. 33 RETURN. 34 ENDIF. 35 ENDLOOP. 36 " in this case, no steward rejects, the result is to approve 37 ev_merge_action = lc_approve. 38 ev_merge_step = lc_mergestep. 39ENDMETHOD. 40ENDCLASS.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How do I code `IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT` in SAP MDG?
  • How do I merge parallel workflow branch results in SAP MDG?
  • How do I make an MDG parallel workflow reject if any approver rejects?

Possible questions

  • How do I implement SAP MDG parallel result handling in `USMD_SSW_PARA_RSLT_HANDLER` so that any reject overrides approval?
  • Which BAdI controls the merged result of parallel MDG workflow branches?
  • How do I code `IF_USMD_SSW_PARA_RSLT_HANDLER~HANDLE_PARALLEL_RESULT`?
  • How do I make an MDG parallel workflow reject if any approver rejects?
  • What are the standard action values used in MDG parallel workflow result handling?

Keywords

SAP MDGparallel result handlerUSMD_SSW_PARA_RSLT_HANDLERIF_USMD_SSW_PARA_RSLT_HANDLERHANDLE_PARALLEL_RESULTparallel workflowmerge actionmerge stepreject overrides approveUSMD_CREQUEST_ACTION