SAP MDG · WORKFLOWS
How do I configure SAP MDG Rule-Based Workflow to automatically create a follow-up Change Request after activation?
Use Rule-Based Workflow process pattern 02 with BAdI USMD_SSW_SYSTEM_METHOD_CALLER. Copy MAT01 to a custom CR type, copy its workflow steps, define service name ZCREATE_FOLLOW_UP_CR, import the adjusted BRF+ decision tables, create the SE18 BAdI implementation with filter SERVICE_NAME = ZCREATE_FOLLOW_UP_CR, adapt SAP sample MDG_BS_MAT_CREATE_SUCCESSOR_CR, and activate/test.
Use Rule-Based Workflow process pattern 02 with BAdI USMD_SSW_SYSTEM_METHOD_CALLER. Copy MAT01 to a custom CR type, copy its workflow steps, define service name ZCREATE_FOLLOW_UP_CR, import the adjusted BRF+ decision tables, create the SE18 BAdI implementation with filter SERVICE_NAME = ZCREATE_FOLLOW_UP_CR, adapt SAP sample MDG_BS_MAT_CREATE_SUCCESSOR_CR, and activate/test.
Use Rule-Based Workflow process pattern 02 and BAdI USMD_SSW_SYSTEM_METHOD_CALLER to create the follow-up Change Request after activation. In the documented MDG-M example, MAT01 is copied to ZMAT01FU, workflow steps and BRF+ decision tables are copied and adjusted, the service name ZCREATE_FOLLOW_UP_CR is defined, and the BAdI implementation is created in SE18 with filter SERVICE_NAME.
Process flow
- Open MDGIMG.
- Navigate to General Settings > Process Modeling > Change Requests > Create Change Request Type.
- Copy MAT01 to ZMAT01FU and save the configuration.
- Navigate to General Settings > Process Modeling > Workflow > Rule-Based Workflow > Define Change Request Steps for Rule-Based Workflow.
- Copy the MAT01 workflow steps to ZMAT01FU.
- Navigate to General Settings > Process Modeling > Workflow > Rule-Based Workflow > Configure Rule-Based Workflow > Define Service Names for Rule-Based Workflow.
- Create service name ZCREATE_FOLLOW_UP_CR with a meaningful description.
- Export the Single Value, User Agent, and Non-User Agent Decision Tables for MAT01 to Excel from Configure Rule-Based Workflow. Adjust the Single Value table and Non-User Agent table values as documented. Import the Excel files into the ZMAT
MDGIMGGeneral Settings > Process Modeling > Change Requests > Create Change Request Type
Copy MAT01 to custom change request type ZMAT01FU
MDGIMGGeneral Settings > Process Modeling > Workflow > Rule-Based Workflow > Define Change Request Steps for Rule-Based Workflow
Copy workflow steps from MAT01 to ZMAT01FU
MDGIMGGeneral Settings > Process Modeling > Workflow > Rule-Based Workflow > Configure Rule-Based Workflow > Define Service Names for Rule-Based Workflow
Define service name ZCREATE_FOLLOW_UP_CR for the synchronous system method
MDGIMGGeneral Settings > Process Modeling > Workflow > Rule-Based Workflow > Configure Rule-Based Workflow
Export, adjust, import, and activate the BRF+ decision tables for the custom CR type
SE18BAdI name USMD_SSW_SYSTEM_METHOD_CALLER
Create the BAdI implementation and copy the SAP sample implementation MDG_BS_MAT_CREATE_SUCCESSOR_CR
Referenced tables
| Object | Purpose |
|---|---|
MAT01 | Source standard material change request type copied into the custom follow-up scenario |
ZMAT01FU | Custom material change request type that triggers the follow-up CR |
DT_SINGLE_VAL_MAT01 | Source Single Value Decision Table exported and adapted for the custom CR type |
DT_USER_AGT_GRP_MAT01 | Source User Agent Decision Table exported and imported for the custom CR type |
DT_NON_USER_AGT_GRP_MAT01 | Source Non-User Agent Decision Table; add process pattern 02 and service name ZCREATE_FOLLOW_UP_CR |
USMD_SSW_SYSTEM_METHOD_CALLER | BAdI used to call the system method from Rule-Based Workflow |
USMD_SSW_SERVICE_PROCESSOR | Enhancement spot containing the workflow system-method BAdI |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: utilize_BAdI_rule_based_workflow_create_followup_change_request.abap
Exact relevant implementation excerpt from the knowledge document set.
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 SAP MDG automatically create a successor Change Request after a material request is activated?
- Which BAdI and BRF+ settings are needed for a follow-up Change Request in MDG-M?
- How do I implement
USMD_SSW_SYSTEM_METHOD_CALLERfor a follow-up Change Request?
Possible questions
- How do I configure the follow-up Change Request scenario in SAP MDG-M?
- Which BAdI is used for a synchronous system method in Rule-Based Workflow?
- What is the Service Name used for the follow-up CR example?
- Which decision table rows must be added for process pattern 02?
- Which SAP sample implementation is copied for successor Change Request creation?