SAP MDG · DATA MODEL UI

How do I implement an MDG FPM Form feeder class to add a custom button, control action visibility in GET_DATA, and handle a custom event with OVS value help?

Subclass the standard MDG form feeder, redefine GET_DEFINITION for static UI setup, GET_DATA for per-round-trip data and action usage, and PROCESS_EVENT for user-triggered logic. Add the custom toolbar action in GET_DEFINITION, link OVS via the field description, and set ev_action_usage_changed when you hide or disable the action.

Subclass the standard MDG form feeder, redefine GET_DEFINITION for static UI setup, GET_DATA for per-round-trip data and action usage, and PROCESS_EVENT for user-triggered logic. Add the custom toolbar action in GET_DEFINITION, link OVS via the field description, and set ev_action_usage_changed when you hide or disable the action.

Use a custom feeder class that subclasses the standard SAP form feeder and redefine IF_FPM_GUIBB_FORM~GET_DEFINITION, GET_DATA, and PROCESS_EVENT. The documented pattern is: keep the standard logic first with super->, then add a custom action, attach OVS to the target field, and control toolbar usage dynamically in GET_DATA.

Process flow

  1. Subclass the standard SAP MDG form feeder class in SE24.
  2. Redefine IF_FPM_GUIBB_FORM~GET_DEFINITION, GET_DATA, and PROCESS_EVENT.
  3. Call super->if_fpm_guibb_form~get_definition first, then insert a row into et_action_definition for the custom button.
  4. In GET_DEFINITION, loop over et_field_description and set ovs_name for the target field to me->class_name.
  5. Call super->if_fpm_guibb_form~get_data first, then read the relevant field from cs_data using ASSIGN COMPONENT.
  6. Update ct_action_usage to hide or disable the action when needed and set ev_action_usage_changed = abap_true.
  7. In PROCESS_EVENT, inspect io_event->mv_event_id and handle the custom event and standard save event separately.
  8. Use cl_fpm_factory=>get_instance( ) to open a dialog box if the custom button should launch one, and use cl_usmd_ui_services=>get_instance( ) to show messages if needed.

Referenced tables

ObjectPurpose
fpmgb_s_actiondefRow structure used to register a custom action/button in GET_DEFINITION.
fpmgb_s_actionusageRow structure used to change toolbar action visibility/enabled state in GET_DATA.

ILLUSTRATIVE ABAP SAMPLE

Source ABAP example: Create_or_Redefine_UI_Feeder_Class.abap

Exact relevant implementation excerpt from the knowledge document set.

1*---------------------------------------------------------------------* 2* TITLE: Create or Redefine a UI Feeder Class 3* SOURCE: SAP How-To Guide 4*---------------------------------------------------------------------* 5* TAGS: 6* SAP MDG 7* SAP Master Data Governance 8* UI Feeder Class 9* FPM 10* Floorplan Manager 11* Web Dynpro ABAP 12* UIBB 13* Form UIBB 14* CL_BS_BP_GUIBB_FORM 15* CL_BS_BP_GUIBB_LIST 16* CL_BS_CU_GUIBB_GENERAL_DATA 17* ZCL_BS_CU_GUIBB_GENERAL_DATA 18* IF_FPM_GUIBB_FORM~GET_DEFINITION 19* OVS_HANDLE_PHASE_2 20* GET_JOIN_ENTITY_DATA 21* GET_ENTITY_DATA 22* OVS Search Help 23* KDKG1 24* KDKG1__TEXT 25* TVKGG 26* TVKGGT 27* genIL 28* BUPA 29* BUPA_CUSP 30* CL_BS_CUSTOMER_GENIL 31* ZCL_BS_GENIL_CUSTOM 32* GENIL_MODEL_BROWSER 33* USMD_TXT_FLD_EXC 34* USMD_TXT_FLD_MAP_DELETE 35*---------------------------------------------------------------------* 36 37*---------------------------------------------------------------------* 38* CLASS: ZCL_BS_CU_GUIBB_GENERAL_DATA 39* METHOD: IF_FPM_GUIBB_FORM~GET_DEFINITION 40*---------------------------------------------------------------------* 41METHOD if_fpm_guibb_form~get_definition. 42 43*! Get the definition of the feeder class / UIBB. 44 45 "inherit first 46 super->if_fpm_guibb_form~get_definition( 47 IMPORTING 48 eo_field_catalog = eo_field_catalog 49 et_field_description = et_field_description 50 et_action_definition = et_action_definition 51 et_special_groups = et_special_groups 52 et_dnd_definition = et_dnd_definition 53 es_options = es_options 54 es_message = es_message 55 ev_additional_error_info = ev_additional_error_info ). 56 57 "set the OVS search help for field Condition Group 1 (KDKG1) to the 58 "current class 59 READ TABLE et_field_description ASSIGNING FIELD-SYMBOL(<description>) 60 WITH KEY name = 'KDKG1'. 61 62 IF sy-subrc = 0. 63 <description>-ovs_name = me->class_name. 64 ENDIF. 65 66ENDMETHOD. 67 68*---------------------------------------------------------------------* 69* CLASS: ZCL_BS_CU_GUIBB_GENERAL_DATA 70* METHOD: OVS_HANDLE_PHASE_2 71*---------------------------------------------------------------------* 72METHOD ovs_handle_phase_2. 73 74 CASE iv_field_name. 75 WHEN 'KDKG1'. 76 "Implement the OVS search result for the Condition Group 1. 77 "The corresponding customizing tables are TVKGG & TVKGGT. 78 TYPES: 79 BEGIN OF ty_s_ovs_condition, 80 kdkg1 TYPE kdkgr, 81 kdkg1__text TYPE vtext, 82 END OF ty_s_ovs_condition, 83 ty_t_ovs_condition TYPE STANDARD TABLE OF ty_s_ovs_condition. 84 85 CREATE DATA er_output TYPE ty_t_ovs_condition. 86 FIELD-SYMBOLS <output> TYPE ty_t_ovs_condition. 87 ASSIGN er_output->* TO <output>. 88 89 SELECT * FROM tvkgg INTO TABLE @DATA(conditions). 90 91 IF conditions IS NOT INITIAL. 92 SELECT * FROM tvkggt INTO TABLE @DATA(texts) 93 FOR ALL ENTRIES IN @conditions 94 WHERE kdkgr = @conditions-kdkgr 95 AND spras = @sy-langu. 96 ENDIF. 97 98 LOOP AT conditions ASSIGNING FIELD-SYMBOL(<condition>). 99 APPEND INITIAL LINE TO <output> ASSIGNING FIELD-SYMBOL(<line>). 100 <line>-kdkg1 = <condition>-kdkgr. 101 <line>-kdkg1__text = <condition>-kdkgr. 102 103 READ TABLE texts ASSIGNING FIELD-SYMBOL(<text>) 104 WITH KEY kdkgr = <condition>-kdkgr 105 spras = sy-langu. 106 107 CHECK sy-subrc = 0 108 AND <text>-vtext IS NOT INITIAL. 109 110 <line>-kdkg1__text = <text>-vtext. 111 ENDLOOP. 112 113 WHEN OTHERS. 114 "The method is called for each field using an OVS. To support 115 "SAP owned fields with their standard logic, the OTHERS simply 116 "calls the parent class. 117 super->ovs_handle_phase_2( 118 EXPORTING 119 iv_field_name = iv_field_name 120 ir_query_parameter = ir_query_parameter

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

Related questions and keywords

Alternative questions

  • How do I subclass an SAP MDG form feeder and redefine GET_DEFINITION, GET_DATA, and PROCESS_EVENT?
  • How do I wire OVS to a field in an MDG FPM form feeder?
  • How do I show or hide an action in an MDG FPM form based on field content?

Possible questions

  • How do I implement an MDG FPM Form feeder class?
  • How do I add a custom action to an MDG form GUIBB?
  • How do I control toolbar action usage in GET_DATA?
  • How do I connect OVS to a field in a form feeder?
  • How do I handle a custom FPM event in PROCESS_EVENT?

Keywords

SAP MDGFPMGUIBBForm feederIF_FPM_GUIBB_FORMGET_DEFINITIONGET_DATAPROCESS_EVENTOVSfpmgb_s_actiondeffpmgb_s_actionusagecl_fpm_event=>gc_event_save