SAP MDG · UTILITIES
How do I build reusable SAP MDG change request dashboard utilities for workflow reassignment, header enrichment, workflow diagnostics, validation messages, BP search, workflow rest
Use reusable ABAP utility methods around the MDG dashboard program ZMDG_CR_DASHBOARD and its helper class ZCL_CR_DASHBOARD_UTIL to handle workflow reassignment, CR header enrichment, diagnostics, validation-message reading, BP-based search, workflow restart, and generic entity reads.
Use reusable ABAP utility methods around the MDG dashboard program ZMDG_CR_DASHBOARD and its helper class ZCL_CR_DASHBOARD_UTIL to handle workflow reassignment, CR header enrichment, diagnostics, validation-message reading, BP-based search, workflow restart, and generic entity reads.
Build the dashboard as a set of reusable utility classes or methods, one per task, and call them from the ALV/UI layer. The source pack behind ZMDG_CR_DASHBOARD and ZCL_CR_DASHBOARD_UTIL splits the solution into eight reusable building blocks: workitem reassignment, CR header enrichment, replication status, workflow diagnostics, validation-message extraction, BP-to-CR search, workflow restart by event, and generic entity flattening. Each block has a clearly defined API/table pattern you can reuse in your own MDG monitor or dashboard.
Process flow
- Build a thin dashboard/UI shell in ZMDG_CR_DASHBOARD or a similar monitor program.
- Move each business capability into a separate reusable utility method.
- Use SAP_WAPI_FORWARD_WORKITEM for hotspot-based workitem reassignment.
- Use USMD120C, USMD130T, USMD110T, USR21, and ADR6 to enrich the CR header.
- Use USMD2400, SWWWIHEAD, and SWWUSERWI for workflow diagnostics.
- Use BAL_DB_SEARCH, BAL_DB_LOAD, and BAL_LOG_MSG_READ for validation messages.
- Use BUT000, CVI_*_LINK, USMD1213, and USMD120C for BP-to-CR search.
- Use SAP_WAPI_ADM_WORKFLOW_CANCEL, SAP_WAPI_WORKITEM_DELETE, and SAP_WAPI_CREATE_EVENT to restart stuck workflows by event.
Referenced tables
| Object | Purpose |
|---|---|
USMD120C | Change request header and CR metadata |
USMD130T | Language-dependent change request status text |
USMD110T | Language-dependent change request type text |
USR21 | User-to-address linkage for creator/contact enrichment |
ADR6 | E-mail address data |
DRFD_OBJ_REP_STA | Replication status information for DRF objects |
EDIDC | IDoc control data |
EDIDS | IDoc status data |
USMD2400 | Workflow-related CR data for diagnostics |
SWWWIHEAD | Workflow workitem header data |
SWWUSERWI | Workitem user assignment data |
BUT000 | Business partner master data for BP-based lookup |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: 01_Workitem_Reassignment_From_ALV_Hotspot.abap
Exact relevant implementation excerpt from the knowledge document set.
1*&---------------------------------------------------------------------*
2*& 01_Workitem_Reassignment_From_ALV_Hotspot
3*&---------------------------------------------------------------------*
4*& Reusable functionality:
5*& Reassign a workflow workitem from an ALV hotspot click.
6*&---------------------------------------------------------------------*
7CLASS lcl_event_receiver DEFINITION.
8 PUBLIC SECTION.
9 METHODS on_hotspot_click
10 FOR EVENT hotspot_click OF cl_gui_alv_grid
11 IMPORTING
12 !e_row_id
13 !es_row_no.
14ENDCLASS.
15
16CLASS lcl_event_receiver IMPLEMENTATION.
17 METHOD on_hotspot_click.
18 DATA: lv_to_user TYPE sy-uname,
19 lv_new_status TYPE swr_wistat,
20 lt_message TYPE TABLE OF swr_messag.
21
22 " 1) Resolve selected row into your workitem table.
23 READ TABLE gt_wi_tab INTO gs_wi_tab INDEX es_row_no-row_id.
24 IF sy-subrc <> 0.
25 RETURN.
26 ENDIF.
27
28 " 2) Ask user for target assignee.
29 CALL FUNCTION 'POPUP_TO_GET_VALUE'
30 EXPORTING
31 fieldname = 'BNAME'
32 tabname = 'USR21'
33 titel = 'Assign to user'
34 IMPORTING
35 valueout = lv_to_user.
36 IF sy-subrc <> 0 OR lv_to_user IS INITIAL.
37 RETURN.
38 ENDIF.
39
40 " 3) Forward the workitem to the selected user.
41 CALL FUNCTION 'SAP_WAPI_FORWARD_WORKITEM'
42 EXPORTING
43 workitem_id = gs_wi_tab-workitem_id
44 user_id = lv_to_user
45 IMPORTING
46 new_status = lv_new_status
47 TABLES
48 message_lines = lt_message.
49
50 " 4) Show outcome.
51 READ TABLE lt_message INTO DATA(ls_message) WITH KEY msg_type = 'E'.
52 IF sy-subrc = 0.
53 MESSAGE ls_message-line TYPE 'E'.
54 ELSE.
55 MESSAGE 'User updated' TYPE 'S'.
56 ENDIF.
57 ENDMETHOD.
58ENDCLASS.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I implement reusable SAP MDG dashboard building blocks for change requests?
- What are the reusable ABAP patterns for an MDG CR dashboard?
- How do I code generic utilities for SAP MDG change request monitoring?
Possible questions
- How do I reassign a workflow work item from an ALV hotspot in SAP MDG?
- How can I read and enrich an MDG change request header with status and creator data?
- How do I build workflow diagnostics for an MDG change request?
- How do I read validation messages from the application log for a change request?
- How do I search change requests by business partner in SAP MDG?
- How do I restart a stuck MDG workflow by event?
- How do I read and flatten entity data from an MDG model?