SAP MDG · VALIDATION DERIVATION
How do I implement entity-level defaulting/derivation in SAP MDG using BAdI USMD_RULE_SERVICE and method DERIVE_ENTITY?
Use BAdI USMD_RULE_SERVICE with interface IF_EX_USMD_RULE_SERVICE and method DERIVE_ENTITY to default non-key entity fields by changing CT_DATA rows in place, typically after key entry and only when the target field is initial.
Use BAdI USMD_RULE_SERVICE with interface IF_EX_USMD_RULE_SERVICE and method DERIVE_ENTITY to default non-key entity fields by changing CT_DATA rows in place, typically after key entry and only when the target field is initial.
Use BAdI `USMD_RULE_SERVICE` with interface `IF_EX_USMD_RULE_SERVICE` when you want MDG to derive or default non-key entity fields after key entry. In `DERIVE_ENTITY`, you change `CT_DATA` in place, usually after checking `ID_ENTITYTYPE` and, if needed, CR context from `CL_USMD_APP_CONTEXT`. For derivation, return informational messages only; business errors belong in `CHECK_ENTITY`.
Process flow
- Open SE18 and display BAdI
USMD_RULE_SERVICE. - Confirm the interface is IF_EX_USMD_RULE_SERVICE and whether a filter is required.
- Create or open the implementation in SE19.
- Assign the Z class and activate it.
- Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY.
- Gate the logic by ID_ENTITYTYPE.
- Loop over CT_DATA and default only initial target fields.
- Activate and test the MDG change request flow.
SE18BAdI definition USMD_RULE_SERVICE
Validate the BAdI definition and confirm the interface and method intent before coding.
SE19Classic BAdI implementation for USMD_RULE_SERVICE
Create the implementation, assign the class, and maintain any required data-model filter.
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I default non-key fields in an MDG entity after key entry?
- What is the SAP MDG BAdI for entity derivation?
- How do I implement
USMD_RULE_SERVICE~DERIVE_ENTITY in ABAP?
Possible questions
- Which BAdI and method are used for MDG entity derivation?
- What is the difference between DERIVE_ENTITY and CHECK_ENTITY?
- How do I register
USMD_RULE_SERVICEin SE19? - Can DERIVE_ENTITY change key fields?
- How do I read CR context in MDG derivation?
- What is the recommended ABAP pattern for defaulting fields in CT_DATA?