SAP MDG · WORKFLOWS
How do you implement flexible user determination with BAdI USMD_SSW_DYNAMIC_AGENT_SELECT in MDG workflow?
Use enhancement spot USMD_SSW_SERVICE_PROCESSOR with method IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS. The documented example is MDG_BS_MAT_SELECT_AGENT in class CL_MDG_BS_MAT_SELECT_AGENT, with private helper READ_MATERIAL for material-based routing.
Use enhancement spot USMD_SSW_SERVICE_PROCESSOR with method IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS. The documented example is MDG_BS_MAT_SELECT_AGENT in class CL_MDG_BS_MAT_SELECT_AGENT, with private helper READ_MATERIAL for material-based routing.
Use BAdI USMD_SSW_DYNAMIC_AGENT_SELECT when MDG workflow approvers must be selected at runtime instead of only by static decision tables. The documented enhancement spot is USMD_SSW_SERVICE_PROCESSOR, and the interface method to implement is IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS. The guide’s example implementation is MDG_BS_MAT_SELECT_AGENT in class CL_MDG_BS_MAT_SELECT_AGENT, with a private helper method READ_MATERIAL for retrieving the business data that drives the agent selection.
Process flow
- Create or reuse a BAdI implementation under enhancement spot
USMD_SSW_SERVICE_PROCESSOR. - Implement IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS.
- Read the change request context and service name.
- Load the business data needed for routing, such as material data in the documented example.
- Determine the approver logic from the business content.
- Populate the workflow agent group structures.
- Set or adjust cv_new_step and cv_new_cr_status only when the workflow branch must change.
- Test the request with an inactive CR and verify the resulting work items.
Referenced tables
| Object | Purpose |
|---|---|
USMD_SSW_* workflow agent structures | Workflow agent group structures used by dynamic agent determination, including user and non-user agent groups. |
USMD120C | Request header data used in MDG workflow processing. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1*---------------------------------------------------------------------*
2* Flexible User Determination Using BAdI USMD_SSW_DYNAMIC_AGENT_SELECT
3*---------------------------------------------------------------------*
4
5* Enhancement Spot
6* USMD_SSW_SERVICE_PROCESSOR
7
8* Interface Method
9* IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS
10
11* Example implementation referenced by the guide:
12* MDG_BS_MAT_SELECT_AGENT
13
14* Implementing class:
15* CL_MDG_BS_MAT_SELECT_AGENT
16
17* Private helper method:
18* READ_MATERIAL
19
20* NOTE:
21* The PDF does NOT contain the implementation source code.
22* It only references the above enhancement, class and methods.
23* Therefore no additional ABAP source is present in the document.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- What is the MDG BAdI for dynamic agent selection?
- Which enhancement spot and method are used for flexible agent determination in MDG?
- How do I route MDG workflow approvers dynamically at runtime?
Possible questions
- How do I implement flexible user determination with BAdI
USMD_SSW_DYNAMIC_AGENT_SELECTin MDG workflow? - What is the MDG BAdI for dynamic agent selection?
- Which enhancement spot and method are used for flexible agent determination in MDG?
- How do I route MDG workflow approvers dynamically at runtime?
- How do I adapt the dynamic agent logic for material change requests?