MDG Restricting search help values based on other input field- Custom Objects
SAP Master Data Governance software helps organizations govern financial, material, customer, or supplier master data from its creation in a business application through its replication to target applications to ensure data quality and regulatory compliance across the enterprise
Master Data Governance for Custom Objects has the capability of Using UI Badi thorugh which we would be able to restrict the search value helps based on the other fields on the UI.
You should be having developer access for creating components and creating new configurations. You should have some knowledge of Web Dynpro ABAP and also the concept of using UI badi.
I have created a sample data model with its own access class. I have an entity type MARA with a field INHME( Content unit ) for which the vales has to be restricted.
Make sure that you do not provide any search help to it. Because it is only in that case the UI Badi will be called.
Navigate to MDGIMG-> UI Modelling-> Business Addins
Create an enhancement implementation and provide the filter value as the UI configuration for which the BADI has to be called.
Navigate to the class and implement the method IF_EX_USMD_UI_EVENT2~PROCESS_VALUE_HELP
The ID_ATTRIBUTE field contains the field name for which the search help is triggered and you can use the below coding to fetch the value that is needed, based on which the search help has to be triggered.
If id_attribute = ‘INHME’. read table it_key_field into wa_key_field with key fieldname = 'MARA'. wa_sel-fieldname = 'MARA'. wa_sel-sign = 'I'. wa_sel-option = 'EQ'. wa_sel-low = wa_key_field-value.append wa_sel to it_sel. lo_usmd_model_ext = is_ui_context-o_model.call method lo_usmd_model_ext->read_entity_data_all(exporting i_fieldname = 'MARA' if_active = '' it_sel = it_selimporting et_data_entity = it_data_entity ).read table it_data_entity into wa_data_entity with key usmd_entity = 'MARA' usmd_entity_cont = ''.if sy-subrc eq 0. lr_data = wa_data_entity-r_t_data.assign lr_data->* to <fs_data>.endif.if <fs_data> is assigned and <fs_data> is not initial.loop at <fs_data> assigning <fs_structure>.assign component 'MTART' of structure <fs_structure> to <fs_mtart>.endloop.endif.// make use of your own logic to filter values based on MTART and fill in gt_uom tableloop at gt_uom into wa_uom. wa_selection -fieldname = 'INHME'. wa_selection-sign = 'I'. wa_selection-option = 'EQ'. wa_selection-low = wa_uom-msehi.insert wa_selection into table et_selection. endloop. endif. Assign UI configuration to Change request
Now this UI configuration can be used either in the URL directly or provide this configuration name to a Change request type so that wherever this Change Request type is called, this UI configuration will be called.
Select the change request type and double click Entity types.
Now you could provide the new UI configuration name in the UI configuration column.
If it is in display mode and if you are not able to change it, then it means that there are some existing request that are open in this Change Request Type. So you have to clear those request that will enable you to change the UI configuration name
Note: you could makes use of the report USMD_DELETE_CREQUEST to delete Change requests. This is available only from EHP 5 SP05