Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2756

Re: Show/Hide and/or Enable/Disable UIBB FORM

$
0
0

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


Viewing all articles
Browse latest Browse all 2756

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>