SAP MDG · WORKFLOWS

How do I create a follow-up Change Request automatically in SAP MDG Rule-Based Workflow using BAdI USMD_SSW_SYSTEM_METHOD_CALLER?

To create a follow-up Change Request in SAP MDG, copy material CR type MAT01 to a custom CR type, copy the workflow steps, define a service name such as ZCREATE_FOLLOW_UP_CR, configure the BRF+ Non-User Agent Decision Table for Process Pattern 02, and implement BAdI USMD_SSW_SYSTEM_METHOD_CALLER using the copied sample MDG_BS_MAT_CREATE_SUCCESSOR_CR.

To create a follow-up Change Request in SAP MDG, copy material CR type MAT01 to a custom CR type, copy the workflow steps, define a service name such as ZCREATE_FOLLOW_UP_CR, configure the BRF+ Non-User Agent Decision Table for Process Pattern 02, and implement BAdI USMD_SSW_SYSTEM_METHOD_CALLER using the copied sample MDG_BS_MAT_CREATE_SUCCESSOR_CR.

SAP MDG can create a follow-up Change Request automatically by combining Rule-Based Workflow, Process Pattern 02, and BAdI USMD_SSW_SYSTEM_METHOD_CALLER. In the referenced guide, the standard material CR type MAT01 is copied to a custom type ZMAT01FU, the workflow steps are copied, a service name ZCREATE_FOLLOW_UP_CR is defined, and the BRF+ decision tables are adjusted so the system-method step calls the BAdI implementation.

Process flow

  1. Start transaction MDGIMG.
  2. Navigate to General Settings > Process Modeling > Change Requests > Create Change Request Type.
  3. Copy MAT01 to the custom CR type ZMAT01FU.
  4. Navigate to General Settings > Process Modeling > Workflow > Rule-Based Workflow > Define Change Request Steps for Rule-Based Workflow.
  5. Copy the MAT01 workflow steps to ZMAT01FU.
  6. Navigate to General Settings > Process Modeling > Workflow > Rule-Based Workflow > Configure Rule-Based Workflow > Define Service Names for Rule-Based Workflow.
  7. Create the service name ZCREATE_FOLLOW_UP_CR.
  8. Export the three BRF+ decision tables from MAT01, adjust them, and import them for ZMAT01FU. Configure the Non-User Agent Decision Table for Process Pattern 02 and the same service name. Set the Single Value Decision Table so the flow can,

Referenced tables

ObjectPurpose
BRF+ Single Value Decision TableControls the step transition and routes the workflow into the system-method branch, including the new step and status values.
BRF+ User Agent Decision TableAssigns dialog agents for user-driven workflow branches.
BRF+ Non-User Agent Decision TableAssigns automatic-step processing, including Condition Alias 10, Agent Group 10, Process Pattern 02, and the service name.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example

Exact relevant implementation excerpt from the knowledge document.

1"! <p class="shorttext"><strong>SAP MDG Rule-Based Workflow</strong><br/> 2"! Call a synchronous system method to create a follow-up Change Request</p> 3"! 4"! <p>Source-document code reference for BAdI 5"! {@link USMD_SSW_SYSTEM_METHOD_CALLER} and method 6"! {@link IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD}.</p> 7"! 8"! <h2>SAP objects</h2> 9"! <ul> 10"! <li>Enhancement spot: USMD_SSW_SERVICE_PROCESSOR</li> 11"! <li>BAdI: USMD_SSW_SYSTEM_METHOD_CALLER</li> 12"! <li>Interface: IF_USMD_SSW_SYST_METHOD_CALLER</li> 13"! <li>Method: IF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHOD</li> 14"! <li>Sample enhancement implementation: MDG_BS_MAT_CREATE_SUCCESSOR_CR</li> 15"! <li>Required SAP Note: 3199378</li> 16"! <li>Service name used by the scenario: ZCREATE_FOLLOW_UP_CR</li> 17"! <li>Process pattern: 02 - Synchronous System Method</li> 18"! </ul> 19"! 20"! <h2>Important source limitation</h2> 21"! <p>The PDF contains a screenshot of only the beginning of the copied SAP 22"! sample method. It does not print the complete sample-class source. The 23"! excerpt below therefore ends exactly where the visible screenshot ends. 24"! No missing continuation has been invented.</p> 25"! 26"! @tags SAP-MDG Rule-Based-Workflow Follow-Up-Change-Request 27"! @tags USMD_SSW_SYSTEM_METHOD_CALLER USMD_SSW_SERVICE_PROCESSOR 28"! @tags CALL_SYSTEM_METHOD ZCREATE_FOLLOW_UP_CR Process-Pattern-02 29 30*---------------------------------------------------------------------* 31* Generic and scenario-specific object names shown in the guide 32*---------------------------------------------------------------------* 33* Generic enhancement implementation : ZMY_SERVICE_CALL_SYSTEM_METHOD 34* Scenario enhancement implementation: ZBDI_CREATE_FOLLOW_UP_CR 35* 36* Generic BAdI implementation : ZMY_SERVICE_CALL_SYSTEM_METHOD 37* Scenario BAdI implementation : ZBDI_CREATE_FOLLOW_UP_CR 38* 39* Generic implementing class : ZCL_MY_SERVICE_CALL_SYS_METHOD 40* Scenario implementing class : ZCL_ZBDI_CREATE_FOLLOW_UP_CR 41* 42* Generic filter value : ZMY_SERVICE_NAME 43* Scenario filter value : ZCREATE_FOLLOW_UP_CR 44* 45* Filter : SERVICE_NAME 46* Comparator : = 47*---------------------------------------------------------------------* 48 49*---------------------------------------------------------------------* 50* Visible method parameters in the PDF 51*---------------------------------------------------------------------* 52* IV_CR_NUMBER TYPE USMD_CREQUEST 53* IV_SERVICE_NAME 54* EV_ACTION 55* ET_MESSAGE 56* CT_CONTEXT_TAB 57* CX_BO_TEMPORARY 58*---------------------------------------------------------------------* 59 60*---------------------------------------------------------------------* 61* Code excerpt visible in the PDF screenshot 62*---------------------------------------------------------------------* 63 64METHOD if_usmd_ssw_syst_method_caller~call_system_method. 65 "* Create a follow-up change request with reference to an existing, closed change request 66 67 "Use the fieldnames and types of database table USD120C for defining the local type 68 TYPES: BEGIN OF lty_crequest, 69 usmd_crequest TYPE usmd_crequest, 70 usmd_created_by TYPE xubname, 71 END OF lty_crequest. 72 DATA lt_crequest TYPE SORTED TABLE OF lty_crequest WITH UNIQUE KEY usmd_crequest. 73 74 "Clear the exporting parameter 75 CLEAR: ev_action, et_message. 76 77 CASE iv_service_name. 78 WHEN 'insert your service name (as defined via IMG) here'. 79 80 "Ensure that the reference change request number is provided 81 IF iv_cr_number IS INITIAL. 82 "Implement proper error handling here... 83 RETURN. 84 ENDIF. 85 86 "Get an instance of the External Model API 87 cl_usmd_model_ext=>get_instance( 88 EXPORTING 89 i_usmd_model = space "No data model need to be provided here 90 IMPORTING 91 eo_instance = DATA(lo_model_ext) 92 et_message = et_message ). 93 IF et_message IS NOT INITIAL. 94 "Do proper error handling 95 RETURN. 96 ENDIF. 97 98*---------------------------------------------------------------------* 99* End of source excerpt visible in the PDF. 100* The remaining CASE logic and method ending are not shown. 101*---------------------------------------------------------------------*

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

Related questions and keywords

Alternative questions

  • How can I configure SAP MDG to create a successor Change Request after activation?
  • What is the implementation for a synchronous system method in MDG Rule-Based Workflow?
  • How do I use service name filtering with USMD_SSW_SYSTEM_METHOD_CALLER?

Possible questions

  • How do I configure a follow-up Change Request in MDG-M after activation?
  • Which BAdI and BRF+ process pattern are used for a synchronous system method in MDG?
  • What SAP sample implementation should I copy for successor Change Request creation?
  • How do I set up a custom service name for Rule-Based Workflow in MDG?
  • How do I verify that the follow-up Change Request was created in the Workflow Log?

Keywords

SAP MDGRule-Based WorkflowFollow-Up Change RequestSuccessor Change RequestUSMD_SSW_SYSTEM_METHOD_CALLERUSMD_SSW_SERVICE_PROCESSORIF_USMD_SSW_SYST_METHOD_CALLER~CALL_SYSTEM_METHODProcess Pattern 02Synchronous System MethodMAT01ZMAT01FUZCREATE_FOLLOW_UP_CRMDG_BS_MAT_CREATE_SUCCESSOR_CRBRF+SERVICE_NAMEMDGIMGSE18SAP Note 3199378