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

  1. Create or reuse a BAdI implementation under enhancement spot USMD_SSW_SERVICE_PROCESSOR.
  2. Implement IF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTS.
  3. Read the change request context and service name.
  4. Load the business data needed for routing, such as material data in the documented example.
  5. Determine the approver logic from the business content.
  6. Populate the workflow agent group structures.
  7. Set or adjust cv_new_step and cv_new_cr_status only when the workflow branch must change.
  8. Test the request with an inactive CR and verify the resulting work items.

Referenced tables

ObjectPurpose
USMD_SSW_* workflow agent structuresWorkflow agent group structures used by dynamic agent determination, including user and non-user agent groups.
USMD120CRequest 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_SELECT in 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?

Keywords

USMD_SSW_DYNAMIC_AGENT_SELECTIF_USMD_SSW_DYNAMIC_AGT_SELECT~GET_DYNAMIC_AGENTSUSMD_SSW_SERVICE_PROCESSORMDG_BS_MAT_SELECT_AGENTCL_MDG_BS_MAT_SELECT_AGENTREAD_MATERIALMDG workflowdynamic agentBRF+change request