Skip to Content

Show/Hide and/or Enable/Disable UIBB FORM

Hi guru,

i would ask for you a help.

I'm new on FPM and i apologise for my question.

I want to show/hide and or Enable /Disable an entire UIBB form depending on role of user who logged on.

Could anyone explain me all steps?

Must i replace the feeder class of UIBB form with a custom one inherited from standard?

In few words, could you explain me step by step the procedure to solve this issue?

Thank you in advance

Fabio

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 30, 2015 at 11:38 AM

    Hi Pierfabio,

    For hiding UIBB you need to do below steps:

    1. First you need to find details of all your UIBB on Page
    2. Then you need to find out which UIBB you are interested in to HIDE/SHOW
    3. Then you need to retrive details of that specific UIBB
    4. Then you will set HIDDEN property of that UIBB if you want to hide it
    5. Then you will again update UIBB settting

    Below is demo code to achieve :

    mo_ovp typr ref to IF_FPM_OVP.

    CHECK mo_ovp IS BOUND.

    TRY .

          mo_ovp->get_uibbs(

            EXPORTING

              iv_content_area = <your content area name / Page name here>

              iv_section      = <your section id>

            IMPORTING

              et_uibb         = lt_uibbs "here you will get all the settings for that UIBB

          ).

        CATCH cx_fpm_floorplan.    " Floorplan exceptions

          RETURN.

      ENDTRY.

    In lt_uibb you will get settings of all the controls available you need to put read on this

    table and find out uibb of your interest based on config_id etc.

    Read table lt_uibb into ls_uibb with key config_id = <your config iD of UIBB>.

    you should get only one record in this , once you get this Information then set HIDDEN

    property of this UIBB

    ls_uibb-hidden = 'T'. " T is for hidden type FPM_HIDDEN type.

    Once you set this property you again need to update your UIBB as below

    DATA : lo_ovp TYPE REF TO cl_fpm_ovp.

    CALL METHOD lo_ovp->change_uibb

            EXPORTING

              is_uibb    = ls_uibb

              iv_section = <your section name>.

    Your UIBB will be hidden.

    Thanks-

    Abhishek

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 30, 2015 at 06:10 PM

    Hello Fabio,

    See the five steps below....

    1. Create a global class that is to be used as your application controller.

    2. In this class, implement the interface IF_FPM_OV_CONF_EXIT.


    3. In the interface method, IF_FPM_OVP_CONF_EXIT~OVERIDE_EVENT_OVP, add code similar to the following:

         DATA: lo_event TYPE REF TO cl_fpm_event,

                     lv_role    TYPE string.

         * Get current event ----------------------------------------------

             lo_event = io_ovp->get_event( ).

         * Get user role ---------------------------------------------------

            lv_role =   << logic to get the user's role goes here>>>

          * Determine action based on event id ---------------------

         TRY.

              CASE lo_event->mv_event_id.

                   WHEN cl_fpm_event=>gc_event_leave_initial_screen.

                        me->maintain_uibb( EXPORTING io_ovp = io_ovp

                                                                               iv_role = lv_role ).

                    WHEN OTHERS.

                        ......

              ENDCASE.

             

              CATCH cx_fpm_floorplan.......

         ENDTRY.

    4. New custom method MAINTAIN_UIBB:

         DATA: lt_uibb      TYPE if_fpm_ovp=>ty_t_uibb,

                     lv_hidden(1) TYPE c.

         * Set variable based on user role

        IF iv_role = <<< your value goes here >>>.

              lv_hidden = abap_true.

         ELSE.

               lv_hidden = abap_false.

         ENDIF.

         * Get UIBBS -------------------------------

         io_ovp->get_uibbs( IMPORTING it_guibb = lt_guibb )


         * Set attribute

         READ TABLE lt_uibb ASSIGNING <uibb> WITH KEY <<your value goes here>>.

         IF sy-subrc IS INITIAL.

              <uibb>-hidden = lv_hidden.

              io_ovp->change_uibb( is_uibb = <uibb> ).

          ENDIF.

         endmethod.

    5. Add Application Controller in configuration.

    • In Component Configuration for Main Page, get context menu for 'Floorplan Settings'.  This button is found in the 'General Settings' section .
    • In the context menu choose ' Application Controller Settings'.
    • In the pop-up menu,  in entry for 'Web Dynpro Component',  enter the class that was created in Step 1 & save. 

    That's it.

    Best regards,

    Kim Carmack

    Add comment
    10|10000 characters needed characters exceeded