SAP MDG · DATA MODEL UI

How do I automatically populate MDG object keys in an FPM feeder class GET_DATA enhancement?

Use an implicit enhancement at the end of the standard feeder class GET_DATA method, read the MDG change-request context, and populate the key only when the create CR type matches and the key is still initial or an MDG placeholder. Update CS_DATA, synchronize the feeder buffer, and set EV_DATA_CHANGED only after assignment.

Use an implicit enhancement at the end of the standard feeder class GET_DATA method, read the MDG change-request context, and populate the key only when the create CR type matches and the key is still initial or an MDG placeholder. Update CS_DATA, synchronize the feeder buffer, and set EV_DATA_CHANGED only after assignment.

SAP MDG main-key auto-population is typically done in an implicit enhancement at the end of the standard feeder class GET_DATA method. The pattern supports both final keys from SNRO/NUMBER_GET_NEXT and temporary keys derived from the change-request number. The enhancement should run only inside MDG, for the correct create CR type, and only when the key field is still initial or a placeholder.

Process flow

  1. Confirm the object, create CR type, feeder class, key component, and whether the key is final or temporary.
  2. Create an implicit enhancement at the end of the standard GET_DATA implementation.
  3. Replace sample constants with configured values.
  4. Generate only when CR context exists, the create CR type matches, and the current key is initial or an MDG placeholder.
  5. Update both CS_DATA and the feeder buffer.
  6. Set EV_DATA_CHANGED = ABAP_TRUE only after assignment.
  7. Preserve number-range exception handling in production code.

Implicit enhancement at the end of the standard GET_DATA implementation in the feeder class

Insert the key-generation logic without replacing the standard feeder behavior.

CL_USMD_APP_CONTEXT=>GET_CONTEXT / GET_ATTRIBUTES

Read the current MDG change-request ID and type during runtime.

CL_USMD_MODEL_EXT=>GET_INSTANCE and READ_ENTITY_DATA_ALL

Read staged attributes such as MATKL for Material key derivation.

NUMBER_GET_NEXT with configured SNRO object/interval

Generate final keys for number-range based objects such as Profit Center.

Referenced tables

ObjectPurpose
SAP_MDG_AUTO_POPULATE_OBJECT_KEYS.md enhancement locationsMaps object to main key, feeder class, method, and strategy.
SAP_MDG_AUTO_POPULATE_OBJECT_KEYS.md custom dependency replacementsShows what to replace in a custom implementation, such as custom readers and global CR caches.

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

Related questions and keywords

Alternative questions

  • How do I auto-fill MATNR, ACCOUNT, PCTR, or CCTR in SAP MDG?
  • Which feeder class and method are used for MDG key auto-population?
  • How do I generate temporary or final keys in MDG GET_DATA?

Possible questions

  • How do I automatically populate MDG object keys in an FPM feeder class GET_DATA enhancement?
  • How do I auto-fill MATNR, ACCOUNT, PCTR, or CCTR in SAP MDG?
  • Which feeder class and method are used for MDG key auto-population?
  • How do I generate temporary or final keys in MDG GET_DATA?
  • How do I use CL_USMD_APP_CONTEXT and NUMBER_GET_NEXT in MDG key generation?

Keywords

SAP MDGFPM feeder classGET_DATAimplicit enhancementCL_USMD_APP_CONTEXTCL_USMD_MODEL_EXTREAD_ENTITY_DATA_ALLNUMBER_GET_NEXTMATNRACCOUNTPCTRCCTRSNROchange requesttemporary keyfinal key