How to Hide a button (FPM) in webdynpro
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.
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.
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.
iv_variant_id = 'v1' "Variant is generally available at Comp Configuration Level
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
iv_function = if_fpm_constants=>gc_button-close
iv_visibility = cl_wd_uielement=>e_visible-none ).
Thanks & Regards