Skip to Content
avatar image
Former Member

How to change button position dynamically in fpm

Hi Guys,

  

            this is siva i am developed a toolbar button(button choice) dynamically but i want to change my button position in  fpm toolbar  can you please send me the fast reply  regarding this .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Mar 09, 2016 at 04:13 PM

    Hi,

    you have to implement the method OVERRIDE_EVENT_OVP from the Comp-InterfaceIF_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:

    SET_BUTTON_POSITION

    METHOD SET_BUTTON_POSITION . 

    1.    DATA: 
    2.        LT_TOOLBAR_OVP_BUTTON TYPE IF_FPM_OVP=>TY_T_TOOLBAR_BUTTON, 
    3.        LS_TOOLBAR_OVP_BUTTON TYPE IF_FPM_OVP=>TY_S_TOOLBAR_BUTTON, 
    4.        LS_CONTENT_AREA       TYPE IF_FPM_OVP=>TY_S_CONTENT_AREA, 
    5.        LT_TOOLBAR_OVP        TYPE IF_FPM_OVP=>TY_T_TOOLBAR_ELEMENT, 
    6.        LS_TOOLBAR_OVP        TYPE IF_FPM_OVP=>TY_S_TOOLBAR_ELEMENT,
    7.        LV_BUTTON_POSITION   TYPE  I,
    8.        LV_BUTTON_ENABLE      TYPE BOOLEAN.

    9.    IF <condition> = abap_true. 
    10.      LV_BUTTON_ENABLE = ABAP_FALSE. 
    11.    ELSE. 
    12.      LV_BUTTON_ENABLE = ABAP_TRUE. 
    13.    ENDIF. 
    14.    IF IO_OVP IS BOUND. 
    15.      TRY . 
    16. *           Get next content area 
    17.          LS_CONTENT_AREA = IO_OVP->GET_CURRENT_CONTENT_AREA( ). 
    18.          IO_OVP->GET_TOOLBAR_ELEMENTS( 
    19.            EXPORTING 
    20.              IV_CONTENT_AREA           = LS_CONTENT_AREA-ID 
    21.            IMPORTING 
    22.              ET_TOOLBAR_ELEMENT        = LT_TOOLBAR_OVP ). 
    23.        CATCH CX_FPM_FLOORPLAN.    " Floorplan exceptions 
    24.      ENDTRY. 
    25.      IF NOT LT_TOOLBAR_OVP[] IS INITIAL. 
    26.        LOOP AT LT_TOOLBAR_OVP INTO LS_TOOLBAR_OVP. 
    27.          TRY. 
    28.              IF LS_TOOLBAR_OVP-TYPE = IF_FPM_CONSTANTS=>GC_TOOLBAR_ELEMENT_TYPE-BUTTON. 
    29.                IO_OVP->GET_TOOLBAR_BUTTON( 
    30.                  EXPORTING 
    31.                    IV_CONTENT_AREA           = LS_CONTENT_AREA-ID 
    32.                    IV_TOOLBAR_ELEMENT_ID     = LS_TOOLBAR_OVP-ELEMENT_ID 
    33.                  IMPORTING 
    34.                    ES_TOOLBAR_BUTTON         = LS_TOOLBAR_OVP_BUTTON ). 
    35.              ENDIF. 
    36.            CATCH CX_FPM_FLOORPLAN.    " Floorplan exceptions 
    37.          ENDTRY. 
    38.          LS_TOOLBAR_OVP_BUTTON-INDEX = LV_BUTTON_POSITION
    39.          IF  LS_TOOLBAR_OVP-ELEMENT_ID = '<Element_ID>'. 
    40.            TRY . 
    41.                IO_OVP->CHANGE_TOOLBAR_BUTTON( 
    42.                                 EXPORTING 
    43.                                   IS_TOOLBAR_BUTTON           = LS_TOOLBAR_OVP_BUTTON 
    44.                               ). 
    45.              CATCH CX_FPM_FLOORPLAN.    " . 
    46.            ENDTRY. 
    47.          ENDIF. 
    48.        ENDLOOP. 
    49.      ENDIF. 
    50.    ENDIF. 
    51. ENDMETHOD. 

    In the same way you can set the buttons position or other properties.

    1. ls_toolbar_ovp_button-INDEX = LV_BUTTON_POSITION.

    Regards
    Shkelqim

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Bro,

      here  toolbar is standard  buttons is dynamically created that button in left side  i want move that button choice into right side. that is my requirement  in that button  two actions is thee one i logout and another one is  change password all functionality is working but  wan to chage button position

      please give me reply guys. its urgent.