SAP MDG · DATA MODEL UI
How do I extend the SAP MDG Material user interface with custom fields, SPI data, dropdown restrictions, and derived UI logic?
Extend the Material data model in MDGIMG, regenerate the required MDG structures, clear UI metadata buffers, and adapt the Web Dynpro/FPM UI by enhancing the feeder, SPI metadata, or field-definition logic depending on whether the field is stored in MM or is transient/flex data.
Extend the Material data model in MDGIMG, regenerate the required MDG structures, clear UI metadata buffers, and adapt the Web Dynpro/FPM UI by enhancing the feeder, SPI metadata, or field-definition logic depending on whether the field is stored in MM or is transient/flex data.
SAP MDG Material UI extension depends on where the data must live. For fields stored in data model MM, extend the reuse entity, generate the mapping/field-property structures, maintain SMT mapping, and then clear the UI metadata buffers. For data that should remain local to MDG, use a Flex entity or SPI enhancement. The standard Material UI runs in MDG_BS_MAT_OVP with configurations such as BS_MAT_OVP_xx, and the List UIBB commonly uses feeder class CL_MDG_BS_MAT_FEEDER_LIST.
Process flow
- Decide whether the data is stored in MM, transient SPI data, or a Flex entity.
- If it is a reuse field, extend the relevant entity in MDGIMG and save/activate the model.
- Generate the data model-specific mapping and field-property structures.
- Maintain SMT mapping for reuse fields where the data must sync between staging and active areas.
- Run Adjust Staging Area of Linked Change Requests if existing requests are affected.
- Clear UI metadata buffers when the UI still shows old metadata.
- Adapt BS_MAT_OVP_xx and the relevant UIBB if the field must appear on the UI.
- For SPI nodes, implement /PLMB/ES_SPI methods ENRICH_NODE_DEFINITION, BEFORE_RETRIEVE, and AFTER_RETRIEVE as needed.
Referenced tables
| Object | Purpose |
|---|---|
MDG_BS_MAT_MAP_2PP | SMT mapping from staging to active area for Material reuse fields. |
MDG_BS_MAT_MAP_2STA | Reverse SMT mapping from active to staging area for Material reuse fields. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example
Exact relevant implementation excerpt from the knowledge document.
1*---------------------------------------------------------------------*
2* Source: Extend Master Data Governance Material User Interface
3* Version 4.0 - August 2024
4* Contents: ABAP examples and code fragments only
5*---------------------------------------------------------------------*
6
7*---------------------------------------------------------------------*
8* TAG: SPI_METADATA_ENRICH_NODE_DEFINITION
9* Enhancement spot: /PLMB/ES_SPI
10* BAdI: /PLMB/EX_SPI_METADATA
11* Method: /PLMB/IF_EX_SPI_METADATA~ENRICH_NODE_DEFINITION
12*---------------------------------------------------------------------*
13DATA: ls_node LIKE LINE OF ct_metadata_node.
14
15READ TABLE ct_metadata_node
16 INTO ls_node
17 WITH KEY name = 'MARA'.
18IF sy-subrc IS INITIAL.
19
20 ls_node-name = 'YYCUSTOM'.
21 ls_node-name_parent = 'MARA'.
22 ls_node-transient = abap_true.
23 ls_node-data_struc = 'YCUSTOM_STR'.
24 ls_node-update_relevant = abap_false.
25 ls_node-supported_operation_group = 06.
26 CLEAR: ls_node-data_description,
27 ls_node-actions[],
28 ls_node-update_sideeffect.
29 ls_node-supported_properties-fields-insert = abap_false.
30 ls_node-supported_properties-fields-transient_data_record = abap_true.
31
32 INSERT ls_node INTO TABLE ct_metadata_node.
33
34ENDIF.
35
36*---------------------------------------------------------------------*
37* TAG: SPI_BEFORE_RETRIEVE
38* Method: /PLMB/IF_EX_SPI_APPL_ACCESS~BEFORE_RETRIEVE
39*---------------------------------------------------------------------*
40IF iv_node_name = 'YYCUSTOM'.
41 cv_skip_standard = abap_true.
42ENDIF.
43
44*---------------------------------------------------------------------*
45* TAG: SPI_AFTER_RETRIEVE
46* Method: /PLMB/IF_EX_SPI_APPL_ACCESS~AFTER_RETRIEVE
47*---------------------------------------------------------------------*
48DATA: ls_values TYPE YCUSTOM_STR,
49 ls_node_id TYPE matnr,
50 lt_values TYPE ycustom_delta_tt,
51 lr_values TYPE REF TO YCUSTOM_STR.
52
53IF iv_node_name = 'YYCUSTOM'.
54 READ TABLE it_node_id INDEX 1 INTO ls_node_id.
55 ls_values-matnr = '1'.
56 ls_values-name = 'NAME1'.
57 ls_values-value = 'VALUE1'.
58 APPEND ls_values TO lt_values.
59 INSERT LINES OF lt_values INTO TABLE ct_node_data.
60ENDIF.
61
62*---------------------------------------------------------------------*
63* TAG: ENABLE_T130F_HIDE
64* Method: CL_MDG_BS_MAT_ASSIST->SET_HIDDEN_IND_IF_POSSIBLE
65*---------------------------------------------------------------------*
66CV_SET_HIDD_IND_IF_POSSIBL = ABAP_TRUE.
67
68*---------------------------------------------------------------------*
69* TAG: SPI_ACTION_CANCEL
70*---------------------------------------------------------------------*
71CASE io_event->mv_event_id.
72 WHEN cl_fpm_event=>gc_event_cancel.
73 TRY.
74 mo_application_model->action(
75 EXPORTING
76 iv_node_name = cl_mdg_bs_mat_c=>gc_node_name_mat
77 iv_action_name = cl_mdg_bs_mat_c=>gc_action_rollback
78 is_param = abap_true ).
79 CATCH /plmb/cx_spi_error INTO lo_exc.
80 BREAK-POINT ID mdg_bs_mat_ui.
81 ENDTRY.
82ENDCASE.
83
84*---------------------------------------------------------------------*
85* TAG: RESTRICT_DROPDOWN_VALUES
86* Method: /PLMU/IF_FRW_G_FIELD_DEF~CHANGE_FIELD_DEFINITION
87*---------------------------------------------------------------------*
88METHOD /PLMU/IF_FRW_G_FIELD_DEF~CHANGE_FIELD_DEFINITION.
89
90 CALL METHOD SUPER->/PLMU/IF_FRW_G_FIELD_DEF~CHANGE_FIELD_DEFINITION
91 CHANGING
92 CO_CATALOGUE = co_catalogue
93 CT_DEFINITION = ct_definition.
94
95 DATA:
96 ls_nvp TYPE WDR_CONTEXT_ATTR_VALUE,
97 lv_name TYPE name_komp,
98 lv_is_segm_ent TYPE boole_d.
99
100 FIELD-SYMBOLS:
101 <ls_definition> TYPE /plmu/s_frw_g_field_descr_appl.
102
103 LOOP AT ct_definition ASSIGNING <ls_definition>.
104
105 lv_name = <ls_definition>-name.
106 IF lv_name EQ 'WERKS'.
107* See example coding in chapter
108* Example Coding to build up Value List for Dropdown List and Value Help
109 lv_is_segm_ent = 'X'.
110 ls_nvp-value = 'custom'.
111 ls_nvp-text = 'custom'.
112 APPEND ls_nvp TO <ls_definition>-fixed_values.
113 ENDIF.
114
115 ENDLOOP.
116
117ENDMETHOD.
118
119*---------------------------------------------------------------------*
120* TAG: OVS_FIELD_DEFINITIONThe remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I add custom fields to the SAP MDG Material UI?
- How do I implement SPI metadata and retrieval for custom MDG Material nodes?
- How do I restrict dropdown values and implement OVS in MDG Material?
Possible questions
- Which BAdI or enhancement spot is used for SPI metadata in MDG Material?
- Which feeder class is used for the Material List UIBB?
- How do I clear UI metadata buffers after a model change?
- How do I derive MATNR during create in SAP MDG Material?
- Which methods are used for OVS phases 0 to 3 in MDG Material?