SAP MDG · VALIDATION DERIVATION

How should I implement DERIVE_ENTITY safely in SAP MDG for entity defaulting and derivation?

Implement `USMD_RULE_SERVICE~DERIVE_ENTITY` as deterministic, entity-focused defaulting only: guard `CT_DATA`, safely `ASSIGN COMPONENT`, derive only initial target fields unless overwrite is explicitly required, fetch change-request context once, and keep hard validation in `CHECK_ENTITY` instead of derivation.

Implement `USMD_RULE_SERVICE~DERIVE_ENTITY` as deterministic, entity-focused defaulting only: guard `CT_DATA`, safely `ASSIGN COMPONENT`, derive only initial target fields unless overwrite is explicitly required, fetch change-request context once, and keep hard validation in `CHECK_ENTITY` instead of derivation.

Implement `DERIVE_ENTITY` as an orchestrator for entity-specific submethods, with safe dynamic assignment and context reads done once per method. Keep derivation separate from validation, avoid repeated database reads in loops, and return only technical or informational messages in `ET_MESSAGE`—not hard business errors.

Process flow

  1. Open SE18 and inspect BAdI definition USMD_RULE_SERVICE.
  2. Create or maintain the implementation in SE19 with the correct model and entity filters.
  3. Assign or create the implementing class and implement IF_EX_USMD_RULE_SERVICE.
  4. Code DERIVE_ENTITY with safe CT_DATA assignment and defensive ASSIGN COMPONENT usage.
  5. Derive only initial target fields unless overwrite is explicitly required.
  6. Delegate complex logic to entity-specific submethods and append messages consistently.
  7. Activate class, BAdI implementation, and dependent helper objects.
  8. Test intercompany vs domestic, empty vs prefilled, and partial-data scenarios.

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

Related questions and keywords

Alternative questions

  • What is the correct implementation pattern for USMD_RULE_SERVICE~DERIVE_ENTITY?
  • How do I avoid dumps and bad overwrites in MDG derivation?
  • What is the recommended ABAP structure for entity derivation in DERIVE_ENTITY?

Possible questions

  • Show me the full SE18/SE19 implementation steps for DERIVE_ENTITY.
  • Give me a safe ABAP sample for dynamic CT_DATA assignment in DERIVE_ENTITY.
  • How do I handle messages and performance in MDG derivation?
  • What checks should I do before writing to CT_DATA in DERIVE_ENTITY?
  • How do I adapt a derivation design for different entity segments?

Keywords

USMD_RULE_SERVICEDERIVE_ENTITYMDGCT_DATAET_MESSAGEdynamic ASSIGNentity defaultingderivation checklistCR typeaccount group