SAP MDG · DATA MODEL UI

How do I implement an SAP MDG BP access handler for custom vendor tax/payment data like YBPTAX?

Implement the custom BP access handler by extending `CL_MDG_BS_ECC_HANDLER`, redefining the BP access-handler methods for `YBPTAX`, reading the custom table into the BP extern buffer, mapping staging data to and from the nested vendor/company tax structure, and persisting deltas in `SAVE_ADDITIONAL_OBJECT_DATA` via update-task FM `Z_MDG_UPDATE_TAX_TYPE`.

Implement the custom BP access handler by extending `CL_MDG_BS_ECC_HANDLER`, redefining the BP access-handler methods for `YBPTAX`, reading the custom table into the BP extern buffer, mapping staging data to and from the nested vendor/company tax structure, and persisting deltas in `SAVE_ADDITIONAL_OBJECT_DATA` via update-task FM `Z_MDG_UPDATE_TAX_TYPE`.

Implement the custom data as a BP access handler extension for entity `YBPTAX`: sort the entity so it is processed, read the vendor/company-code tax rows from `ZMDG_T_IDPLBPTAX` into the BP extern buffer, flatten and rebuild the staging structure in the mapping methods, and persist insert/update/delete deltas in `SAVE_ADDITIONAL_OBJECT_DATA` through update-task FM `Z_MDG_UPDATE_TAX_TYPE`.

Process flow

  1. Create a class inheriting from `CL_MDG_BS_ECC_HANDLER`.
  2. Redefine the access-handler methods for entity `YBPTAX`.
  3. Implement `SORT_ENTITIES` so `YBPTAX` is added when present.
  4. Implement `READ_OBJECT_DATA` to read `ZMDG_T_IDPLBPTAX` into the BP extern buffer.
  5. Implement `MAP_DATA_2STA` to flatten nested tax rows into the staging structure.
  6. Implement `PREPARE_EI_HEADER_MAP_2API` to ensure BP header and vendor rows exist.
  7. Implement `MAP_DATA_2API` to write staging data back into the vendor company tax node.
  8. Implement `SAVE_ADDITIONAL_OBJECT_DATA` to calculate deltas and call `Z_MDG_UPDATE_TAX_TYPE` in update task.

Referenced tables

ObjectPurpose
ZMDG_T_IDPLBPTAXCustom persistence table for vendor company-code VAT validity and payment type data.
IDPL_BP_TAXLinked persistence object updated by `Z_MDG_UPDATE_TAX_TYPE`.

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 can I read, map, and save custom BP data in MDG using an access handler?
  • How do I persist custom vendor company-code data during the MDG BP save flow?
  • What is the implementation pattern for an MDG BP access handler with custom entity data?

Possible questions

  • How do I implement an SAP MDG BP access handler for custom vendor tax/payment data like YBPTAX?
  • How can I read, map, and save custom BP data in MDG using an access handler?
  • How do I persist custom vendor company-code data during the MDG BP save flow?
  • What is the implementation pattern for an MDG BP access handler with custom entity data?
  • Which methods must be redefined in the BP access handler for custom entity YBPTAX?
  • How do I read custom data from the BP extern buffer and write it back during save?

Keywords

SAP MDGBusiness PartnerBP access handlerYBPTAXvendor company codecustom entityread_object_datamap_data_2stamap_data_2apisave_additional_object_dataZ_MDG_UPDATE_TAX_TYPEZMDG_T_IDPLBPTAXIDPL_BP_TAX