SAP MDG · VALIDATION DERIVATION
How do I implement SAP MDG DERIVE_ENTITY logic in a BAdI class for Business Partner or supplier derivation?
Use BAdI USMD_RULE_SERVICE and implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for deterministic defaulting/enrichment only. In the analyzed BP solution, active derivation exists in ZCL_BP_COMPNY_DER_VAL and ZCL_MDGBP_BP_VALIDATION; placeholder or empty classes do not contain usable derive logic.
Use BAdI USMD_RULE_SERVICE and implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for deterministic defaulting/enrichment only. In the analyzed BP solution, active derivation exists in ZCL_BP_COMPNY_DER_VAL and ZCL_MDGBP_BP_VALIDATION; placeholder or empty classes do not contain usable derive logic.
Implement the BAdI in SE18/SE19 for USMD_RULE_SERVICE, assign the implementation class, and code IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY as a deterministic defaulting routine. Gate the logic by ID_ENTITYTYPE, read the MDG context once, loop over CT_DATA, and populate only initial fields so user-entered values are preserved.
Process flow
- Open SE18 and display BAdI definition
USMD_RULE_SERVICE. - Review interface IF_EX_USMD_RULE_SERVICE and check whether the BAdI is filter-dependent.
- Open SE19 and create the BAdI implementation.
- Assign the implementation class and activate it.
- Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for defaulting and enrichment.
- Gate the logic by ID_ENTITYTYPE and read the context once.
- Loop over CT_DATA and update only initial target fields.
- Test empty, prefilled, and partial data cases to confirm no overwrite and no dynamic-assign dump.
Referenced tables
| Object | Purpose |
|---|---|
ZMDG_SUP_CC_DERV | Referenced in the derivation knowledge as an example customizing table for company/country-related defaulting. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How do I set up
USMD_RULE_SERVICEfor derivation in MDG? - What is the implementation pattern for IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY?
- How do I default fields in MDG BP derivation without overwriting user input?
Possible questions
- How do I implement SAP MDG DERIVE_ENTITY logic in a BAdI class for Business Partner or supplier derivation?
- What is the standard implementation pattern for IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY?
- Which MDG classes use active derivation and which are placeholders?
- How do I create a BAdI implementation from SE18/SE19 for
USMD_RULE_SERVICE? - How do I safely default fields only when initial in MDG derivation?