SAP MDG · DATA MODEL UI
How do I enhance the SAP MDG Change Request UIBB with a custom field and control its visibility or editability?
Enhance the Change Request Form UIBB feeder, read the current CR context with CL_USMD_APP_CONTEXT=>GET_CONTEXT, read the CR header by USMD_CREQUEST from USMD120C, and then set field usage in GET_DATA based on edit mode and CR status. For a CR-specific field that is not part of the master-data model, store it in a separate custom table and bind it through the feeder or GenIL layer.
Enhance the Change Request Form UIBB feeder, read the current CR context with CL_USMD_APP_CONTEXT=>GET_CONTEXT, read the CR header by USMD_CREQUEST from USMD120C, and then set field usage in GET_DATA based on edit mode and CR status. For a CR-specific field that is not part of the master-data model, store it in a separate custom table and bind it through the feeder or GenIL layer.
To enhance the SAP MDG Change Request UIBB with a custom field, use the form feeder pattern: read the current change request from CL_USMD_APP_CONTEXT=>GET_CONTEXT, fetch the CR header with USMD_CREQUEST, and then control the field behavior in GET_DATA using CT_FIELD_USAGE. If the field belongs to the Change Request process rather than the governed master data, store it in a separate custom table and surface it through the UIBB feeder or GenIL model.
Process flow
- Create or identify the Change Request form feeder
- Implement IF_FPM_GUIBB_FORM~GET_DEFINITION
- Implement IF_FPM_GUIBB_FORM~GET_DATA
- Read CL_USMD_APP_CONTEXT=>GET_CONTEXT
- Extract CR id and CR type with GET_ATTRIBUTES
- Read USMD120C by
USMD_CREQUEST - Read/update the custom Z table if the field is process-specific
- Loop over CT_FIELD_USAGE and set READ_ONLY as needed','Set EV_FIELD_USAGE_CHANGED when field properties are changed','Attach the feeder to the copied Change Request UIBB and test the UI
Referenced tables
| Object | Purpose |
|---|---|
USMD120C | Change Request header table used to read CR status by USMD_CREQUEST. |
Z table keyed by USMD_CREQUEST | Recommended storage for a Change Request-specific custom field outside the MDG business data model. |
ILLUSTRATIVE ABAP SAMPLE
Non-modular form feeder sample for Change Request runtime behavior
Sample from the retrieved source showing context read, CR header lookup, field usage control, and message handling in IF_FPM_GUIBB_FORM~GET_DATA.
1REPORT zuibb_feeder_non_modular_sample.
2
3" Non-modular feeder example for AI learning.
4" Single class, no custom helper classes, all logic in runtime methods.
5
6CLASS lcl_uibb_feeder DEFINITION.
7 PUBLIC SECTION.
8 INTERFACES if_fpm_guibb_form.
9 PRIVATE SECTION.
10 DATA mv_last_crequest TYPE usmd_crequest.
11ENDCLASS.
12
13CLASS lcl_uibb_feeder IMPLEMENTATION.
14
15 METHOD if_fpm_guibb_form~get_definition.
16 " Minimal pass-through metadata pattern
17 CLEAR: et_field_description, et_action_definition, et_special_groups, et_dnd_definition.
18 CLEAR: es_options, es_message, ev_additional_error_info.
19 ENDMETHOD.
20
21 METHOD if_fpm_guibb_form~get_data.
22 DATA: lv_cr_type TYPE usmd_crequest_type,
23 lv_request_id TYPE usmd_crequest,
24 lv_edit_mode TYPE fpm_edit_mode,
25 ls_usmd120c TYPE usmd120c.
26
27 FIELD-SYMBOLS: <fs_field_usage> TYPE fpmgb_s_fieldusage.
28
29 CLEAR: et_messages.
30 ev_data_changed = abap_false.
31 ev_field_usage_changed = abap_false.
32 ev_action_usage_changed = abap_false.
33
34 " Section 1: Context read and guard
35 DATA(lo_context) = cl_usmd_app_context=>get_context( ).
36 IF lo_context IS BOUND.
37 lo_context->get_attributes(
38 IMPORTING
39 ev_crequest_id = lv_request_id
40 ev_crequest_type = lv_cr_type ).
41 ENDIF.
42
43 " Section 2: CR header read with key
44 IF lv_request_id IS NOT INITIAL.
45 SELECT SINGLE * FROM usmd120c INTO @ls_usmd120c
46 WHERE usmd_crequest = @lv_request_id.
47 mv_last_crequest = lv_request_id.
48 ENDIF.
49
50 " Section 3: Dynamic field behavior by edit mode and CR status
51 lv_edit_mode = iv_edit_mode.
52 LOOP AT ct_field_usage ASSIGNING <fs_field_usage>.
53 IF lv_edit_mode = 'R'.
54 <fs_field_usage>-read_only = abap_true.
55 ELSEIF lv_edit_mode = 'E'.
56 <fs_field_usage>-read_only = abap_false.
57 IF ls_usmd120c-usmd_creq_status = '05' OR ls_usmd120c-usmd_creq_status = '06'.
58 <fs_field_usage>-read_only = abap_true.
59 ENDIF.
60 ENDIF.
61 ENDLOOP.
62 ev_field_usage_changed = abap_true.
63
64 " Section 4: Data echo for training example
65 " Keep this generic and safe: copy incoming data back unchanged.
66 cs_data = cs_data.
67
68 " Section 5: Informational message
69 APPEND VALUE fpmgb_s_t100_message(
70 msgid = '00'
71 msgno = '398'
72 msgty = 'I'
73 parameter_1 = |UIBB feeder processed CR { mv_last_crequest } type { lv_cr_type }| )
74 TO et_messages.
75 ENDMETHOD.
76
77ENDCLASS.The remaining configuration, implementation details, and testing guidance continue from this answer more…
Related questions and keywords
Alternative questions
- How can I add a custom field to the MDG Change Request header UI?
- How can I store a Change Request-specific field outside the MDG business data model?
- How do I add a Requesting Business Area field to the Change Request UI?
Possible questions
- How can I add a dropdown field to the Change Request General Data tab?
- How can I make a custom Change Request field read-only in display mode?
- How can a custom CR field be used later for workflow or process control?
- Which feeder class and method should I enhance for a Change Request form UIBB?
- How do I read the current Change Request context in a feeder class?