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

  1. Open SE18 and display the BAdI definition USMD_RULE_SERVICE.
  2. Confirm the interface name IF_EX_USMD_RULE_SERVICE and whether the BAdI is filter-dependent.
  3. Open SE19 and create the BAdI implementation.
  4. Assign the implementing Z* class and activate the class skeleton.
  5. Implement IF_EX_USMD_RULE_SERVICE~CHECK_ENTITY.
  6. Read application context first and gate by entity type, CR type, step, and process.
  7. Loop over IT_DATA and validate the required field(s) using ASSIGN COMPONENT.
  8. Build messages in a local table, set FIELDNAME and MSGV1, then append to ET_MESSAGE once per rule block.

Referenced tables

ObjectPurpose
USMD_S_MESSAGEMessage row structure used for validation output fields such as MSGTY, MSGID, MSGNO, MSGV1, and FIELDNAME.
USMD_TS_MESSAGEMessage 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_SERVICE CHECK_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_SERVICE in 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?

Keywords

SAP MDGUSMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICECHECK_ENTITYET_MESSAGEFIELDNAMEMSGV1GET_MESSAGE_ROW_IDADJUST_MESSAGESSE18SE19TVARVCmessage normalizationfield navigation