SAP MDG · DATA MODEL UI
How do I extend SAP MDG for Material with a custom field or new entity in data model MM?
Extend data model MM in MDGIMG, create or enhance the reuse entity, regenerate model-specific structures, maintain SMT mappings in both directions, adjust linked change requests, and update the Material OVP UI with a custom List UIBB if needed. For reuse-option scenarios, activated data is written back to existing ERP tables such as MARC; for flex scenarios, data remains in MDG-generated active tables.
Extend data model MM in MDGIMG, create or enhance the reuse entity, regenerate model-specific structures, maintain SMT mappings in both directions, adjust linked change requests, and update the Material OVP UI with a custom List UIBB if needed. For reuse-option scenarios, activated data is written back to existing ERP tables such as MARC; for flex scenarios, data remains in MDG-generated active tables.
Extend SAP MDG for Material in data model MM by adding the required entity type or custom field, regenerating the model-specific structures, and maintaining Service Mapping Tool mappings between staging and active persistence. For reuse-option scenarios, the example entity YMARC1 is used under MATERIAL with a leading 1:N relationship, and values are transferred to MARC after activation.
Process flow
- Open `MDGIMG`.
- Go to `General Settings -> Configuration Workbench` and select data model `MM`.
- Create or extend the entity type, for example `YMARC1`, with Type 4 and inherit reuse area `MATERIAL`.
- Add the required attributes such as `LVORM`, `XCHAR`, `DISMM`, `DISPO`, and `DISLS`, plus supporting Type 3 entities if needed.
- Activate the data model and save the generated model-specific structures.
- Create SMT mappings `Z_MAP_YMARC1_2PP` and `Z_MAP_YMARC1_2STA` and assign them to entity `YMARC1`.
- Run `Adjust staging area of linked change requests`.
- If required, copy `FPM_LIST_UIBB_TEMPLATE`, use `CL_MDG_BS_MAT_FEEDER_LIST`, and add the list to `BS_MAT_OVP_LAYOUT` via context-based adaptation and `/PLMU/CL_FRW_W_CONN_DEFAULT`.
MDGIMGGeneral Settings -> Configuration Workbench
Maintain data model `MM`, create or extend entity types, activate the model, and generate model-specific structures.
MDGIMGGeneral Settings -> Data Modeling -> Edit Data Model
Create entity types, relationships, and mappings in data model `MM`.
MDGIMGGeneral Settings -> Data Modeling -> Generate Data Model Specific Structures
Generate or regenerate model-specific structures after model changes.
SM34View cluster `VC_USMD001`
Alternative access to the MDG data model configuration.
Material OVP layout configuration via context-based adaptation
Add or adapt the custom List UIBB for Material.
Referenced tables
| Object | Purpose |
|---|---|
MARC | Active ERP table used in the reuse-option example for plant data. |
MARA | Example backend table for the custom field reuse-option scenario. |
TRNSPACET | Used to check existing registered namespaces for generated structures. |
TRNSPACEL | Used to check existing registered namespaces for generated structures. |
ILLUSTRATIVE ABAP SAMPLE
Source ABAP example: Extend_MDG_M_New_Reuse_Entity_Type.abap
Exact relevant implementation excerpt from the knowledge document set.
1*---------------------------------------------------------------------*
2* <SOURCE_DOCUMENT>
3* Extend MDG-M by a New Reuse Entity Type
4* Version 9.1 - July 2026
5* </SOURCE_DOCUMENT>
6*---------------------------------------------------------------------*
7
8*---------------------------------------------------------------------*
9* <BADI_IMPLEMENTATION>
10* <INTERFACE>IF_MDG_BS_MAT_API_SEGMENTS_EXT</INTERFACE>
11* <METHOD>READ</METHOD>
12*---------------------------------------------------------------------*
13METHOD if_mdg_bs_mat_api_segments_ext~read.
14 DATA: lt_mdgm_bupa TYPE ymdgm_bupa01_t.
15
16 CLEAR: et_data, et_message.
17
18 SELECT *
19 FROM ymdgm_bupa00
20 INTO CORRESPONDING FIELDS OF TABLE lt_mdgm_bupa
21 WHERE matnr IN is_selection-matnr_range
22 AND bupa_id IN is_selection-bupa_id_range.
23
24 INSERT LINES OF lt_mdgm_bupa INTO TABLE et_data.
25ENDMETHOD.
26* </BADI_IMPLEMENTATION>
27
28*---------------------------------------------------------------------*
29* <BADI_IMPLEMENTATION>
30* <INTERFACE>IF_MDG_BS_MAT_API_SEGMENTS_EXT</INTERFACE>
31* <METHOD>CHECK_AND_SAVE</METHOD>
32*---------------------------------------------------------------------*
33METHOD if_mdg_bs_mat_api_segments_ext~check_and_save.
34
35 DATA: ls_data TYPE ymdgm_bupa01_s.
36 DATA: ls_data_x TYPE ymdgm_bupa01_s_x.
37 DATA: ls_message TYPE mdg_bs_mat_s_mat_msg.
38 DATA: lt_modify TYPE STANDARD TABLE OF ymdgm_bupa00.
39 DATA: ls_modify TYPE ymdgm_bupa00.
40 DATA: lt_delete TYPE STANDARD TABLE OF ymdgm_bupa00.
41 DATA: ls_delete TYPE ymdgm_bupa00.
42
43 CLEAR et_message.
44
45 " First some checks
46 LOOP AT is_data-ymdgm_bupa00_tab INTO ls_data.
47 " All fields must be filled, otherwise
48 " MESSAGE e000(00) WITH ls_data-matnr
49 " ls_data-bupa_id
50 " ls_data-nickname.
51 IF ls_data-matnr IS INITIAL
52 OR ls_data-bupa_id IS INITIAL
53 OR ls_data-nickname IS INITIAL.
54
55 ls_message-msgid = '00'.
56 ls_message-msgno = '000'.
57 ls_message-msgty = 'E'.
58
59 ls_message-msgv1 = 'Empty value detected in:'.
60 ls_message-msgv2 = ls_data-matnr.
61 ls_message-msgv3 = ls_data-bupa_id.
62 ls_message-msgv4 = ls_data-nickname.
63
64 INSERT ls_message INTO TABLE et_message.
65 ENDIF.
66
67 " BuPa must exist
68 " ...
69 ENDLOOP.
70
71 " In test mode, we're finished now
72 CHECK iv_test_mode = abap_false.
73
74 " Determine which records to delete or to insert/update
75 LOOP AT is_data-ymdgm_bupa00_x_tab INTO ls_data_x.
76 IF ls_data_x-delete_row = abap_true.
77 " Keep key fields for deletion
78 ls_delete-matnr = ls_data_x-matnr.
79 ls_delete-bupa_id = ls_data_x-bupa_id.
80 INSERT ls_delete INTO TABLE lt_delete.
81 ELSE.
82 READ TABLE is_data-ymdgm_bupa00_tab INTO ls_data
83 WITH TABLE KEY matnr =
84* <SOURCE_TRUNCATED_AT_THIS_POINT />The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I add a custom field to MDG Material using the reuse option?
- How do I create a new Material entity type in MDG data model MM?
- How do I map MDG staging data to MARC after activation?
Possible questions
- What is the Flex Option in SAP MDG?
- When should a Flex Entity be used?
- Why is SMT Mapping not required?
- How do you generate MDG structures?
- Which feeder class is used for the List UIBB?
- How do you clear UI metadata buffers?