on 04-13-2016 4:58 PM
We want to set the visibility of the toolbar elements of the UIBB MDG_BS_MAT_PLANT_LIST_ATS UIBB at runtime.
The thread http://scn.sap.com/thread/3607766 provides a couple of good information how to do to that.
The problem we still have is to set a good if-condition to hit the appropriate point of time.
The method IF_FPM_GUIBB_LIST~GET_DATA() in the implementing class /PLMU/CL_FRW_G_FEEDER_LIST is passed a couple of times when opening the material master UI. We do not want to run our enhancement 20 times or more.
When debugging the method the ME-Object provides an attribute MS_UIBB_INSTANCE_KEY with the field CONFIG_ID which contains the ID of the UIBB we want to enhance.
But the line of code: "IF me->ms_uibb_instance_key-config_id = 'MDG_BS_MAT_...' throws an syntay error.
Probably because the attribute MS_UIBB_INSTANCE_KEY of the class /PLMU/CL_FRW_G_FEEDER is protected.
Any idea how to get the MS_UIBB_INSTANCE_KEY attribute or how to get the Config-ID of the current UIBB else?
Kind regards, Matthias
Hi Matthias,
Try below piece of code in POST EXIT. I guess it should work.
DATA: lr_pry TYPE REF TO /plmu/cl_frw_g_callback_proxy,
ls_uibb TYPE fpm_s_uibb_instance_key.
*Get instance of call back
lr_pry = /plmu/cl_frw_g_callback_proxy=>get_instance( core_object ).
*Get instance of uibb
ls_uibb = lr_pry->get_uibb_instance_key( ).
*Check for your UIBB
IF ls_uibb-config_id = ' '.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear MDG user,
meantime I switched to the method /PLMU/IF_EX_FRW_APPCC_OVP~AFTER_PROCESS_BEFORE_OUTPUT because there I already have the parameter IT_UIBBS TYPE FPM_T_UIBB_COMPONENTS which gives me all shown UIBB's.
The FPM_T_UIBB_COMPONENTS type is a line type of FPM_S_UIBB_COMPONENT
which unfortunately does not match to the parameters which are needed in the GET_TOOLBAR_ELEMENTS method of the IF_FPM_OVP interface.
So at the moment I'm looking for an easy implementation to get the right values for calling the GET_TOOLBAR_ELEMENTS method.
My actual coding is:
lo_ovp ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_ovp ).
IF io_event->mv_event_id = cl_fpm_event=>gc_event_adapt_context.
* Loop through each UIBB and read tool bar elements passing primary attribute
LOOP AT it_uibbs INTO ls_uibb.
ls_instance_key = ls_uibb-instance_key.
ls_config_key = LS_UIBB-INSTANCE_KEY-CONFIG_KEY.
ls_component = ls_uibb-instance_key-component.
IF ( ls_config_key-config_id = 'MDG_BS_MAT_DESCR_LIST' ) .
Now I want to call the method GET_TOOLBAR_ELEMENTS but wondering how to get the needed parameter:
* lo_ovp->get_toolbar_elements(
EXPORTING iv_uibb_primary_attribute = ls_uibb- ???
IMPORTING et_toolbar_element = lt_toolbar_element ).
At runtime the ls_uibb structure has the following values:
LS_UIBB-INSTANCE_KEY-COMPONENT = FPM_FORM_UIBB_GL2
LS_UIBB-INSTANCE_KEY-CONFIG_KEY-CONFIG_ID = MDG_BS_MAT_MATERIAL_FORM_03
but the
LS_UIBB-INSTANCE_KEY-INSTANCE_ID is empty
Kind regards,
Matthias
When I call the GET_TOOLBAR_ELEMENTS without a parameter I receive the list of the OVP toolbar elements, not of a certain UIBB.
Of Course I can call the IF_FPM_OVP~GET_UIBBS() before, to get the UIBB objects in a matching format and compare it afterwards with the actually visible UIBB's out of the it_uibbs parameter.
Looks quite cumbersome but will probably work.
Hi Matthias,
In the same class you have GET_FPM, it returns you the FPM instance. Or alternatively you can call CL_FPM_FACTORY=>GET_INSTANCE. You can try calling GET_RUNTIME_INFO method in this instance which returns the config details. I haven't tried it, but you can give a try.
Thanks
Goutham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Goutham,
I'm not sure what an implicit enhancement exactly is.
When enhancing the class I have the option to select between a post, pre or overwrite method.
I try it with the override method, but the result is the same.
Furthermore when creating the method the system ask me wheather i want to have access to private/protected members what I accept.
Looking at the class definition the enhancement objet is defined as FRIENDS
CLASS /plmu/cl_frw_g_feeder_list DEFINITION LOCAL FRIENDS lcl_zmdgm_mdg_bs_mat_feeder.
Kind regards, Matthias
Below is the implicit enhancement. Open the method and click on the enhance button, then you click on create button and create an implicit enhancement at the end of the method. But best way is to create a new class making this class as your super class and implement this method in the custom class and assign it to your UIBB as feeder class.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.