DATA MODEL ENHANCEMENT ALONG WITH UI CONFIGURATION

Estimated read time 14 min read

                   The data that has to be managed , governed and controlled through a governance procedure like standard SAP MDG is determined by Data Model.

Adding Custom Field : This requirement includes extending the standard data model with custom/enhanced fields that are added to the Standard tables/ custom tables which are linked to the standard tables.

Example : Adding custom fields ‘Country of Ownership’ and ‘Customer Type’ to ‘BP_CENTRL’ entity of BP Data Model.

IMPLEMENTATION :

STEP 1 : ADD CUSTOM ATTRIBUTES TO STANDARD DATA MODEL .

Go to MDGIMG->General Settings->Edit Data Model->Select BP->Select Entity type as ‘BP_CENTRL’->Add ‘Country of Ownership’ and ‘Customer Type’  custom fields->Save it and Activate it.

                                                         Fig 1 : Custom fields for MDG DM

STEP 2 : ADD CUSTOM ATTRIBUTES TO ERP TABLE .       

                    Go to SE11->Database Table ( BUT000)->Include fields in ‘CI_EEW_BUT000′ Structure-> Save it and Activate it.

                                       Fig 2 : Custom Fields added to ECC table

STEP 3 : GENERATE DATA MODEL SPECIFIC STRUCTURES :

                Go to MDGIMG->General Settings -> Edit Data Model->Execute Data Model Specific Structures->Select BP and Click on Structures->Select Entity Type as ‘BP_CENTRL’ and click on Generate Data Model Specific Structures. Check your Structures in ‘USMD_DATA_MODEL’ in SE38 Report.  

                                            Fig 3 : Generating  DM specific Structures 

STEP 4 : PERFORM SMT MAPPING :

               Again input T-Code MDGIMG->General Settings-> Edit Data Model-> Expand Edit Mappings and Execute Edit Mappings ( You will be navigated to Web Dynpro Application ).

Follow the below steps to do mappings for both 2STA and 2API.

Mapping Name :  MDG_BS_BP_MAP_2STA.

Mapping Step     : MDG_BS_BP_BP_CENTRL.

Click on Details -> Select Transformations-> Give ‘00001′ as order and transformation type as ‘Field Mapping’. Source structure is  ‘BUS_EI_EXTERN’ and Target Structure is ‘MDG_BS_BP_BP_CENTRL’.                                                                    Fig 4 : SMT Mapping to 2STA .                                                                       Now Perform mapping to 2API. Extend Mapping -> Give Mapping Name as ‘BP_BP_CENTRL_2API’.

1.Click on Details -> Select Transformations-> Give ‘00001′ as order and transformation type as ‘Field Mapping’. Source structure is  ‘MDG_BS_BP_BP_CENTRL’  and Target Structure is ‘BUS_EI_BUPA_CENTRAL_DATA’. Save it .

 

                                                     Fig 5 : SMT Mapping to 2API.                                                                    

STEP 4 : ADJUST STAGING IN SE38  :

  Go to SE38-> Program Name : USMD_ADJUST_STAGING-> Execute -> Data Model : BP ->Execute again.

ADDING CUSTOM FIELDS TO UI SCREEN : 

      Input NWBC T-Code ( Navigated to Web Dynpro Application ) -> Select  ‘Supplier Governance’ Work area->Click on Search Customer-> New->Organization->Select your CR Type and Click on Ok ( You will be navigated to New Change Request page.  

Steps to Perform :

1. Right click on the UIBB where you want to add Custom fields. Here I am Creating a Separate View for new fields

     Right click->technical settings->click on Application Configuration->Expand Other Functions and Click on Enhance. Popup will be appeared , enter enhancement name and click on create.

                                                          Fig 6 : Enhancement View                                                                       2. There you have to click on +UIBB and add Component, Config ID and Window Name, and do wiring and all and click on CONFIURE UIBB.

                                                 Fig 7 : Configuring OVP Page 

3. Create a custom Feeder Class in SE24  and implement the following methods mainly GET_DATA and GET_DEFINITION method.

IF_FPM_GUIBB_FORM~GET_DEFINITION :

 

method IF_FPM_GUIBB_FORM~GET_DEFINITION.
CALL METHOD SUPER->IF_FPM_GUIBB_FORM~GET_DEFINITION
IMPORTING
eo_field_catalog = eo_field_catalog
et_field_description = et_field_description
et_action_definition = et_action_definition
et_special_groups = et_special_groups
et_dnd_definition = et_dnd_definition
es_options = es_options
es_message = es_message
ev_additional_error_info = ev_additional_error_info
.
endmethod.

 

IF_FPM_GUIBB_FORM~GET_DATA :

 

method IF_FPM_GUIBB_FORM~GET_DATA.

CONSTANTS: delete TYPE fpm_event_id VALUE ‘_DELE_’,
create TYPE fpm_event_id VALUE ‘_CREA_’,
hide TYPE wdui_visibility VALUE ’01’,
c_x TYPE c VALUE ‘X’.

CALL METHOD super->if_fpm_guibb_form~get_data
EXPORTING
io_event = io_event
iv_raised_by_own_ui = iv_raised_by_own_ui
it_selected_fields = it_selected_fields
iv_edit_mode = iv_edit_mode
io_extended_ctrl = io_extended_ctrl
IMPORTING
et_messages = et_messages
ev_data_changed = ev_data_changed
ev_field_usage_changed = ev_field_usage_changed
ev_action_usage_changed = ev_action_usage_changed
CHANGING
cs_data = cs_data
ct_field_usage = ct_field_usage
ct_action_usage = ct_action_usage.

LOOP AT ct_action_usage ASSIGNING FIELD-SYMBOL(<action>).
IF <action> IS ASSIGNED.
IF <action>-id = delete OR <action>-id = create.
<action>-visible = hide.
* <action>-enabled = ‘ ‘.
ev_action_usage_changed = c_x.
ENDIF.
ENDIF.
ENDLOOP.
endmethod.

 

GET_ENTITY_DATA :

 

METHOD get_entity_data.

” *!This method is used to read the entity,It adds the texts for fields having search or value helps

DATA: lv_class TYPE jv_jibcl,
lv_text_field TYPE name_komp.

FIELD-SYMBOLS: <lv_key> TYPE any,
<lv_text> TYPE any.

* “Inherit from the parent first,This set all key values.
super->get_entity_data(
EXPORTING
io_access = io_access
CHANGING
cs_data = cs_data ).

“Set the Customer type description.

lv_text_field = ‘ZCUS_TYPE’ && cl_usmd_generic_genil_text=>gv_text_suffix.
ASSIGN COMPONENT: ‘ZCUS_TYPE’ OF STRUCTURE cs_data TO <lv_key>,
lv_text_field OF STRUCTURE cs_data TO <lv_text>.
IF <lv_key> IS ASSIGNED AND <lv_key> IS NOT INITIAL AND <lv_text> IS ASSIGNED.
SELECT SINGLE custype_desc FROM zmdm_t_CUS_txt INTO <lv_text>
WHERE langu = sy-langu
AND custype = <lv_key>.
UNASSIGN: <lv_key>, <lv_text>.
ENDIF.
ENDMETHOD.

 

CREATE_STRUCT_RTTI :

 

METHOD create_struct_rtti.
.
* This method is used to enhance the fieldcatalog.
* It adds transient text fields ‘<FIELD_NAME>__TXT’ in the UIBB

DATA:
lt_components TYPE cl_abap_structdescr=>component_table.

FIELD-SYMBOLS:
<ls_component> LIKE LINE OF lt_components.

super->create_struct_rtti( ).
lt_components = me->mo_struct_rtti->get_components( ).

** Country of Ownership
APPEND INITIAL LINE TO lt_components ASSIGNING <ls_component>.
<ls_component>-name = |ZCTRY_OWN{ cl_usmd_generic_genil_text=>gv_text_suffix }|.” Field Concatenation
<ls_component>-type = cl_abap_elemdescr=>get_string( ). ” Data Type

** Customer Type.

APPEND INITIAL LINE TO lt_components ASSIGNING <ls_component>.
<ls_component>-name = |ZCUS_TYPE{ cl_usmd_generic_genil_text=>gv_text_suffix }|. ” Field Concatenation
<ls_component>-type = cl_abap_elemdescr=>get_string( ). ” Data Type
“Update the fieldcatalog.
me->mo_struct_rtti = cl_abap_structdescr=>create( lt_components ).
ENDMETHOD.

 

STEP 5 : ADD THE FEEDER CLASS TO THE CUSTOM UIBB.

Drag the fields which is available under repositories and place it in the respective position and Save it.

Cross verify the fields are added on the UI Screen by starting the transaction NWBC  and checking in the respective UI.

                                                                                                                                                                                                              In this way we can enhance the data model by adding the custom fields. I hope this blog post has given you a better understanding of your options for SAP MDG extensibility .

  Your Ideas and feedback about my blog are highly important. Please feel free to post your comments under comment section in this blog.

Check out for other contents which are related to MDG :

1.https://community.sap.com/t5/additional-blogs-by-sap/extending-sap-master-data-governance-for-supplier-part-1/ba-p/12919392

2.https://community.sap.com/t5/additional-blogs-by-sap/extending-sap-master-data-governance-for-supplier-part-2/ba-p/12919603

3.https://community.sap.com/t5/technology-blogs-by-members/sap-mdg-m-customizing-modification-ui/ba-p/13287735

4.https://community.sap.com/t5/technology-blogs-by-members/drag-and-drop-functionality-with-feeder-class/ba-p/13213793.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

​                    The data that has to be managed , governed and controlled through a governance procedure like standard SAP MDG is determined by Data Model.Adding Custom Field : This requirement includes extending the standard data model with custom/enhanced fields that are added to the Standard tables/ custom tables which are linked to the standard tables.Example : Adding custom fields ‘Country of Ownership’ and ‘Customer Type’ to ‘BP_CENTRL’ entity of BP Data Model.IMPLEMENTATION :STEP 1 : ADD CUSTOM ATTRIBUTES TO STANDARD DATA MODEL .Go to MDGIMG->General Settings->Edit Data Model->Select BP->Select Entity type as ‘BP_CENTRL’->Add ‘Country of Ownership’ and ‘Customer Type’  custom fields->Save it and Activate it.                                                         Fig 1 : Custom fields for MDG DMSTEP 2 : ADD CUSTOM ATTRIBUTES TO ERP TABLE .                           Go to SE11->Database Table ( BUT000)->Include fields in ‘CI_EEW_BUT000’ Structure-> Save it and Activate it.                                       Fig 2 : Custom Fields added to ECC tableSTEP 3 : GENERATE DATA MODEL SPECIFIC STRUCTURES :                Go to MDGIMG->General Settings -> Edit Data Model->Execute Data Model Specific Structures->Select BP and Click on Structures->Select Entity Type as ‘BP_CENTRL’ and click on Generate Data Model Specific Structures. Check your Structures in ‘USMD_DATA_MODEL’ in SE38 Report.                                              Fig 3 : Generating  DM specific Structures STEP 4 : PERFORM SMT MAPPING :               Again input T-Code MDGIMG->General Settings-> Edit Data Model-> Expand Edit Mappings and Execute Edit Mappings ( You will be navigated to Web Dynpro Application ).Follow the below steps to do mappings for both 2STA and 2API.Mapping Name :  MDG_BS_BP_MAP_2STA.Mapping Step     : MDG_BS_BP_BP_CENTRL.Click on Details -> Select Transformations-> Give ‘00001’ as order and transformation type as ‘Field Mapping’. Source structure is  ‘BUS_EI_EXTERN’ and Target Structure is ‘MDG_BS_BP_BP_CENTRL’.                                                                    Fig 4 : SMT Mapping to 2STA .                                                                       Now Perform mapping to 2API. Extend Mapping -> Give Mapping Name as ‘BP_BP_CENTRL_2API’.1.Click on Details -> Select Transformations-> Give ‘00001’ as order and transformation type as ‘Field Mapping’. Source structure is  ‘MDG_BS_BP_BP_CENTRL’  and Target Structure is ‘BUS_EI_BUPA_CENTRAL_DATA’. Save it .                                                      Fig 5 : SMT Mapping to 2API.                                                                    STEP 4 : ADJUST STAGING IN SE38  :  Go to SE38-> Program Name : USMD_ADJUST_STAGING-> Execute -> Data Model : BP ->Execute again.ADDING CUSTOM FIELDS TO UI SCREEN :       Input NWBC T-Code ( Navigated to Web Dynpro Application ) -> Select  ‘Supplier Governance’ Work area->Click on Search Customer-> New->Organization->Select your CR Type and Click on Ok ( You will be navigated to New Change Request page.  Steps to Perform :1. Right click on the UIBB where you want to add Custom fields. Here I am Creating a Separate View for new fields     Right click->technical settings->click on Application Configuration->Expand Other Functions and Click on Enhance. Popup will be appeared , enter enhancement name and click on create.                                                          Fig 6 : Enhancement View                                                                       2. There you have to click on +UIBB and add Component, Config ID and Window Name, and do wiring and all and click on CONFIURE UIBB.                                                 Fig 7 : Configuring OVP Page 3. Create a custom Feeder Class in SE24  and implement the following methods mainly GET_DATA and GET_DEFINITION method.IF_FPM_GUIBB_FORM~GET_DEFINITION :  method IF_FPM_GUIBB_FORM~GET_DEFINITION.
CALL METHOD SUPER->IF_FPM_GUIBB_FORM~GET_DEFINITION
IMPORTING
eo_field_catalog = eo_field_catalog
et_field_description = et_field_description
et_action_definition = et_action_definition
et_special_groups = et_special_groups
et_dnd_definition = et_dnd_definition
es_options = es_options
es_message = es_message
ev_additional_error_info = ev_additional_error_info
.
endmethod.  IF_FPM_GUIBB_FORM~GET_DATA :  method IF_FPM_GUIBB_FORM~GET_DATA.

CONSTANTS: delete TYPE fpm_event_id VALUE ‘_DELE_’,
create TYPE fpm_event_id VALUE ‘_CREA_’,
hide TYPE wdui_visibility VALUE ’01’,
c_x TYPE c VALUE ‘X’.

CALL METHOD super->if_fpm_guibb_form~get_data
EXPORTING
io_event = io_event
iv_raised_by_own_ui = iv_raised_by_own_ui
it_selected_fields = it_selected_fields
iv_edit_mode = iv_edit_mode
io_extended_ctrl = io_extended_ctrl
IMPORTING
et_messages = et_messages
ev_data_changed = ev_data_changed
ev_field_usage_changed = ev_field_usage_changed
ev_action_usage_changed = ev_action_usage_changed
CHANGING
cs_data = cs_data
ct_field_usage = ct_field_usage
ct_action_usage = ct_action_usage.

LOOP AT ct_action_usage ASSIGNING FIELD-SYMBOL(<action>).
IF <action> IS ASSIGNED.
IF <action>-id = delete OR <action>-id = create.
<action>-visible = hide.
* <action>-enabled = ‘ ‘.
ev_action_usage_changed = c_x.
ENDIF.
ENDIF.
ENDLOOP.
endmethod.  GET_ENTITY_DATA :  METHOD get_entity_data.

” *!This method is used to read the entity,It adds the texts for fields having search or value helps

DATA: lv_class TYPE jv_jibcl,
lv_text_field TYPE name_komp.

FIELD-SYMBOLS: <lv_key> TYPE any,
<lv_text> TYPE any.

* “Inherit from the parent first,This set all key values.
super->get_entity_data(
EXPORTING
io_access = io_access
CHANGING
cs_data = cs_data ).

“Set the Customer type description.

lv_text_field = ‘ZCUS_TYPE’ && cl_usmd_generic_genil_text=>gv_text_suffix.
ASSIGN COMPONENT: ‘ZCUS_TYPE’ OF STRUCTURE cs_data TO <lv_key>,
lv_text_field OF STRUCTURE cs_data TO <lv_text>.
IF <lv_key> IS ASSIGNED AND <lv_key> IS NOT INITIAL AND <lv_text> IS ASSIGNED.
SELECT SINGLE custype_desc FROM zmdm_t_CUS_txt INTO <lv_text>
WHERE langu = sy-langu
AND custype = <lv_key>.
UNASSIGN: <lv_key>, <lv_text>.
ENDIF.
ENDMETHOD.  CREATE_STRUCT_RTTI : METHOD create_struct_rtti.
.
* This method is used to enhance the fieldcatalog.
* It adds transient text fields ‘<FIELD_NAME>__TXT’ in the UIBB

DATA:
lt_components TYPE cl_abap_structdescr=>component_table.

FIELD-SYMBOLS:
<ls_component> LIKE LINE OF lt_components.

super->create_struct_rtti( ).
lt_components = me->mo_struct_rtti->get_components( ).

** Country of Ownership
APPEND INITIAL LINE TO lt_components ASSIGNING <ls_component>.
<ls_component>-name = |ZCTRY_OWN{ cl_usmd_generic_genil_text=>gv_text_suffix }|.” Field Concatenation
<ls_component>-type = cl_abap_elemdescr=>get_string( ). ” Data Type

** Customer Type.

APPEND INITIAL LINE TO lt_components ASSIGNING <ls_component>.
<ls_component>-name = |ZCUS_TYPE{ cl_usmd_generic_genil_text=>gv_text_suffix }|. ” Field Concatenation
<ls_component>-type = cl_abap_elemdescr=>get_string( ). ” Data Type
“Update the fieldcatalog.
me->mo_struct_rtti = cl_abap_structdescr=>create( lt_components ).
ENDMETHOD.  STEP 5 : ADD THE FEEDER CLASS TO THE CUSTOM UIBB.Drag the fields which is available under repositories and place it in the respective position and Save it.Cross verify the fields are added on the UI Screen by starting the transaction NWBC  and checking in the respective UI.                                                                                                                                                                                                              In this way we can enhance the data model by adding the custom fields. I hope this blog post has given you a better understanding of your options for SAP MDG extensibility .  Your Ideas and feedback about my blog are highly important. Please feel free to post your comments under comment section in this blog.Check out for other contents which are related to MDG :1.https://community.sap.com/t5/additional-blogs-by-sap/extending-sap-master-data-governance-for-supplier-part-1/ba-p/129193922.https://community.sap.com/t5/additional-blogs-by-sap/extending-sap-master-data-governance-for-supplier-part-2/ba-p/129196033.https://community.sap.com/t5/technology-blogs-by-members/sap-mdg-m-customizing-modification-ui/ba-p/132877354.https://community.sap.com/t5/technology-blogs-by-members/drag-and-drop-functionality-with-feeder-class/ba-p/13213793.                Read More Technology Blogs by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author

+ There are no comments

Add yours