SAP MDG · DATA MODEL UI

How do I extend SAP MDG for Material with a custom-defined field using the Reuse Option?

Extend data model MM in MDGIMG, add the attribute to entity MARASALES, regenerate/adjust the required backend and UI structures, maintain SMT mappings in both directions, then run Adjust Staging Area of Linked Change Requests and Clear UI Metadata Buffers. Add the field to the Material FPM UI and, if needed for search, enhance the MDG_MATERIAL and MATERIAL enterprise-search templates.

Extend data model MM in MDGIMG, add the attribute to entity MARASALES, regenerate/adjust the required backend and UI structures, maintain SMT mappings in both directions, then run Adjust Staging Area of Linked Change Requests and Clear UI Metadata Buffers. Add the field to the Material FPM UI and, if needed for search, enhance the MDG_MATERIAL and MATERIAL enterprise-search templates.

Extend SAP MDG for Material by adding the custom field to the reuse entity in data model `MM`, then synchronize staging and active data through SMT mappings. The example in the source uses backend field `ZZ9_PRODUCT_CATEGRY` in `MARA` and MDG attribute `ZZCATEGRY` in entity `MARASALES`, with reuse area `MATERIAL` and access class `CL_MDG_BS_MAT_ACCESS`.

Process flow

  1. Extend backend table `MARA` with the custom field `ZZ9_PRODUCT_CATEGRY`.
  2. Maintain Material field-selection customizing in `SPRO` under Logistics - General > Material Master > Field Selection > Assign Fields to Field Selection Groups.
  3. Extend `MDG_BS_MAT_S_MARA`, `CMD_BS_MAT_S_MARA`, `MDG_BS_MAT_S_MARA_UI`, `CMD_BS_MAT_S_MARA_UI`, and the corresponding `_X` structures in `SE11`.
  4. If on SAP S/4HANA 2023 or later, verify `PMD_S_*` structures for custom-field support used by `CL_CMD_PROD_DATA_API`.
  5. In `MDGIMG`, open General Settings > Data Modeling > Edit Data Model and add attribute `ZZCATEGRY` to entity type `MARASALES` in data model `MM`.
  6. Activate the data model and verify the generated staging structure with report `USMD_DATA_MODEL`.
  7. Maintain `MDG_BS_MAT_MAP_2PP` for staging-to-active mapping and `MDG_BS_MAT_MAP_2STA` for active-to-staging mapping.
  8. Run `Adjust Staging Area of Linked Change Requests` for open change requests after the model change when needed, then execute `Clear UI Metadata Buffers`. Add the field to the Material FPM UI in configuration `MDG_BS_MAT_MARA_SALES_06`, and
SPRO

Logistics - General > Material Master > Field Selection > Assign Fields to Field Selection Groups

Allow and control the custom Material field in field-selection customizing.

Structure
SPRO
Master Data Governance
Logistics - General
Material Master
Field Selection
Assign Fields to Field Selection Groups
SE11

DDIC maintenance for `MDG_BS_MAT_S_MARA`, `CMD_BS_MAT_S_MARA`, `MDG_BS_MAT_S_MARA_UI`, `CMD_BS_MAT_S_MARA_UI`, and related `_X` structures

Extend the backend, UI, and change-indicator structures with the custom field.

MDGIMG

General Settings > Data Modeling > Edit Data Model

Add attribute `ZZCATEGRY` to entity type `MARASALES` in data model `MM` and activate the model.

Structure
MDGIMG
Master Data Governance
Classic Mode in SAP MDG
Central Governance
General Settings
Data Modeling
Edit Data Model
MDGIMG

General Settings > Data Modeling > Extend Mappings > Extend Mappings

Maintain SMT mappings `MDG_BS_MAT_MAP_2PP` and `MDG_BS_MAT_MAP_2STA`.

Structure
MDGIMG
Master Data Governance
Classic Mode in SAP MDG
Central Governance
General Settings
Data Modeling
Extend Mappings
MDGIMG

General Settings > Data Modeling > Edit Data Model > Adjust Staging Area of Linked Change Requests

Realign open change requests after the data model change.

Structure
MDGIMG
Master Data Governance
General Settings
Data Modeling
Edit Data Model
Adjust Staging Area of Linked Change Requests
MDGIMG

General Settings > Central Governance for Material > Clear UI Metadata Buffers

Clear cached UI metadata so the new field appears in the Material UI.

Structure
MDGIMG
Master Data Governance
Classic Mode in SAP MDG
Central Governance
Central Governance for Material
Clear UI Metadata Buffers

Referenced tables

ObjectPurpose
MARABackend Material table that receives the custom field in the reuse-option scenario.
MDG_BS_MAT_S_MARAMDG Material staging/backend structure that must support the custom field.
CMD_BS_MAT_S_MARACommand/Product structure that must support the custom field.
MDG_BS_MAT_S_MARA_UIMaterial UI field-control structure that may require a manual append.
CMD_BS_MAT_S_MARA_UIProduct UI field-control structure that may require a manual append.
MDG_BS_MAT_S_MARA_XChange-indicator structure that must be checked for the custom field.
CMD_BS_MAT_S_MARA_XProduct change-indicator structure that may require extension or include handling.
PMD_S_*Unified Product API structures to verify in SAP S/4HANA 2023 and later.
MDG_MATERIALEnterprise Search template for the staging area when the field is search-relevant.
MATERIALEnterprise Search template for the active area when the field is search-relevant.

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 Z-field to MDG Material data model MM?
  • How do I map a custom MARA field into MDG-M?
  • What are the steps to extend MDG for Material reuse entities with a custom field?

Possible questions

  • What is the reuse option in SAP MDG for Material?
  • Which structures must be extended for a custom MARA field in MDG-M?
  • How do I maintain SMT mappings for a custom MDG-M field?
  • Why must UI metadata buffers be cleared after a model change?
  • Which FPM configuration is used to add a custom field to MDG Material?
  • Which enterprise search templates should be enhanced for a search-relevant field?

Keywords

SAP MDG-MData Model MMReuse OptionMATERIALCL_MDG_BS_MAT_ACCESSMARAMARASALESZZ9_PRODUCT_CATEGRYZZCATEGRYMDG_BS_MAT_S_MARACMD_BS_MAT_S_MARAMDG_BS_MAT_S_MARA_UICMD_BS_MAT_S_MARA_UI_X structuresCL_CMD_PROD_DATA_APIPMD_S_*MDGIMGSMTMDG_BS_MAT_MAP_2PPMDG_BS_MAT_MAP_2STAUSMD_DATA_MODELMDG_BS_MAT_MARA_SALES_06ROUNDTRIPMDG_MATERIALMATERIAL