SAP MDG · UTILITIES
How do I retrieve approval, approver, workflow, and decision information for an SAP MDG Change Request?
Use SAP MDG standard APIs to trace a master-data object to its Change Request, then read workflow work items, approver details, and container data. The source pattern starts with `CL_USMD_MODEL_EXT=>GET_INSTANCE`, uses `IF_USMD_MODEL~READ_CHAR_VALUE` to find the object key, `IF_USMD_CREQUEST_API~RETRIEVE_CREQUEST` to get the Change Request, and `CL_USMD4_CREQUEST_PROTOCOL` to read workflow items, approver, and approval decision.
Use SAP MDG standard APIs to trace a master-data object to its Change Request, then read workflow work items, approver details, and container data. The source pattern starts with `CL_USMD_MODEL_EXT=>GET_INSTANCE`, uses `IF_USMD_MODEL~READ_CHAR_VALUE` to find the object key, `IF_USMD_CREQUEST_API~RETRIEVE_CREQUEST` to get the Change Request, and `CL_USMD4_CREQUEST_PROTOCOL` to read workflow items, approver, and approval decision.
This MDG pattern retrieves approval information in a standard way: first identify the master-data object key, then retrieve the related Change Request, then read workflow work items and their container values. In the supplied example, the object is a G/L Account in data model `0G`, but the same approach can be adapted to another MDG object by replacing the data model, entity, and key fields.
Process flow
- Get the MDG model instance with `CL_USMD_MODEL_EXT=>GET_INSTANCE`.
- Use `IF_USMD_MODEL~READ_CHAR_VALUE` to identify the master-data key.
- Retrieve the related Change Request with `IF_USMD_CREQUEST_API~RETRIEVE_CREQUEST`.
- Find workflow items with `CL_USMD4_CREQUEST_PROTOCOL=>WORKITEMS_TO_OBJECT`.
- Read the selected work-item details with `GET_WORKITEM_DETAIL`.
- Read the workflow container with `READ_CONTAINER` and extract `ACTION_RESULT`.
- Validate return codes and filter for dialog work items and relevant steps.
Referenced tables
| Object | Purpose |
|---|---|
USMD220T | Change Request action text descriptions. |
USMD220C | Change Request action result descriptions. |
USMD_TS_CREQUEST | Return table for retrieved Change Requests. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I read approver and approval decision details from an MDG Change Request?
- Which SAP MDG APIs return workflow and approval information for a Change Request?
- How do I get the work items and container values for an MDG approval workflow?
Possible questions
- How can I analyze Change Requests and workflow steps together?
- How do I retrieve the approver user and approval result for an MDG workflow item?
- What standard MDG APIs should I use instead of reading workflow runtime tables directly?
- How do I adapt the approval retrieval flow from G/L Account data model 0G to another MDG object?
- What is the sequence to go from master data key to Change Request to work-item details?