Skip to Content
2
Dec 04, 2009 at 12:19 PM

Disabling / Enabling a cutom button on the toolbar

4978 Views

Hi,

I'm using the new way to do ALV grids - I have a customised button called 'DIRECT' on the toolbar but dont know how to disable it have tried to use the CL_SALV_FUNCTIONS->remove_function method but it keeps on coming back with an exception stating that I am using a wrong call

data: gt_table   type ref to cl_salv_table.
  data: l_t100     type t100,
        l_save(10).
  data: gr_layout  type ref to cl_salv_layout.
  data: key        type salv_s_layout_key.
 
  try.
      cl_salv_table=>factory(
        importing
          r_salv_table = gt_table
        changing
          t_table      = it_boc_document ).
    catch cx_salv_msg.                                
  endtry.
 
  gr_layout = gt_table->get_layout( ).
  key-report = sy-repid.
  gr_layout->set_key( key ).
 
  gr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
 
  "Set the pf-status
  try.
      gt_table->set_screen_status(
        pfstatus      =  'ALV_STATUS'
        report        =  sy-repid
        set_functions = gt_table->c_functions_all ).
    catch cx_salv_msg.                          
  endtry.
 
  gt_table->display( ).

Any help would be appreciated.

Many thanks in advance

Raj