SAP MDG · DATA MODEL UI
How do I add a new reuse entity type to SAP MDG for Material and persist its data in a custom active-area table?
Extend data model MM with a Type 4 reuse entity, create the customer active-area table and segment structures, implement MDG_BS_MAT_API_SEGMENTS_EXT for read/save/delete logic, generate the model-specific structures, maintain SMT mappings in both directions, and add the entity to the Material overview page with an FPM List UIBB.
Extend data model MM with a Type 4 reuse entity, create the customer active-area table and segment structures, implement MDG_BS_MAT_API_SEGMENTS_EXT for read/save/delete logic, generate the model-specific structures, maintain SMT mappings in both directions, and add the entity to the Material overview page with an FPM List UIBB.
To extend SAP MDG for Material with a new reuse entity type, first create the customer active-area table and segment DDIC objects, then add the entity to data model MM as Storage and Use Type 4 with a leading relationship to MATERIAL and a qualifying relationship to a supporting Type 3 entity. Next, implement MDG_BS_MAT_API_SEGMENTS_EXT for read/save/delete behavior, generate the model-specific staging structures, maintain the SMT mappings in both directions, and finally add the entity to the Material overview page using an FPM List UIBB...
Process flow
- Create the active-area customer table and segment DDIC objects in SE11.
- Append `MDG_BS_MAT_S_MAT_DATA` and, from MDG 9.0 onward, `CMD_BS_MAT_S_MAT_DATA`.
- Implement BAdI `MDG_BS_MAT_API_SEGMENTS_EXT` for read, validation, save, and delete processing.
- Maintain the new entity type in data model `MM` in MDGIMG with Storage and Use Type 4.
- Regenerate model-specific structures after the data-model change.
- Create SMT mappings `Z_MAP_YBUPA00_2STA` and `Z_MAP_YBUPA00_2PP`.
- Adjust open linked Change Requests where needed.
- Add the custom FPM List UIBB to `BS_MAT_OVP_LAYOUT` under `MAT_SECTION`.
SE11Dictionary: create `YMDGM_BUPA00`, `YMDGM_BUPA01_S`, `YMDGM_BUPA01_T`, `YMDGM_BUPA01_S_X`, `YMDGM_BUPA01_T_X`
Define the active-area table, segment structures, and sorted table types for the new reuse entity type.
MDGIMGMaster Data Governance > General Settings > Data Modeling > Edit Data Model
Add entity type `YBUPA01` to data model `MM`, with supporting Type 3 entity `YBUPA` and the correct storage/use and relationships.
MDGIMGMDG Material API segment enhancement customizing
Create and activate BAdI implementation `MDG_BS_MAT_API_SEGMENTS_EXT`.
MDGIMGService Mapping Tool mappings for the new segment
Maintain `Z_MAP_YBUPA00_2STA` and `Z_MAP_YBUPA00_2PP`.
Referenced tables
| Object | Purpose |
|---|---|
YMDGM_BUPA00 | Customer active-area database table for the persisted Business Partner Details data. |
YMDGM_BUPA01_T | Sorted table type for the customer segment data. |
YMDGM_BUPA01_T_X | Sorted table type for the change information including deletion rows. |
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 implement a reuse entity type in MDG-M data model MM?
- How do I extend MDG Material with a custom entity type and FPM list UIBB?
- How do I store custom MDG-M entity data in a customer table after activation?
Possible questions
- What business requirement does the new reuse entity type solve in MDG-M?
- Why is Storage and Use Type 4 used for the new entity?
- Which DDIC objects are required for the customer segment?
- How is MDG_BS_MAT_API_SEGMENTS_EXT implemented?
- What SMT mappings are needed for active-to-staging and staging-to-active?
- How is the Material UI extended with a list UIBB?
- How do I test create, update, delete, and activation for the new entity?