SAP MDG · DATA MODEL UI
How do I automatically populate main keys in SAP MDG create change requests?
In SAP MDG, automatic main-key population is typically done with an implicit enhancement at the end of the feeder class `IF_FPM_GUIBB_FORM~GET_DATA`. Read the change-request context with `CL_USMD_APP_CONTEXT`, generate only for the matching create CR type, preserve any user-entered key, update `CS_DATA` and the feeder buffer, then set `EV_DATA_CHANGED`.
In SAP MDG, automatic main-key population is typically done with an implicit enhancement at the end of the feeder class `IF_FPM_GUIBB_FORM~GET_DATA`. Read the change-request context with `CL_USMD_APP_CONTEXT`, generate only for the matching create CR type, preserve any user-entered key, update `CS_DATA` and the feeder buffer, then set `EV_DATA_CHANGED`.
SAP MDG main-key auto-population is implemented in the feeder class `IF_FPM_GUIBB_FORM~GET_DATA` using an implicit enhancement at the end of the standard method. The standard pattern is: read the MDG change-request context, verify the create CR type, preserve any already-filled key, generate the value only when the field is initial, update both `CS_DATA` and the feeder’s backend structure, and then set `EV_DATA_CHANGED`. The exact feeder class depends on the object: Material uses `/PLMU/CL_FRW_G_FEEDER_FORM`, G/L Account uses `CL_MDGF_GUIBB_FI_ACCOUNT`, Profit Center uses `CL_MDGF_GUIBB_PCTR`, Profit Center copy uses `CL_USMD_COPY_ITEM_POPUP`, and Cost Center uses `CL_MDGF_GUIBB_CCTR`.
Process flow
- Let the standard feeder populate `CS_DATA`.
- Read the MDG application context with `CL_USMD_APP_CONTEXT=>GET_CONTEXT`.
- Call `GET_ATTRIBUTES` and check CR ID and CR type.
- Exit unless the create CR type matches your configured target.
- Preserve any already-populated real key.
- Read staged attributes if needed, such as `MATKL` for Material.
- Generate the key with your configured logic or `NUMBER_GET_NEXT`.
- Write the value back to `CS_DATA` and the feeder buffer or context structure (`SET_ACCESS_ATTRIBUTE` / `SET_ATTRIBUTE`).
Number range object and interval maintenance
Maintain the number range used for final keys generated with `NUMBER_GET_NEXT`.
Referenced tables
| Object | Purpose |
|---|---|
N/A | The retrieved guide does not specify a configuration table for this pattern; the behavior is driven by feeder logic, CR context, and number-range configuration. |
The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I fill MATNR, ACCOUNT, PCTR, or CCTR automatically in MDG?
- What is the standard MDG enhancement pattern for automatic key generation?
- How do I implement auto-population of object keys in IF_FPM_GUIBB_FORM~GET_DATA?
Possible questions
- How do I automatically populate main keys in SAP MDG create change requests?
- How can I fill MATNR, ACCOUNT, PCTR, or CCTR automatically in MDG?
- What is the standard MDG enhancement pattern for automatic key generation?
- How do I implement auto-population of object keys in IF_FPM_GUIBB_FORM~GET_DATA?
- Which feeder class and method should I enhance for MDG key auto-population?