SAP MDG · UTILITIES
How do I determine the MDG change-request step and step type from a work item?
Use `CL_USMD_WF_SERVICE=>GET_INSTANCE` and call `GET_CREQUEST_STEP` with the change request and work item ID. The method returns the MDG step and step type, plus messages; the work item must belong to the change request.
Use `CL_USMD_WF_SERVICE=>GET_INSTANCE` and call `GET_CREQUEST_STEP` with the change request and work item ID. The method returns the MDG step and step type, plus messages; the work item must belong to the change request.
The standard MDG API for this is `CL_USMD_WF_SERVICE=>GET_INSTANCE` followed by `GET_CREQUEST_STEP`. Pass the change request number and the work item ID, then read back the step and step type from the import parameters.
Process flow
- Create or obtain an instance of `CL_USMD_WF_SERVICE` using `GET_INSTANCE`.
- Pass the change request ID and work item ID to `GET_CREQUEST_STEP`.
- Import `ED_STEP` and `ED_STEP_TYPE` from the call.
- Inspect `ET_MESSAGE` for errors or warnings.
- Use the returned step type for downstream workflow or action logic.
Referenced tables
| Object | Purpose |
|---|---|
USMD2301 | Used in the mass-approval pattern to read action assignments for a workflow step type. |
USMD220T | Used in the mass-approval pattern to read action text in the current language. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1" Inputs: change request and work-item ID.
2" Confirm the exact signature in SE24/ADT for the target MDG release.
3DATA lv_crequest TYPE usmd_crequest. " Supply
4DATA lv_workitem_id TYPE sww_wiid. " Supply
5
6DATA(lo_wf_service) = cl_usmd_wf_service=>get_instance( ).
7lo_wf_service->get_crequest_step(
8 EXPORTING id_crequest = lv_crequest id_wi_id = lv_workitem_id
9 IMPORTING ed_step = DATA(lv_step) ed_step_type = DATA(lv_step_type)
10 et_message = DATA(lt_message) ).The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I get the current MDG step for a change request and work item?
- Which API returns the MDG step type for a CR/work item combination?
- How do I read available mass-approval actions based on the current MDG step type?
Possible questions
- How does the feeder determine available actions for each CR?
- How is the current workflow step type retrieved?
- Which customizing table determines actions for a step type?
- How are button texts determined?
- How do I validate that selected change requests have the same workflow actions?