SAP MDG · WORKFLOWS
How do I implement MDG dynamic agent determination with USMD_SSW_DYNAMIC_AGENT_SELECT for rule-based workflow steps?
Implement the dynamic agent BAdI `USMD_SSW_DYNAMIC_AGENT_SELECT` in class `IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS`, gate the logic by `iv_service_name`, read inactive CR data, determine the routing org unit or scenario, fill `ct_user_agent_group`, and apply four-eye or special routing such as activation-failure handling.
Implement the dynamic agent BAdI `USMD_SSW_DYNAMIC_AGENT_SELECT` in class `IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS`, gate the logic by `iv_service_name`, read inactive CR data, determine the routing org unit or scenario, fill `ct_user_agent_group`, and apply four-eye or special routing such as activation-failure handling.
The MDG rule-based workflow calls the dynamic-agent BAdI at runtime when a decision-table transition carries a Dyn Agt Sel Service. Your implementation must inspect `iv_service_name`, read the change request’s inactive data, determine the correct approver set, and return them in `ct_user_agent_group` so the workflow can create the dialog work items.
Process flow
- Create the BAdI implementation in `SE19` for `
USMD_SSW_DYNAMIC_AGENT_SELECT` with the correct model filter. - Implement `IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS` in the class.
- Gate the logic by `iv_service_name` so only owned services are processed.
- Read the CR header and inactive CR data from the MDG model.
- Determine the routing attribute such as company code, division, plant, grouping, or scenario.
- Select roles or users from a custom agent-determination table or other source.
- Populate `ct_user_agent_group` and, if needed, `ct_non_user_agent_group`.
- Apply four-eye filtering by removing the requestor and any disallowed previous processor entries after role expansion or user selection.
SE19Enhancement Spot `USMD_SSW_DYNAMIC_AGENT_SELECT`
Create and activate the dynamic-agent BAdI implementation with the relevant MDG model filter.
Referenced tables
| Object | Purpose |
|---|---|
USMD_SSW_DYNAMIC_AGENT_SELECT | BAdI for dynamic agent selection in MDG rule-based workflow. |
DT_SINGLE_VAL_<CR> | Workflow transition table that can pass `DYNAMIC_AGT_SEL_SERVICE` to the BAdI. |
DT_USER_AGT_GRP_<CR> | Static user-agent fallback and step-type definition for dialog steps. |
USMD_S_USER_AGENT_GROUP | Workflow agent group structure used in `ct_user_agent_group`. |
USMD_S_USER_AGENT | Single user/role agent entry with `user_type` and `user_value`. |
AGR_USERS | Standard table used to expand business roles to valid users. |
USMD120C | CR header data used for request-related routing information. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I wire a dynamic agent BAdI into MDG rule-based workflow?
- How do I determine approvers at runtime in MDG workflow?
- How do I implement GET_DYNAMIC_AGENTS for an MDG change request?
Possible questions
- Which BAdI is used for MDG dynamic agent selection?
- What service name is passed from DT_SINGLE_VAL to the dynamic agent BAdI?
- How do I exclude the requestor from MDG approvers?
- How do I route an activation failure to the last processor in MDG?
- What are the main configuration tables for MDG dynamic agents?