cancel
Showing results for 
Search instead for 
Did you mean: 

Making UIBBs visible/invisble at user event - Problem

Former Member
0 Kudos

Hi Experts,

We have a custom FPM OVP application in which we have a couple of dropdowns.

Now, the requirement is this that for some particular values of those dropdows, I will have to make a particular UIBB visible/invisible.

Now, my OVP has one section 'SECTION_1' and the UIBB will have to made vis/invisble has element id '_CFG_UIBB_10'.

So, I wrote code in ovp exit method if_fpm_ovp_conf_exit~override_event_ovp.

But the moment this code runs the UIBB is always hidden. Please find code below.

  TYPES : BEGIN OF ty_s_uibb,

        fpm_primary_attribute TYPE fpm_element_id,

        component TYPE fpm_component_name,

        interface_view TYPE fpm_view_name,

        config_id TYPE wdy_config_id,

        config_type TYPE wdy_config_type,

        config_var TYPE wdy_config_var,

        location TYPE fpm_location,

        row TYPE fpm_row,

        index TYPE fpm_index,

        needs_stretching TYPE fpm_needs_stretching,

        hidden TYPE fpm_hidden,

        type TYPE fpm_uibb_render_type,

        collapsed TYPE fpm_collapsed,

        title TYPE fpm_uibb_title,

        explanation_text TYPE fpm_explanation,

        explanation_document TYPE fpm_explanation_document,

        default_in_stack TYPE fpm_default_uibb_in_stack,

        default_edit_page TYPE fpm_default_edit_page,

        capture_actions TYPE fpm_capture_exposable_actions,

      END OF ty_s_uibb.

  DATA lwa_uibb TYPE ty_s_uibb.

  DATA lv_sec_id TYPE fpm_section_id VALUE 'SECTION_1'.

lwa_uibb-fpm_primary_attribute = '_CFG_UIBB_10'.

*

  IF ( something )

    lwa_uibb-hidden = 'X'.

  ELSE.

    lwa_uibb-hidden = ''.

  ENDIF.

  TRY.

      CALL METHOD io_ovp->change_uibb

        EXPORTING

          is_uibb                  = lwa_uibb

          iv_section               = lv_sec_id

*         iv_add_uibb_to_new_stack =         ABAP_FALSE

        .

    CATCH cx_fpm_floorplan .

  ENDTRY.

Any ideas where I am going wrong?

Many thanks in advance.

Saikat

Accepted Solutions (1)

Accepted Solutions (1)

AbhishekSharma
Active Contributor
0 Kudos

Hi Saikat,

Yes we can hide whole UIBB.

Steps to do this :

1- you need to get all settings of UIBB which you want to hide.

this can be obtained as below :

make an object of Interface IF_FPM_OVP

MO_OVP -Instance Attribute-Private-Type Ref To-IF_FPM_OVP-Interface for Communication FPM App CC

2- Get UIBB with this reference object

mo_ovp->get_uibbs(

         EXPORTING

           iv_content_area = iv_content_area

           iv_section      = iv_section

         IMPORTING

           et_uibb         = lt_uibbs

       ).


Your  lt_uibbs will contains details of UIBB which you want to hide.


3- Get details from this table

IF lt_uibbs IS NOT INITIAL.

     READ TABLE lt_uibbs INTO es_uibb WITH KEY config_id   = is_config_key-config_id

                                               config_type = is_config_key-config_type

                                               config_var  = is_config_key-config_var

                                               instance_id = iv_instance_id.

   ENDIF.


4- Once you get details you ca simply hide UIBB as follows

use below to Hide

           ls_uibb-hidden         = if_fpm_constants=>gc_hidden-technical.

use below to show

           ls_uibb-hidden         = if_fpm_constants=>gc_hidden-not_hidden.

5- Call method to hide it

DATA : lo_ovp TYPE REF TO cl_fpm_ovp.

lo_ovp ?= mo_ovp.


   CHECK lo_ovp IS BOUND.

   TRY.

       lo_ovp->mv_changeable_by_application = abap_true.

       CALL METHOD lo_ovp->change_uibb

         EXPORTING

           is_uibb    = is_uibb

           iv_section = iv_section.

     CATCH cx_fpm_floorplan        ##no_handler.    " Floorplan exceptions

   ENDTRY.

Hope this will help-

Thanks-

Abhishek


Former Member
0 Kudos

Hi Abhishek,

Spot on !  

Many thanks,

Saikat

Answers (1)

Answers (1)

0 Kudos


Hello Saikat,

If my understanding is right you are trying to make an UIBB element hidden based on a dropdown list selection.

In this case you can add a method to the event section of the dropdown list(layout tab) and try to hide the UIBB element in that method or try writing the same code in modifyview method.

Thank you,

Anish

Former Member
0 Kudos

Hi Anish,

Thank you for your reply.

I am not trying to just hide the elements hidden but also the whole UIBB. If it would have just been elements, that could have easily been done in get_data/process_event method. But here I am trying to make the whole UIBB disappear.

Any ideas?

Thanks,

Saikat