SAP MDG · VALIDATION DERIVATION

How do I implement USMD_RULE_SERVICE~DERIVE_ENTITY for SAP MDG entity defaulting and derivation?

Implement BAdI USMD_RULE_SERVICE, method DERIVE_ENTITY of IF_EX_USMD_RULE_SERVICE, to default or derive non-key entity fields after the entity key is entered. The method enriches CT_DATA in place and should be used for population/defaulting, not hard validation.

Implement BAdI USMD_RULE_SERVICE, method DERIVE_ENTITY of IF_EX_USMD_RULE_SERVICE, to default or derive non-key entity fields after the entity key is entered. The method enriches CT_DATA in place and should be used for population/defaulting, not hard validation.

Use `USMD_RULE_SERVICE~DERIVE_ENTITY` when you want MDG to default or derive entity data after the key is available. The method updates `CT_DATA` in place, so it is suited for non-key field population based on CR context, related entity values, or customizing lookups.

Process flow

  1. Open SE18 and display BAdI USMD_RULE_SERVICE.
  2. Confirm interface IF_EX_USMD_RULE_SERVICE and whether filter values are required.
  3. Create the implementation in SE19 and assign the implementing class.
  4. Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY.
  5. Derive only non-key fields and only when the target field is initial.
  6. Activate the class and BAdI implementation.
  7. Trigger a UI roundtrip in MDG to execute derivation.
  8. Inspect saved inactive/active data with USMD_DATA_MODEL in SE38 if needed.

Referenced tables

ObjectPurpose
USMD_DATA_MODELReport used to inspect MDG staging tables and data flow after save or activation.

The remaining configuration, implementation details, and testing guidance continue from this answer more…

Related questions and keywords

Alternative questions

  • How do I implement DERIVE_ENTITY in BAdI USMD_RULE_SERVICE?
  • How can I default MDG entity fields with DERIVE_ENTITY?
  • What is the ABAP pattern for USMD_RULE_SERVICE~DERIVE_ENTITY?

Possible questions

  • Which BAdI method should I use for entity defaulting in SAP MDG?
  • Can DERIVE_ENTITY set key fields?
  • When is USMD_RULE_SERVICE~DERIVE_ENTITY called?
  • How do I create the BAdI implementation in SE19?
  • How do I test whether derivation filled CT_DATA correctly?

Keywords

USMD_RULE_SERVICEDERIVE_ENTITYIF_EX_USMD_RULE_SERVICECT_DATAET_MESSAGESE18SE19USMD_DATA_MODELdefaultingderivation