cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling/Disabling buttons in GAF step

Former Member
0 Kudos

Hi

My requirement is to Enable / Disable a Toolbar element (button) in GAF based on the data.

How can i do it?

Regards,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Implement interface 'IF_FPM_GAF_CONF_EXIT' in your WD Comp.

In method 'OVERRIDE_EVENT_GAF' in your Comp Controller.

Get the required button using method  'GET_TOOLBAR_BUTTON' of IO_GAF.

Change the required property and then call method 'CHANGE_TOOLBAR_BUTTON' to pass changes to FPM.

Former Member
0 Kudos

Hi Hitesh,

Thank u immediate reply.

My GAF Appl is completely using GUIBBs. I am not using WD Component. In my 1st step i have a list GUIBB where user can choose one record and click on the next button. In the next(2nd) step i have define 2 buttons which i need to enable / disable based on the selection in the first step. I achieved this by writing the below code in GET_DATA method.

DATA: lo_fpm      TYPE REF TO if_fpm,

         lo_cnr_gaf  TYPE REF TO cl_fpm_cnr_gaf, "if_fpm_cnr_gaf,

         lv_step_id  TYPE string,

         ls_buttons  TYPE if_fpm_cnr_gaf=>s_button,

         lt_buttons  TYPE if_fpm_cnr_gaf=>t_button,

         lv_enable   TYPE boole_d.

   lo_fpm = cl_fpm_factory=>get_instance( ).

   lo_cnr_gaf ?= lo_fpm->get_service( cl_fpm_service_manager=>gc_key_cnr_gaf ).

   lv_step_id = 'STEP_NAME'.

   lo_cnr_gaf->if_fpm_cnr_gaf~get_buttons( EXPORTING  iv_mainstep_id = lv_step_id

                            IMPORTING  et_buttons = lt_buttons ).

DELETE lt_buttons WHERE function NE 'OTHER_FUNCTIONS'.

   LOOP AT lt_buttons INTO ls_buttons.

     IF gs_p9008_ew-zzsts_checklist = '03'.

       lv_enable = abap_false.

     ELSE.

       lv_enable = abap_true.

     ENDIF.

     lo_cnr_gaf->if_fpm_cnr_gaf~define_button( iv_function    = ls_buttons-function

                                iv_element_id  = ls_buttons-element_id

                                iv_enabled     = lv_enable ).

   ENDLOOP.

But the problem is, if the user proceed to the 3rd step directly w/o going to 2nd Step, there are two additional blank buttons appearing in the 3rd step. These are coming becoz of the above code.

So how can i achieve this w/o effecting the other steps?

Regards,

Srinivasa

 

Former Member
0 Kudos

Try Passing value for parameter 'IV_MAINSTEP_ID' in 'DEFINE_BUTTON'.

Former Member
0 Kudos

Yes Hitesh, i missed that parameter. thank u .

Answers (0)