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

  1. Open SE18 and display BAdI definition USMD_RULE_SERVICE.
  2. Review interface IF_EX_USMD_RULE_SERVICE and check whether the BAdI is filter-dependent.
  3. Open SE19 and create the BAdI implementation.
  4. Assign the implementation class and activate it.
  5. Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY for defaulting and enrichment.
  6. Gate the logic by ID_ENTITYTYPE and read the context once.
  7. Loop over CT_DATA and update only initial target fields.
  8. Test empty, prefilled, and partial data cases to confirm no overwrite and no dynamic-assign dump.

Referenced tables

ObjectPurpose
ZMDG_SUP_CC_DERVReferenced 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_SERVICE for 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?

Keywords

SAP MDGUSMD_RULE_SERVICEIF_EX_USMD_RULE_SERVICEDERIVE_ENTITYSE18SE19Business PartnersupplierdefaultingenrichmentCT_DATAID_ENTITYTYPEZCL_BP_COMPNY_DER_VALZCL_MDGBP_BP_VALIDATION