SAP MDG · WORKFLOWS

How do I implement the SAP MDG dynamic agent BAdI for workflow-driven change request processing?

Implement USMD_SSW_DYNAMIC_AGENT_SELECT in a filtered BAdI class, gate on iv_service_name from DT_SINGLE_VAL, read inactive CR data, determine the responsible users or roles, and return them in ct_user_agent_group so the workflow can create the dialog work items.

Implement USMD_SSW_DYNAMIC_AGENT_SELECT in a filtered BAdI class, gate on iv_service_name from DT_SINGLE_VAL, read inactive CR data, determine the responsible users or roles, and return them in ct_user_agent_group so the workflow can create the dialog work items.

SAP MDG dynamic agent determination is driven from the rule-based workflow, not called manually. A transition row in `DT_SINGLE_VAL_<CR>` can carry `DYNAMIC_AGT_SEL_SERVICE`; when the CR reaches that step, `WS60800086` calls `USMD_SSW_DYNAMIC_AGENT_SELECT -> GET_DYNAMIC_AGENTS` with `iv_service_name`, `iv_cr_number`, and the new step. The implementation should gate on the service name, derive the responsible users or roles from the CR data and your rules, and return them in `ct_user_agent_group`.

Process flow

  1. Maintain the dynamic-agent service name in `DT_SINGLE_VAL_<CR>` under `DYNAMIC_AGT_SEL_SERVICE`.
  2. Keep the dialog step definition in `DT_USER_AGT_GRP_<CR>` so the step type and fallback remain available.
  3. Implement `IF_BADI_INTERFACE` and `IF_USMD_SSW_DYNAMIC_AGT_SELECT` in a Z class.
  4. Inside `GET_DYNAMIC_AGENTS`, check `iv_service_name` and exit early for unrelated services.
  5. Read the change request header and inactive CR data to derive CR type, requestor, and routing key fields.
  6. Look up the responsible role or user assignments in your custom agent-determination table.
  7. Populate `ct_user_agent_group` with users or roles, and apply four-eye filtering when required.
  8. Register and activate the implementation in `SE19` for the relevant model/filter.
SE19

BAdI implementation for `USMD_SSW_DYNAMIC_AGENT_SELECT`

Create and activate the dynamic-agent BAdI implementation and assign the model filter

WS60800086

MDG rule-based workflow template

Workflow that calls the dynamic-agent BAdI at runtime

Referenced tables

ObjectPurpose
DT_SINGLE_VAL_<CR>Transition table that can carry `DYNAMIC_AGT_SEL_SERVICE` and determines the next step, status, and agent-selection service
DT_USER_AGT_GRP_<CR>Dialog-step agent table that defines step type and static fallback agents or roles
DT_NON_USER_AGT_GRP_<CR>Automatic-step agent/process-pattern table, including optional service name for system-method steps

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

Related questions and keywords

Alternative questions

  • How is MDG dynamic agent determination wired from the BRF+ decision table to the BAdI?
  • Which BAdI and method are used for dynamic agents in SAP MDG workflow?
  • How do I configure and code dynamic agent selection for an MDG dialog step?

Possible questions

  • How does DT_SINGLE_VAL trigger dynamic agent selection in MDG?
  • What is the interface and method signature of USMD_SSW_DYNAMIC_AGENT_SELECT?
  • How do I pass a Dyn Agt Sel Service from BRF+ to the BAdI?
  • How do I implement four-eye logic in MDG dynamic agent determination?
  • How do I register a dynamic agent BAdI implementation in SE19?
  • Which service names are used in the M4Q dynamic agent examples?

Keywords

SAP MDGdynamic agentUSMD_SSW_DYNAMIC_AGENT_SELECTIF_USMD_SSW_DYNAMIC_AGT_SELECTGET_DYNAMIC_AGENTSWS60800086DT_SINGLE_VALDT_USER_AGT_GRPDYNAMIC_AGT_SEL_SERVICESE19BRF+ workflow