Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to Hide a button (FPM) in webdynpro

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 :-

Former Member replied

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.

2 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question