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

  1. Identify the parallel merge point in the MDG workflow.
  2. Confirm the workflow action codes used for approve and reject.
  3. Implement a class with `IF_BADI_INTERFACE` and `IF_USMD_SSW_PARA_RSLT_HANDLER`.
  4. Code `HANDLE_PARALLEL_RESULT` to inspect `IT_STEP_ACTION`.
  5. Set `EV_MERGE_STEP` and `EV_MERGE_ACTION` according to the business rule.
  6. Activate the BAdI implementation and test mixed parallel results.

Referenced tables

ObjectPurpose
IT_STEP_ACTIONInput 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_HANDLER in SAP MDG?
  • How do I decide the final merge action after parallel MDG workflow approvals?
  • How do I implement HANDLE_PARALLEL_RESULT for 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?

Keywords

SAP MDGparallel workflowresult handlerUSMD_SSW_PARA_RSLT_HANDLERIF_USMD_SSW_PARA_RSLT_HANDLERHANDLE_PARALLEL_RESULTEV_MERGE_STEPEV_MERGE_ACTIONIT_STEP_ACTIONreject winsmerge logic