SAP MDG · WORKFLOWS

How do I implement an SAP MDG rule-based workflow system method caller BAdI for custom workflow actions?

Use a rule-based workflow service name and a BAdI implementation of IF_USMD_SSW_SYST_METHOD_CALLER. In the workflow, route a non-user step with Process Pattern 02 (Synchronous System Method) to your service name, and in CALL_SYSTEM_METHOD dispatch to the custom ABAP method that performs the required action.

Use a rule-based workflow service name and a BAdI implementation of IF_USMD_SSW_SYST_METHOD_CALLER. In the workflow, route a non-user step with Process Pattern 02 (Synchronous System Method) to your service name, and in CALL_SYSTEM_METHOD dispatch to the custom ABAP method that performs the required action.

Implement a custom service name in MDG rule-based workflow, then map it to a BAdI implementation of `IF_USMD_SSW_SYST_METHOD_CALLER`. In `CALL_SYSTEM_METHOD`, check `IV_SERVICE_NAME` and dispatch to the corresponding ABAP method. For example, the supplied pattern calls `ZCL_MDG_SUPPLIER_BLK_UNBLK=>APPLY_BLOCK`, `REPLICATE`, or `UNBLOCK_FINAL_CHECK` depending on the service name. For snapshot refresh scenarios, the documented pattern uses `CL_USMD_SNAPSHOT_TOOLS=>REFRESH_SNAPSHOT_FOR_CR` in the system-method implementation.

Process flow

  1. Define the MDG rule-based workflow service name in MDGIMG.
  2. Create a BAdI implementation for enhancement spot USMD_SSW_SERVICE_PROCESSOR, BAdI USMD_SSW_SYSTEM_METHOD_CALLER.
  3. Implement IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD.
  4. Use IV_SERVICE_NAME to dispatch to the required ABAP method.
  5. Return EV_ACTION, ET_MESSAGE, and CT_CONTEXT_TAB to the workflow runtime.
  6. In the workflow decision table, use Process Pattern 02 for the synchronous system method and assign the service name.
  7. If needed, create a standard task in PFTC as a synchronous object method in background processing and bind the change request parameter.
  8. Activate and test that the workflow calls the correct service implementation.

Referenced tables

ObjectPurpose
USMD1210Change request notes table mentioned in the related MDG utility method guide context.
MARABase table used in the validation-rule example for checking an existing material change request in mass processing.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_MDG_ZSUPBKD_SYS_CALLER definition 2 public 3 final 4 create public . 5 6public section. 7 8 interfaces IF_BADI_INTERFACE . 9 interfaces IF_USMD_SSW_SYST_METHOD_CALLER . 10protected section. 11private section. 12ENDCLASS. 13 14 15 16CLASS ZCL_MDG_ZSUPBKD_SYS_CALLER IMPLEMENTATION. 17 18 19 method if_usmd_ssw_syst_method_caller~call_system_method. 20 case iv_service_name. 21 when 'ZMDG_ZSUPBKD_BLOCK'. 22 call method zcl_mdg_supplier_blk_unblk=>apply_block 23 exporting 24 iv_cr_number = iv_cr_number 25 iv_service_name = iv_service_name 26 importing 27 ev_action = ev_action 28 et_message = et_message 29 changing 30 ct_context_tab = ct_context_tab. 31 32 when 'ZMDG_ZSUPBKD_BLOCK_REPLICATION'. 33 call method zcl_mdg_supplier_blk_unblk=>replicate 34 exporting 35 iv_cr_number = iv_cr_number 36 iv_service_name = iv_service_name 37 importing 38 ev_action = ev_action 39 et_message = et_message 40 changing 41 ct_context_tab = ct_context_tab. 42 43 ev_action = ev_action. 44 et_message = et_message. 45 ct_context_tab = ct_context_tab. 46 when 'ZMDG_ZSUPBKD_UNBLOCK' or 'ZMDG_ZSUPBKD_WITHDRAW_REP'. 47 call method zcl_mdg_supplier_blk_unblk=>unblock_final_check 48 exporting 49 iv_cr_number = iv_cr_number 50 iv_service_name = iv_service_name 51 importing 52 ev_action = ev_action 53 et_message = et_message 54 changing 55 ct_context_tab = ct_context_tab. 56 57 ev_action = ev_action. 58 et_message = et_message. 59 ct_context_tab = ct_context_tab. 60 61 when others. 62 63 ev_action = ev_action. 64 et_message = et_message. 65 ct_context_tab = ct_context_tab. 66 endcase. 67 endmethod. 68ENDCLASS.

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

Related questions and keywords

Alternative questions

  • How do I wire a custom service name to IF_USMD_SSW_SYST_METHOD_CALLER?
  • How do I call custom ABAP logic from an MDG workflow system step?
  • How do I implement a synchronous system method in MDG rule-based workflow?

Possible questions

  • How do I implement an SAP MDG rule-based workflow system method caller BAdI for custom workflow actions?
  • How do I wire a custom service name to IF_USMD_SSW_SYST_METHOD_CALLER?
  • How do I call custom ABAP logic from an MDG workflow system step?
  • How do I implement a synchronous system method in MDG rule-based workflow?
  • How do I refresh an MDG change request snapshot from workflow?

Keywords

IF_USMD_SSW_SYST_METHOD_CALLERUSMD_SSW_SYSTEM_METHOD_CALLERCALL_SYSTEM_METHODservice namerule-based workflowSynchronous System Methodcl_usmd_snapshot_tools=>refresh_snapshot_for_crPFTCMDGIMGSE18