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
- Open SE18 and display BAdI
USMD_RULE_SERVICE. - Confirm interface IF_EX_USMD_RULE_SERVICE and whether filter values are required.
- Create the implementation in SE19 and assign the implementing class.
- Implement IF_EX_USMD_RULE_SERVICE~DERIVE_ENTITY.
- Derive only non-key fields and only when the target field is initial.
- Activate the class and BAdI implementation.
- Trigger a UI roundtrip in MDG to execute derivation.
- Inspect saved inactive/active data with
USMD_DATA_MODELin SE38 if needed.
Referenced tables
| Object | Purpose |
|---|---|
USMD_DATA_MODEL | Report 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?