Indu Learning Platform
Course/Unit 1 · MDG from the engine room
Lesson 1-3

Change requests and rule-based workflow

What actually happens between Submit and Activate: change request types, the generic workflow template, the three BRFplus decision tables and the BAdIs that make agents dynamic.

Watch firstWF Configuring Rule Based Workflows || SAP MDG · Sastrageek Solutions Open on YouTube ↗

From a click to the rules

A change request (CR) is the container for one governance case; its header lives in USMD120C. The CR type defines data model, main entity, UI and workflow (MDGIMG → General Settings → Process Modeling → Change Requests). A business activity links the user's intent (create, change, mark for deletion) to the right CR type.

User actionCreate supplierBusiness activitycreate / changeCR typeZSUP01Workflow templateWS60800086Decision tablesBRFplus
From a click in the UI to the rules that control every step.

One generic template, many processes

Rule-based workflow uses one template, WS60800086, that loops: "step done with this action, what next?" BRFplus decision tables per CR type answer. The template never changes and the process lives in readable data, but it is spread over rows nobody sees as a graph until you draw it.

RequesterMDG workflowBRFplusApproverActive areaSubmit CR (step 00 done)Step 00 + action: next?Next step 01, agent group FINWork item in inboxApproveStep 01 + approve: next?Step 90: system step activateActivate dataNext step 99: complete
The workflow asks, BRFplus answers, people act.

The three decision tables

USMD_SSW_RULE opens three tables per CR type. Single value (DT_SINGLE_VAL_<CR type>): previous step + action → next step and CR status. User agent (DT_USER_AGT_GRP_<CR type>): who works a person's step. Non-user agent (DT_NON_USER_AGT_GRP_<CR type>): which service a system step calls, such as activation. A condition alias links them.

Prev. stepActionCond. aliasNew stepNew CR status00Submit101To be approved01Approve290Final check approved01Reject302To be revised02Resubmit101To be approved90Activated99Final, activated90Activation failed402Activation failed
Simplified single value table. Real tables show codes and more columns.

Try it: name the tables

Try it · Fill the blanks

Complete the description of rule-based workflow configuration.

Open the tables for a CR type with . The  table maps previous step + action to the next step. People's steps get agents from the  table; system steps such as activation are set in the  table. A  links the rows.

Reading the step graph

Each single value row is an arrow from (step, action) to the next step. Walk the graph built from the table above.

Step through · 1 of 5
Step 00requester submitsStep 01FIN approverStep 02requester revisesStep 90activation (system)Step 99complete
Submit looks up row 1: go to step 01 with condition alias 1.
Click through the graph.

When rows are not enough: BAdIs

When the answer depends on data in the CR (approver by plant or purchasing org), rows explode. Use a BAdI instead, and read its interface in SE18 on your release before coding.

ABAP
METHOD if_usmd_ssw_dynamic_agt_select~get_dynamic_agents.
  " Called for a step whose decision table row asks for dynamic agents.
  " 1. Read the CR number and step from the importing parameters
  " 2. Read the CR's entity data (e.g. MARCBASIC for the plant)
  "    through the MDG model API, from staging
  " 3. Look up approvers in a custom table ZMDG_APPROVER by plant
  " 4. Append them to the agent table (user or org object)
  " 5. If nothing is found, return a fallback group, never empty
ENDMETHOD.

Outline only. Check the interface and signature in SE18.

Try it: which BAdI?

Try it · Match

Match each BAdI to what it is for.

Pick an item on the left, then its match on the right.

Rows or code?

Decision table rowsFew, stable agent groupsConditions on CR type, priority or stepFunctional team must maintain itTransportable, readable in BRFplusBAdI implementationAgents depend on CR data (plant, org)Lookup in custom tables or servicesMany combinations, rows would explodeNeeds ABAP, unit tests and code reviewvs
Start with rows; move to code when the rule depends on CR data.

Debugging a stuck change request

Work outside in: CR status and log in the MDG UI, then the workflow log (SWI1) to see the step, agents and any system-step error, then the decision table row for that step and action, then agent tables and BAdI code. The same order makes a good prompt: give an assistant the status, log extract and table export.

CR status & logMDG UIWorkflow logSWI1 / SWIASingle value tableUSMD_SSW_RULEAgent tablesuser / non-userBAdI codeSE18 / SE24Root cause
Status, log, rules, agents, code.

Try it: stuck for one plant only

Try it · What would you do?

Material creation CRs work for every plant except a newly onboarded plant 3000: after Submit, nobody gets a work item. The single value table rows look fine. Approvers come from the dynamic agent BAdI. What do you check?

Remember

  • CR type, business activity and the generic template WS60800086 connect a user action to the rules.
  • The single value, user agent and non-user agent tables drive every step; read the first as an edge list to find missing paths.
  • Data-dependent approvers come from the dynamic agent BAdI, not from more and more rows.

Check yourself

Activation at the end of a CR is configured in which decision table?
The approver depends on the plant entered in the CR. Best approach?
After a rejection the CR disappears from all inboxes and nothing happens. Most likely cause?
Which object links a row in the single value table to its agents?