cancel
Showing results for 
Search instead for 
Did you mean: 

How to Hide a button (FPM) in webdynpro

former_member183835
Participant
0 Kudos

Hi Experts,

My req is regarding FPM. Actually in my view, I have some buttons like SUBMIT CHECK EDIT etc.

What I want is with some condition I have to hide SUBMIT button from the view when populating the view.

I wrote the below code in the WDINIT of the view, but it is giving an error, that is attached below.

Please help....

Error :-

Accepted Solutions (1)

Accepted Solutions (1)

TusharShinde
Active Participant
0 Kudos

Check in ST22 Short Texts, what exactly is the cause of error.

Also, before calling define_button( ) , check if the instance you mentioned wd_this->go_fpm_oif is bound or not. for e.g.

if wd_this->go_fpm_oif is bound.

   wd_this->go_fpm_oif->define_button(....)...

endif.

Try possibly with below code and do let us know.

*----Get a handle to the CNR.

DATA LO_CNR_OIF     TYPE REF TO IF_FPM_CNR_OIF.  

lo_cnr_oif ?= cl_fpm_service_manager=>get_service( cl_fpm_service_manager=>gc_key_cnr_oif ).

*---Hide FPM close-button
  DATA lt_buttons TYPE if_fpm_cnr_oif=>t_button.
lo_cnr_oif->get_buttons(
    EXPORTING
      iv_variant_id = 'v1' "Variant is generally available at Comp Configuration Level
    IMPORTING
      et_buttons = lt_buttons ).

"Hiding Close Button, Same in above internal table lt_buttons you will get your Submit Button FUNCTION & ELEMENT_ID so as to

"control visibility.

lo_cnr_oif->define_button(
    EXPORTING
      iv_function   = if_fpm_constants=>gc_button-close
      iv_visibility = cl_wd_uielement=>e_visible-none ).

Thanks & Regards

Tushar S.

former_member183835
Participant
0 Kudos

Hi Thushar,

My issue is solved...

Thank you .....

Actually the code which you have given is for EDIT button. But my requirement was SUBMIT button. As SUBMIT button was not standard button I made a small change in the code and it is working fine now.

In the method define_button,

lo_cnr_oif->define_button(

    EXPORTING

      iv_function   = if_fpm_constants=>gc_button-alternate_function

        iv_element_id  = 'SUBMIT' " Event id of my Button

      iv_visibility = cl_wd_uielement=>e_visible-none ).

Thanks to all for valuable suggestions ........

Anoop Satheesan

Answers (2)

Answers (2)

kashif_bashir
Explorer
0 Kudos

Shouldn't be difficult if you are using OVP pattern. You can probably get the parameters in

PROCESS_EVENT

GET_DATA

methods of your FEEDER CLASS.

Does that make sense ?

Former Member
0 Kudos

You can hide the button in the FPM configuration itself. Why you need to write the code?

Also post your question in FPM or Webdynpro forum to get maximum response

former_member183835
Participant
0 Kudos

Hi Bhanu,

Actually I have some condition. Thats why...

If the user is not having MANAGER ROLE, then the SUBMIT button shuld be hidden.

And I couldn't find FPM or WD forum....

Thanks,

Anoop

Former Member
0 Kudos

Then the get_service calls returns null values so it leads to short dump.

Can you try modifyview

Here is the link to

http://scn.sap.com/community/web-dynpro-abap/floorplan-manager