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

  1. Get the MDG model instance with `CL_USMD_MODEL_EXT=>GET_INSTANCE`.
  2. Use `IF_USMD_MODEL~READ_CHAR_VALUE` to identify the master-data key.
  3. Retrieve the related Change Request with `IF_USMD_CREQUEST_API~RETRIEVE_CREQUEST`.
  4. Find workflow items with `CL_USMD4_CREQUEST_PROTOCOL=>WORKITEMS_TO_OBJECT`.
  5. Read the selected work-item details with `GET_WORKITEM_DETAIL`.
  6. Read the workflow container with `READ_CONTAINER` and extract `ACTION_RESULT`.
  7. Validate return codes and filter for dialog work items and relevant steps.

Referenced tables

ObjectPurpose
USMD220TChange Request action text descriptions.
USMD220CChange Request action result descriptions.
USMD_TS_CREQUESTReturn 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?

Keywords

SAP MDGapproval informationapproverworkflow historyChange RequestMDG-FData Model 0GREAD_CHAR_VALUECL_USMD_MODEL_EXTRETRIEVE_CREQUESTCL_USMD_CREQUEST_APICL_USMD4_CREQUEST_PROTOCOLWORKITEMS_TO_OBJECTGET_WORKITEM_DETAILREAD_CONTAINERBUS2250WI_AAGENTWI_AA_NAMEACTION_RESULTUSMD_TS_CREQUESTUSMD220TUSMD220C