SAP MDG · VALIDATION DERIVATION

How do I implement SAP MDG derivation in IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for a BAdI class?

Implement the USMD_RULE_SERVICE BAdI in SE19, assign an ABAP class that implements IF_EX_USMD_RULE_SERVICE, and place defaulting logic in DERIVE_ENTITY only for initial fields. Use CR-type and entity-type checks to route the logic, keep hard validation in CHECK_ENTITY, and append only informational messages if needed.

Implement the USMD_RULE_SERVICE BAdI in SE19, assign an ABAP class that implements IF_EX_USMD_RULE_SERVICE, and place defaulting logic in DERIVE_ENTITY only for initial fields. Use CR-type and entity-type checks to route the logic, keep hard validation in CHECK_ENTITY, and append only informational messages if needed.

From the retrieved implementation guide and derivation patterns: first inspect the BAdI definition in SE18, then create the implementation in SE19 and bind an implementing class that supports IF_EX_USMD_RULE_SERVICE. In DERIVE_ENTITY, keep the method as deterministic defaulting/enrichment only, route by CR type and entity type, and avoid heavy error handling there. The recommended pattern is to read context once, loop CT_DATA safely with ASSIGN COMPONENT, and set fields only when they are initial.

Process flow

  1. Inspect the BAdI definition in SE18 for USMD_RULE_SERVICE and confirm interface IF_EX_USMD_RULE_SERVICE.
  2. Create the implementation in SE19 and assign a Z* implementation class.
  3. Implement IF_EX_USMD_RULE_SERVICE in the class and activate the class.
  4. Code DERIVE_ENTITY as deterministic defaulting/enrichment logic only.
  5. Route logic by ID_ENTITYTYPE and CR context, and only fill initial fields.
  6. Move blocking validation into CHECK_ENTITY if business errors are required.
  7. Test with breakpoints in the BAdI implementation and verify CT_DATA updates and context values.

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

Related questions and keywords

Alternative questions

  • How do I activate and code a MDG rule-service BAdI derivation method?
  • What is the step-by-step process to implement DERIVE_ENTITY in USMD_RULE_SERVICE?
  • How do I add CR-type-based defaulting logic in IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY?

Possible questions

  • How do I implement SAP MDG derivation in IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for a BAdI class?
  • How do I activate and code a MDG rule-service BAdI derivation method?
  • What is the step-by-step process to implement DERIVE_ENTITY in USMD_RULE_SERVICE?
  • How do I add CR-type-based defaulting logic in IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY?
  • How do I route derivation by entity type and change request type in MDG?

Keywords

SAP MDGUSMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICEDERIVE_ENTITYSE18SE19CT_DATAET_MESSAGECR typedefaultingderivation