SAP MDG · VALIDATION DERIVATION
How do I implement DERIVE_ENTITY in SAP MDG for BP entity defaulting and enrichment?
Implement DERIVE_ENTITY as a deterministic defaulting/enrichment step, not as hard validation. Route by CR type and entity type, read context once, and fill only initial fields in CT_DATA using safe ASSIGN COMPONENT logic; keep mandatory checks in CHECK_ENTITY.
Implement DERIVE_ENTITY as a deterministic defaulting/enrichment step, not as hard validation. Route by CR type and entity type, read context once, and fill only initial fields in CT_DATA using safe ASSIGN COMPONENT logic; keep mandatory checks in CHECK_ENTITY.
Implement `DERIVE_ENTITY` as a safe, deterministic defaulting layer: resolve the CR context once, route by entity type, and fill only initial target fields in `CT_DATA`. In the analyzed MDG BP solution, the derivation flow is split into `D_BP_CENTRL`, `D_BP_PORG`, `D_AD_POSTAL`, `D_BP_BUDET`, and company-specific enrichment in `D_BP_COMPNY`, with messages merged through `ET_MESSAGE`.
Process flow
- Open the BAdI definition in SE18 and confirm the interface and methods.
- Create or open the implementation in SE19 and assign the implementing class.
- Implement `IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY` as an orchestrator.
- Read CR context and driver attributes once before looping `CT_DATA`.
- Route by entity type (`BP_CENTRL`, `BP_COMPNY`, `BP_PORG`, `AD_POSTAL`, `BP_BUDET`).
- For each row, use `ASSIGN COMPONENT ...` and write only if the target field is initial.
- Use customizing such as `ZMDG_SUP_CC_DERV` for company/country-dependent defaults.
- Keep blocking validations in `CHECK_ENTITY` and merge `ET_MESSAGE` only for informational output.
Referenced tables
| Object | Purpose |
|---|---|
ZMDG_SUP_CC_DERV | Customizing table used for company and country-dependent derivation such as reconciliation, payment method, tolerance, and related defaults. |
T024E | Used in the documented purchasing-org derivation to map company-level payment terms to purchasing organization values. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How should DERIVE_ENTITY be structured for SAP MDG Business Partner scenarios?
- What is the recommended pattern for DERIVE_ENTITY in
USMD_RULE_SERVICE? - How do I default BP_CENTRL, BP_PORG, AD_POSTAL, BP_COMPNY, and BP_BUDET data in MDG?
Possible questions
- How do I implement DERIVE_ENTITY in SAP MDG for BP entity defaulting and enrichment?
- Which fields should be filled in DERIVE_ENTITY versus CHECK_ENTITY?
- How do I make DERIVE_ENTITY idempotent and safe in MDG?
- How should I route derivation by CR type and entity type?
- How do I implement company-code and country-dependent defaults in MDG?
- How do I debug why DERIVE_ENTITY is not populating CT_DATA?