SAP MDG · VALIDATION DERIVATION
How do I implement SAP MDG USMD_RULE_SERVICE CHECK_ENTITY validation with field navigation and message normalization?
Implement the MDG validation in IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY as a thin orchestrator: read the application context first, validate only the relevant entity and CR branch, collect messages locally with FIELDNAME and key values, then enrich navigation with GET_MESSAGE_ROW_ID and normalize severities with ADJUST_MESSAGES.
Implement the MDG validation in IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY as a thin orchestrator: read the application context first, validate only the relevant entity and CR branch, collect messages locally with FIELDNAME and key values, then enrich navigation with GET_MESSAGE_ROW_ID and normalize severities with ADJUST_MESSAGES.
Implement USMD_RULE_SERVICE validation in two layers: keep CHECK_ENTITY as the orchestrator, and move atomic checks into focused rule methods or helper classes. Read CR context early, validate only the entity and step/process branch you own, build messages with FIELDNAME and key-based MSGV1 for row navigation, then post-process messages with GET_MESSAGE_ROW_ID and ADJUST_MESSAGES.
Process flow
- Open SE18 and display the BAdI definition
USMD_RULE_SERVICE. - Confirm the interface name IF_EX_USMD_RULE_SERVICE and whether the BAdI is filter-dependent.
- Open SE19 and create the BAdI implementation.
- Assign the implementing Z* class and activate the class skeleton.
- Implement IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY.
- Read application context first and gate by entity type, CR type, step, and process.
- Loop over IT_DATA and validate the required field(s) using ASSIGN COMPONENT.
- Build messages in a local table, set FIELDNAME and MSGV1, then append to ET_MESSAGE once per rule block.
Referenced tables
| Object | Purpose |
|---|---|
USMD_S_MESSAGE | Message row structure used for validation output fields such as MSGTY, MSGID, MSGNO, MSGV1, and FIELDNAME. |
USMD_TS_MESSAGE | Message table type used to return collected CHECK_ENTITY messages to the framework. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I build a CHECK_ENTITY validation in MDG BP?
- How do I add field-level error navigation in
USMD_RULE_SERVICECHECK_ENTITY? - How should I structure validation logic in IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY?
Possible questions
- How do I implement a CHECK_ENTITY validation for an MDG business partner entity?
- How do I create a BAdI implementation for
USMD_RULE_SERVICEin SAP MDG? - How do I set FIELDNAME and MSGV1 so CHECK_ENTITY messages navigate to the right row?
- How do I centralize message normalization after CHECK_ENTITY validations?
- How do I adapt CHECK_ENTITY for an orchestrator class with helper methods?