cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding Custom Button Designed in FPM configuration

Former Member
0 Kudos

In My FPM Configuration I have added a custom button for which I have assigned the event and its working successfully.

Now My requirement is to hide the button Depending on certain condition by doing coding.

For example : if Condition does not satisfy

Hide the custom button designed in FPM configuration on tool bar

Else.

Display it .

Endif.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

It is specific to FPM and i would appreciate if you post this in FPM forum.

There is a method define_button in IF_FPM_CNR_OIF. Define a attribute in your component controller like this

GO_FPM_OIF	type ref to IF_FPM_CNR_OIF.

Initialize in WDDOINT

wd_this->go_fpm_oif ?= wd_this->go_fpm->get_service( iv_service_key = cl_fpm_service_manager=>gc_key_cnr_oif ).

I do it in PROCESS_BEFORE_OUTPUT but you can do this coding anywhere in your component controller.

call method wd_this->go_fpm_oif->define_button
        exporting
*            iv_variant_id     =
          iv_function       = if_fpm_constants=>gc_button-other_function
          iv_element_id     = 'Your button id'
*            iv_sequence_id    =
*            iv_design         =
          iv_enabled        = abap_false
*            iv_explanation    =
*            iv_on_action      =
*            iv_text           =
          iv_tooltip        = 'Your tooltip'
*            iv_visibility     =
*            iv_default_button =
          .

Answers (1)

Answers (1)

Former Member
0 Kudos

Found a way to hide based on condition ...

matteo_montalto
Contributor
0 Kudos

Hello, could you please explain how did you get it to work? I'm facing a similar issue, that is dynamic hide & restore of an FPM button ...

Former Member
0 Kudos

Hi Matteo Montalto

Go to your FPM component in that find the Page header view where tool bar will be present.

In that go to hook method modify view, you can always code to hide the Button depending upon certain condition .

For eg..

you will find this code by SAP present in wd_do_modifyview

IF lv_close_supported = abap_false. "This code is for hiding Close button

wd_assist->mv_hide_close_button = abap_true.

ENDIF.

like this you can Maintain your own condition and and your Button you can hide it .