SAP MDG · WORKFLOWS

How do I implement a system method in SAP MDG Rule-Based Workflow using `IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD`?

Implement the automatic action in BAdI `USMD_SSW_SYSTEM_METHOD_CALLER` and wire it from the MDG Rule-Based Workflow as a non-user step with Process Pattern `02` and a matching Service Name. In the method, gate on `iv_service_name`, read the current Change Request with `CL_USMD_CREQUEST_API`, and execute the required logic such as follow-up CR creation, then return messages via `et_message`.

Implement the automatic action in BAdI `USMD_SSW_SYSTEM_METHOD_CALLER` and wire it from the MDG Rule-Based Workflow as a non-user step with Process Pattern `02` and a matching Service Name. In the method, gate on `iv_service_name`, read the current Change Request with `CL_USMD_CREQUEST_API`, and execute the required logic such as follow-up CR creation, then return messages via `et_message`.

SAP MDG Rule-Based Workflow executes system-method steps through BAdI `USMD_SSW_SYSTEM_METHOD_CALLER` in enhancement spot `USMD_SSW_SERVICE_PROCESSOR`. The key is to configure the BRF+ non-user agent decision table with Process Pattern `02` and the same Service Name that your BAdI implementation handles, then implement `IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD` to read the current Change Request and perform the automatic action.

Process flow

  1. Create or copy the BAdI implementation for `USMD_SSW_SYSTEM_METHOD_CALLER` in `SE18`.
  2. Set the implementation filter to the intended `SERVICE_NAME`.
  3. Maintain the rule-based workflow BRF+ tables for the CR type.
  4. Use `DT_NON_USER_AGT_GRP_<CR>` for the automatic step and assign `Process Pattern 02`.
  5. Give the step a `Service Name` that matches the BAdI implementation.
  6. Implement `IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD`.
  7. Check `iv_service_name` and read the CR via `CL_USMD_CREQUEST_API`.
  8. Execute the automatic action, then return workflow messages in `et_message`.

Referenced tables

ObjectPurpose
DT_SINGLE_VAL_<CR>Step engine table that determines the next step, status, and condition alias.
DT_USER_AGT_GRP_<CR>Dialog-agent assignment table for user-driven workflow steps.
DT_NON_USER_AGT_GRP_<CR>Automatic-step table that carries `Condition Alias`, `Agent Group`, `Process Pattern`, and `Service Name`.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1class ZCL_ENH_SUP_CRE_SYS_METHOD 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_ENH_SUP_CRE_SYS_METHOD IMPLEMENTATION. 17 18 19 method IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD. 20** 21*** **** INSERT IMPLEMENTATION HERE **** *** 22**IF sy-uname = 'TE579309'. 23** 24** 25** CONSTANTS: lc_model TYPE usmd_model VALUE 'BP'. 26** 27** DATA : ls_input TYPE zmt_supplier_query_req1. 28** DATA : ls_zssu_vendor TYPE zget_transaction_data_new_soa1. 29** DATA lv_cr_number TYPE usmd_crequest. 30** DATA ls_crequest TYPE usmd_s_crequest. 31** DATA : lt_sup TYPE ztransaction_data_new_tab1, 32** ls_sup TYPE ztransaction_data_new1. 33** DATA: lo_crequest TYPE REF TO if_usmd_crequest_api, 34** lo_model TYPE REF TO if_usmd_model_ext, 35** lt_sel TYPE usmd_ts_sel, 36** lt_sel_cp TYPE usmd_ts_sel, 37** ls_sel TYPE usmd_s_sel, 38** lt_entities TYPE usmd_t_crequest_entity, 39** lv_entity_name TYPE usmd_fieldname, 40** lt_entity_bp_centrl TYPE TABLE OF /mdgbp/_s_bp_pp_bp_centrl, 41** lt_entity_ad_postal TYPE TABLE OF /mdgbp/_s_bp_pp_ad_postal, 42** lt_entity_ad_url TYPE TABLE OF /mdgbp/_s_bp_pp_ad_url, 43** lt_entity_ad_email TYPE TABLE OF /mdgbp/_s_bp_pp_ad_email, 44** lt_entity_ad_fax TYPE TABLE OF /mdgbp/_s_bp_pp_ad_fax, 45** lt_entity_ad_tel TYPE TABLE OF /mdgbp/_s_bp_pp_ad_tel, 46** lt_entity_ZBP_SUPPL TYPE TABLE OF zmdgbp_s_bp_pp_ZBP_SUPPL, 47** lt_entity_ztecrt TYPE TABLE OF zmdgbp_s_bp_pp_ztecrt, 48** lt_entity_zteattach TYPE TABLE OF zmdgbp_s_bp_pp_zteattach, 49** lt_entity_bp_wpad TYPE TABLE OF /mdgbp/_s_bp_pp_bp_wpad, 50** lt_entity_wp_tel TYPE TABLE OF /mdgbp/_s_bp_pp_wp_tel, 51** lt_entity_wp_fax TYPE TABLE OF /mdgbp/_s_bp_pp_wp_fax, 52** lt_entity_wp_email TYPE TABLE OF /mdgbp/_s_bp_pp_wp_email, 53** lt_entity_bp_compny TYPE TABLE OF /mdgbpx/_s_bp_pp_bp_compny, 54** lt_entity_bp_header_cp TYPE TABLE OF /mdgbp/_s_bp_pp_bp_header, 55** lt_entity_bp_porg TYPE TABLE OF /mdgbpx/_s_bp_pp_bp_porg, 56** lt_tcontact TYPE ztransaction_contacts_tab1, 57** ls_tcontact TYPE ztransaction_contacts1, 58** lv_partner TYPE bu_partner. 59** 60** ls_input = lv_input. 61** 62** IF sy-sysid CP 'EH*'. 63** DATA(lv_env) = 'S'. 64** ELSEIF sy-sysid CP 'DH*'. 65** lv_env = 'D'. 66** ELSEIF sy-sysid CP 'QH*' OR sy-sysid CP 'SH*'. 67** lv_env = 'Q'. 68** ELSEIF sy-sysid CP 'PH*'. 69** lv_env = 'P'. 70** ENDIF. 71** 72** CHECK ls_input-mt_supplier_query_req-env = lv_env AND ls_input-mt_supplier_query_req-id <> '?'. 73** lv_cr_number = ls_input-mt_supplier_query_req-id. 74** 75** CALL METHOD cl_usmd_crequest_api=>get_instance 76** EXPORTING 77** iv_crequest = lv_cr_number 78** IMPORTING 79** re_inst_crequest_api = lo_crequest. 80** 81** CALL METHOD lo_crequest->read_crequest 82** IMPORTING 83** es_crequest = ls_crequest. 84** 85** Get read-only FIELDS access to model data. 86** CALL METHOD cl_usmd_model_ext=>get_instance 87** EXPORTING 88** i_usmd_model = lc_model 89** IMPORTING 90** eo_instance = lo_model. 91** 92** CHECK ls_crequest-usmd_creq_type = 'ZSUPL1P1'. 93** ls_crequest-usmd_creq_type = 'SUPPL2P1'. 94** 95**** prepare selection 96** ls_sel-sign = usmd0_cs_ra-sign_i. 97** ls_sel-option = usmd0_cs_ra-option_eq. 98** ls_sel-fieldname = usmd0_cs_fld-crequest. 99** ls_sel-low = lv_cr_number. 100** INSERT ls_sel INTO TABLE lt_sel. 101** CALL METHOD lo_model->read_char_value 102** EXPORTING 103** i_fieldname = usmd0_cs_fld-crequest 104** it_sel = lt_sel 105** IMPORTING 106** et_data = lt_entities. 107** 108** LOOP AT lt_entities ASSIGNING FIELD-SYMBOL(<fs_entity>) 109** WHERE usmd_seqnr = '1' OR usmd_seqnr = '2'. "#EC CI_SORTSEQ 110** ls_sel-fieldname = <fs_entity>-usmd_entity_obj. 111** ls_sel-low = <fs_entity>-usmd_value. 112** INSERT ls_sel INTO TABLE lt_sel. 113** IF <fs_entity>-usmd_entity_obj = 'BP_HEADER' 114** AND <fs_entity>-usmd_seqnr = '1'. 115** lv_partner = <fs_entity>-usmd_value. 116** ENDIF. 117** ENDLOOP. 118** 119** IF lv_partner IS NOT INITIAL. 120** CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

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

Related questions and keywords

Alternative questions

  • How do I configure a synchronous system method step in MDG Rule-Based Workflow?
  • How do I create a follow-up Change Request from an MDG workflow step?
  • How do I use BAdI `USMD_SSW_SYSTEM_METHOD_CALLER` for an automatic workflow action?

Possible questions

  • How do I implement a system method in SAP MDG Rule-Based Workflow using `IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD`?
  • How do I configure a synchronous system method step in MDG Rule-Based Workflow?
  • How do I create a follow-up Change Request from an MDG workflow step?
  • How do I use BAdI `USMD_SSW_SYSTEM_METHOD_CALLER` for an automatic workflow action?
  • Which service name should I assign to a system-method step?
  • What does `iv_service_name` control in the MDG workflow BAdI?

Keywords

SAP MDGRule-Based WorkflowUSMD_SSW_SYSTEM_METHOD_CALLERIF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHODUSMD_SSW_SERVICE_PROCESSORProcess Pattern 02Synchronous System MethodBRF+Service NameChange Requestfollow-up Change Requestworkflow stepSE18MDGIMGCL_USMD_CREQUEST_APICL_USMD_MODEL_EXTCL_USMD_GOV_API