SAP MDG · VALIDATION DERIVATION

How do I implement SAP MDG validation or derivation in the BAdI USMD_RULE_SERVICE from SE18 and SE19?

Implement the BAdI in SE18/SE19 by identifying the interface and filter settings first, then create the implementation, assign an ABAP class, and code CHECK_ENTITY for validation messages and DERIVE_ENTITY for safe defaulting. Keep messages in ET_MESSAGE with MSGID, MSGNO, MSGTY, and FIELDNAME, and derive only initial fields in CT_DATA.

Implement the BAdI in SE18/SE19 by identifying the interface and filter settings first, then create the implementation, assign an ABAP class, and code CHECK_ENTITY for validation messages and DERIVE_ENTITY for safe defaulting. Keep messages in ET_MESSAGE with MSGID, MSGNO, MSGTY, and FIELDNAME, and derive only initial fields in CT_DATA.

Use SE18 first to confirm the interface, filter dependency, and method intent for USMD_RULE_SERVICE, then create the implementation in SE19 and assign a Z* class. In CHECK_ENTITY, return business errors or warnings in ET_MESSAGE with proper message fields; in DERIVE_ENTITY, only fill empty target fields and keep the logic deterministic.

Process flow

  1. Open SE18 and inspect the BAdI definition `USMD_RULE_SERVICE`.
  2. Confirm the interface name `IF_EX_USMD_RULE_SERVICE`, filter dependency, and use type.
  3. Open SE19 and create the BAdI implementation in Z* namespace.
  4. Maintain filter values if the BAdI is filter-dependent.
  5. Assign or create the implementing class and implement `IF_EX_USMD_RULE_SERVICE`.
  6. Code `CHECK_ENTITY` for validations and `DERIVE_ENTITY` for defaulting.
  7. Activate the class, then the BAdI implementation, then dependent objects.
  8. Test by triggering the business scenario and debugging the interface methods.
SE18

BAdI definition display

Check the interface name, multiple-use/single-use setting, filter dependency, and method intent before implementation.

SE19

BAdI implementation creation

Create the implementation, assign package and transport, and maintain filter values if the BAdI is filter-dependent.

Referenced tables

ObjectPurpose
usmd_s_messageMessage structure used to return validation messages from CHECK_ENTITY.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How do I create a USMD_RULE_SERVICE BAdI implementation?
  • How do I write CHECK_ENTITY and DERIVE_ENTITY in SAP MDG?
  • What is the step-by-step process to implement an MDG rule-service BAdI?

Possible questions

  • How do I create a USMD_RULE_SERVICE BAdI implementation?
  • How do I write CHECK_ENTITY and DERIVE_ENTITY in SAP MDG?
  • What is the step-by-step process to implement an MDG rule-service BAdI?
  • What is the correct way to populate ET_MESSAGE in CHECK_ENTITY?
  • How do I default fields safely in DERIVE_ENTITY?

Keywords

USMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICESE18SE19CHECK_ENTITYDERIVE_ENTITYET_MESSAGECT_DATACL_USMD_APP_CONTEXTusmd_s_messageFIELDNAMEMSGIDMSGNOMSGTY