cancel
Showing results for 
Search instead for 
Did you mean: 

FPM OVP buttons not visible

Former Member
0 Kudos

Dear FPM Experts,

I have one FPM OVP tool bar button (Named : Submit) which is "not visible" by default.Based on some condition, i need to make that submit button visible.

For make it visible,here is my code

DATA : lo_fpm  TYPE REF TO if_fpm  .

      DATA : lo_fpm_cnr_ovp TYPE REF TO if_fpm_cnr_ovp.
      lo_fpm = cl_fpm_factory=>get_instance( ).
      lo_fpm_cnr_ovp ?= lo_fpm->get_service( if_fpm_constants=>gc_service_key-cnr_ovp ).
      DATA lw_button        TYPE if_fpm_ovp=>ty_s_toolbar_button.
      DATA lw_content_areas   TYPE        if_fpm_ovp=>ty_s_content_area.

      "Show toolbar buttons

      TRY.
          "Show toolbar buttons
          CALL METHOD lo_fpm_cnr_ovp->get_toolbar_button
            EXPORTING
             iv_toolbar_element_id = 'SUBMIT_ID'    " FPM: Element ID
            IMPORTING
             es_toolbar_button     = lw_button.   " Toolbar button attributes
        CATCH cx_fpm_floorplan.    " Floorplan exceptions
      ENDTRY.

      lw_button-visibility = 02. "Is Visible

      TRY.
          CALL METHOD lo_fpm_cnr_ovp->change_toolbar_button
            EXPORTING
              is_toolbar_button = lw_button. " Toolbar button attributes
        CATCH cx_fpm_floorplan.    " Floorplan exceptions
      ENDTRY.

but the submit button is not getting visible for the above code.Pls guide me what i'm missing.

Note : In my scenario,IF_FPM_CNR_OVP interface does not have method : Define_method()

Thanks

Katrice

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Katrice,

you have to implement the method OVERRIDE_EVENT_OVP from the Comp-Interface IF_FPM_OVP_CONF_EXIT.

Here you get the FPM OVP-Object:

With this object you can change all UI-Elements of the OVP.

Coding_exampel to enable/disable buttons:

SET_BUTTON_ENABLE

METHOD SET_BUTTON_ENABLE .

   DATA:

       LT_TOOLBAR_OVP_BUTTON TYPE IF_FPM_OVP=>TY_T_TOOLBAR_BUTTON,

       LS_TOOLBAR_OVP_BUTTON TYPE IF_FPM_OVP=>TY_S_TOOLBAR_BUTTON,

       LS_CONTENT_AREA       TYPE IF_FPM_OVP=>TY_S_CONTENT_AREA,

       LT_TOOLBAR_OVP        TYPE IF_FPM_OVP=>TY_T_TOOLBAR_ELEMENT,

       LS_TOOLBAR_OVP        TYPE IF_FPM_OVP=>TY_S_TOOLBAR_ELEMENT,

       LV_BUTTON_ENABLE      TYPE BOOLEAN.

   IF <condition> = abap_true.

     LV_BUTTON_ENABLE = ABAP_FALSE.

   ELSE.

     LV_BUTTON_ENABLE = ABAP_TRUE.

   ENDIF.

   IF IO_OVP IS BOUND.

     TRY .

*           Get next content area

         LS_CONTENT_AREA = IO_OVP->GET_CURRENT_CONTENT_AREA( ).

         IO_OVP->GET_TOOLBAR_ELEMENTS(

           EXPORTING

             IV_CONTENT_AREA           = LS_CONTENT_AREA-ID

           IMPORTING

             ET_TOOLBAR_ELEMENT        = LT_TOOLBAR_OVP ).

       CATCH CX_FPM_FLOORPLAN.    " Floorplan exceptions

     ENDTRY.

     IF NOT LT_TOOLBAR_OVP[] IS INITIAL.

       LOOP AT LT_TOOLBAR_OVP INTO LS_TOOLBAR_OVP.

         TRY.

             IF LS_TOOLBAR_OVP-TYPE = IF_FPM_CONSTANTS=>GC_TOOLBAR_ELEMENT_TYPE-BUTTON.

               IO_OVP->GET_TOOLBAR_BUTTON(

                 EXPORTING

                   IV_CONTENT_AREA           = LS_CONTENT_AREA-ID

                   IV_TOOLBAR_ELEMENT_ID     = LS_TOOLBAR_OVP-ELEMENT_ID

                 IMPORTING

                   ES_TOOLBAR_BUTTON         = LS_TOOLBAR_OVP_BUTTON ).

             ENDIF.

           CATCH CX_FPM_FLOORPLAN.    " Floorplan exceptions

         ENDTRY.

         LS_TOOLBAR_OVP_BUTTON-ENABLED = LV_BUTTON_ENABLE.

         IF  LS_TOOLBAR_OVP-ELEMENT_ID = '<Element_ID>'.

           TRY .

               IO_OVP->CHANGE_TOOLBAR_BUTTON(

                                EXPORTING

                                  IS_TOOLBAR_BUTTON           = LS_TOOLBAR_OVP_BUTTON

                              ).

             CATCH CX_FPM_FLOORPLAN.    " .

           ENDTRY.

         ENDIF.

       ENDLOOP.

     ENDIF.

   ENDIF.

ENDMETHOD.

In the same way you can set the buttons visibility or other propertys.



LS_TOOLBAR_OVP_BUTTON -VISIBILITY = 02.

Regards
Shkelqim

Former Member
0 Kudos

HI Katrice,

Code seeems to be ok for your requirement. But Quick question here where have you placed this coding..?? In your feeder class or in APPCC(Application controller class).

If you have placed it in your feeder class then it's overridden by APPCC class.

Advantage of placing it in appcc you don't have to create cnr_ovp instance in class. you can make use of io_ovp instance which is provided by framework.

Thanks & Regards

Praveen Gupta