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
- Confirm the object, create CR type, feeder class, key component, and whether the key is final or temporary.
- Create an implicit enhancement at the end of the standard GET_DATA implementation.
- Replace sample constants with configured values.
- Generate only when CR context exists, the create CR type matches, and the current key is initial or an MDG placeholder.
- Update both CS_DATA and the feeder buffer.
- Set EV_DATA_CHANGED = ABAP_TRUE only after assignment.
- 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
| Object | Purpose |
|---|---|
SAP_MDG_AUTO_POPULATE_OBJECT_KEYS.md enhancement locations | Maps object to main key, feeder class, method, and strategy. |
SAP_MDG_AUTO_POPULATE_OBJECT_KEYS.md custom dependency replacements | Shows 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?