SAP MDG · DATA MODEL UI
How do you configure and implement MDG Material validation and derivation rules in BRF+?
Use MDG-M validation/derivation rules in `MDGIMG -> General Settings -> Data Quality and Search -> Define Validation and Derivation Rules` (`USMD_RULE`). For simple entity logic, use BRF+ with `CHECK_<entity>` / `DERIVE_<entity>` naming; for cross-entity derivation, use `USMD_RULE_SERVICE_CROSS_ET` or a BRF+ procedure call pattern with `CL_USMD_RULE_SERVICE=>GET_ATTR_VALUE` and a post-exit on `IF_USMD_CONV_SOM_GOV_ENTITY~WRITE_ENTITY_DATA`.
Use MDG-M validation/derivation rules in `MDGIMG -> General Settings -> Data Quality and Search -> Define Validation and Derivation Rules` (`USMD_RULE`). For simple entity logic, use BRF+ with `CHECK_<entity>` / `DERIVE_<entity>` naming; for cross-entity derivation, use `USMD_RULE_SERVICE_CROSS_ET` or a BRF+ procedure call pattern with `CL_USMD_RULE_SERVICE=>GET_ATTR_VALUE` and a post-exit on `IF_USMD_CONV_SOM_GOV_ENTITY~WRITE_ENTITY_DATA`.
MDG for Material supports several ways to validate and derive values: model-driven checks, backend Material API checks, MDG Data Quality Management, BRF+, `USMD_RULE_SERVICE`, `USMD_RULE_SERVICE_CROSS_ET`, `MDG_BS_MAT_API_ENRICH_BADI`, and SMT mapping. Checks usually run during Check, Run Validation, Save, Submit, and Activate, while derivations generally run on roundtrips. For BRF+ rules, the standard customizing entry point is `MDGIMG -> General Settings -> Data Quality and Search -> Define Validation and Derivation Rules`.
Process flow
- Open `MDGIMG -> General Settings -> Data Quality and Search -> Define Validation and Derivation Rules`.
- Select data model `MM` in `
USMD_RULE`. - Create the BRF+ function using the MDG naming convention, such as `CHECK_<entity>` or `DERIVE_<entity>`.
- Add the relevant entity data object to the function context.
- Create and activate the ruleset and rule conditions.
- Maintain the message or derivation action.
- For cross-entity derivation, add `ATTRIBUTE_VALUE_01` and table variable `TABLE_OF_KEY_VALUES` of type `
USMD_T_ATTR_VALUE`. - Use `CL_USMD_RULE_SERVICE=>GET_ATTR_VALUE` or `CHECK_ATTR_VALUE` to read the source attribute from `MARCBASIC`.','Create a post-exit on `IF_USMD_CONV_SOM_GOV_ENTITY~WRITE_ENTITY_DATA` of `CL_USMD_CONV_SOM_GOV_API` if source changes must re-
MDGIMGGeneral Settings -> Data Quality and Search -> Define Validation and Derivation Rules
Maintain BRF+ validation and derivation rules for MDG Material.
Master Data Governance -> General Settings -> Data Modeling -> Edit Data Model
Maintain the MM data model, field properties, required fields, and related model-driven checks.
OMT4Material message severity configuration
Control supported Material API message severities in MDG-M.
Referenced tables
| Object | Purpose |
|---|---|
T130F | Material-master field-selection and required-field settings that influence MDG checks. |
USMD_T_ATTR_VALUE | Table type used for source-entity key/value selection in cross-entity BRF+ derivation. |
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 are check and derivation rules maintained in SAP MDG for Material?
- How do BRF+ validation and derivation rules work in MDG-M?
- Which objects are used for MDG Material checks and derivations?
Possible questions
- What are checks and derivations in SAP MDG for Material?
- When are validation checks executed in MDG-M?
- When are derivation rules executed?
- What message severities are supported for checks?
- What message severity is supported for derivations?
- How can I implement a cross-entity derivation in MDG Material?
- How can MRP Type and MRP Group be derived from Plant-Specific Material Status?