cancel
Showing results for 
Search instead for 
Did you mean: 

Get UIBB Config-ID in CL_MDG_BS_MAT_FEEDER_LIST_BASE GET_DATA()

matthias_fischer
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Matthias,

Did you try above way ? Is code working ?

matthias_fischer
Explorer
0 Kudos

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

Former Member
0 Kudos

Hi Matthias,

Did you try not passing parameter IV_UIBB_PRIMARY_ATTRIBUTE in method GET_TOOLBAR_ELEMENTS. This is just an optional parameter.

Former Member
0 Kudos

Hi Matthias,

Whether it is working ?

matthias_fischer
Explorer
0 Kudos

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.


former_member209780
Active Participant
0 Kudos

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

matthias_fischer
Explorer
0 Kudos

Dear Goutham,

The GET_RUNTIME_INFO unfortunately provides only the information to the OVP itself and no UIBB information:

APPLICATION                                  MDG_BS_MAT_OVP
CONFIG_ID                                  BS_MAT_OVP_03
FLOORPLAN                                  OVP
FP_CONFIG_ID                                  BS_MAT_OVP_LAYOUT_03

Kind regards, Matthias

former_member209780
Active Participant
0 Kudos

Hi Matthias,

Instead of creating a post exit I would suggest creating a implicit enhancement at the end of the method and call GET_UIBB_INSTANCE_KEY method in the class or you can actually access MS_UIBB_INSTANCE_KEY directly.

Thanks

Goutham

matthias_fischer
Explorer
0 Kudos

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

former_member209780
Active Participant
0 Kudos

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.