2018 Jan 04 12:49 PM
Hi,
I wanted to remove the standard buttons coming in ALV GRID
the table is displayed with following code,
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = gt_tab ).
CATCH cx_salv_msg .
I tried the method from post
https://archive.sap.com/discussions/thread/1549378 but it is not working.
Requirement is to remove all standard buttons.
2018 Jan 04 12:55 PM
2018 Jan 04 1:38 PM
Can you post the code you already wrote, using class cl_salv_functions or a similar one?
2020 Dec 06 12:47 PM
Dear All,
To Hide the default tool bar icon in FACTORY method, use below code.
***Below Code is used to set the standard tool bar
* §3.1 activate ALV generic Functions
data: lr_functions type ref to cl_salv_functions_list,
l_text type string,
l_icon type string.
constants gc_true type char1 value 'X'.
lr_functions = go_salv->get_functions( ).
lr_functions->set_all( gc_true ).
***Below Code is used to hide the standard tool bar icons.
try.
lr_functions->remove_function( name = '&GRAPH' ).
" ALV: General Error Class (Checked During Syntax Check)
catch cx_salv_not_found.
"ALV: General Error Class (Checked During Syntax Check)
catch cx_salv_wrong_call
endtry.
2023 Aug 01 1:24 PM
I was looking for a solution to remove the line of the toolbar control with CL_SALV_TABLE, when it's displayed in a container (the same as with LVC_S_LAYO-NO_TOOLBAR = 'X' when using CL_GUI_ALV_GRID), but it seems impossible .
At least, you can remove easily all standard buttons, except the information icon (tested with ABAP 7.57):
Minimal code to reproduce:
REPORT.
PARAMETERS dummy.
AT SELECTION-SCREEN OUTPUT.
IF dummy = ''.
dummy = 'X'.
DATA(modules) = VALUE soli_tab(
( line = |Accounting| )
( line = |Procurement| ) ).
cl_salv_table=>factory( EXPORTING r_container = cl_gui_container=>screen0
IMPORTING r_salv_table = DATA(go_alv)
CHANGING t_table = modules ).
go_alv->get_functions( )->set_all( abap_false ). " <======== SET_ALL( abap_false )
go_alv->display( ).
ENDIF.
NB: for information, what I wanted to achieve is this (if I force the hiding of the toolbar, by debug of CL_SALV_GUI_GRID_FACADE, method if_salv_gui_grid_ui_functions~is_toolbar_visible) or if I use the below code:
REPORT.
PARAMETERS dummy.
AT SELECTION-SCREEN OUTPUT.
IF dummy = ''.
dummy = 'X'.
DATA(modules) = VALUE soli_tab(
( line = |Accounting| )
( line = |Procurement| ) ).
DATA(alv_grid) = NEW cl_gui_alv_grid( i_parent = cl_gui_container=>screen0 ).
alv_grid->set_table_for_first_display(
EXPORTING i_structure_name = 'SOLI'
is_layout = VALUE #( no_toolbar = abap_true )
CHANGING it_outtab = modules
EXCEPTIONS OTHERS = 4 ).
ENDIF.