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
- Inspect the BAdI definition in SE18 for
USMD_RULE_SERVICEand confirm interface IF_EX_USMD_RULE_SERVICE. - Create the implementation in SE19 and assign a Z* implementation class.
- Implement IF_EX_USMD_RULE_SERVICE in the class and activate the class.
- Code DERIVE_ENTITY as deterministic defaulting/enrichment logic only.
- Route logic by ID_ENTITYTYPE and CR context, and only fill initial fields.
- Move blocking validation into CHECK_ENTITY if business errors are required.
- 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?