SAP MDG · DATA MODEL UI
How do I implement a new reuse entity type in SAP MDG for Material and persist it to a custom table?
Extend data model MM with a Type 4 reuse entity under MATERIAL, map it to your custom active-area table with SMT in both directions, and implement IF_MDG_BS_MAT_API_SEGMENTS_EXT for read/save logic. Then add a custom FPM list UIBB to the Material OVP and adjust linked change requests after activation.
Extend data model MM with a Type 4 reuse entity under MATERIAL, map it to your custom active-area table with SMT in both directions, and implement IF_MDG_BS_MAT_API_SEGMENTS_EXT for read/save logic. Then add a custom FPM list UIBB to the Material OVP and adjust linked change requests after activation.
Extend MDG-M in data model MM by creating a new reuse entity type, then map the entity to your active-area persistence with Service Mapping Tool in both directions. For the example in the guide, the custom persistence is handled through BAdI IF_MDG_BS_MAT_API_SEGMENTS_EXT, especially methods READ and CHECK_AND_SAVE, and the Material UI is extended with a custom FPM list UIBB in the Material OVP.
Process flow
- Log on to a system/client that allows cross-client maintenance.
- Start transaction
MDGIMG. - Navigate to General Settings -> Configuration Workbench.
- Select data model MM and choose Edit.
- Create the new entity type as Storage and Use Type 4 - Changeable via Other Entity Type.
- Leave the reuse area blank so MATERIAL is inherited from the model.
- Maintain the leading and supporting relationships.
- Activate the data model and save the generated structures/regeneration prompts as required by your release. Created on activation if supported by your release, otherwise regenerate manually according to your system procedure. Create SMT in/
Referenced tables
| Object | Purpose |
|---|---|
YMDGM_BUPA00 | Example custom active-area table used to persist the reuse entity data after activation. |
ILLUSTRATIVE ABAP SAMPLE
Example READ implementation for IF_MDG_BS_MAT_API_SEGMENTS_EXT
Source-supported pattern from the guide: read custom active-area rows into ET_DATA using the selection ranges.
1METHOD if_mdg_bs_mat_api_segments_ext~read.
2 DATA: lt_mdgm_bupa TYPE ymdgm_bupa01_t.
3
4 CLEAR: et_data, et_message.
5
6 SELECT *
7 FROM ymdgm_bupa00
8 INTO CORRESPONDING FIELDS OF TABLE lt_mdgm_bupa
9 WHERE matnr IN is_selection-matnr_range
10 AND bupa_id IN is_selection-bupa_id_range.
11
12 INSERT LINES OF lt_mdgm_bupa INTO TABLE et_data.
13ENDMETHOD.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I extend MDG-M with a new reuse entity type?
- How do I read and save a custom MDG-M segment with IF_MDG_BS_MAT_API_SEGMENTS_EXT?
- How do I configure the Material UI for a custom reuse entity type?
Possible questions
- How do I implement a new reuse entity type in SAP MDG for Material and persist it to a custom table?
- Which BAdI and methods are used for custom segment persistence in MDG-M?
- What is the IMG path for extending data model MM with a custom entity?
- How do I add the custom entity to the Material OVP UI?
- How do I map a custom MDG-M entity to a customer active-area table?