02-04-2009 8:27 AM
Hello All,
I have used alv_grid to display records in a transaction.
I need to program alv_grid to remove/delete the menu-bar of alv.
I have done object-oriented programming. I looked for methods, but DELETE_ALL_MENUS turned out to be a private method.
Kindly help.
Thanks.
02-04-2009 8:35 AM
02-04-2009 8:45 AM
hi,
IS_LAYOUT-NO_TOOLBAR = 'X' in method CALL METHOD < ref. var. to CL_GUI_ALV_GRID> ->set_table_for_first_display.
thanks
03-31-2009 7:35 AM
Hello,
IS_LAYOUT is a structure. I could'nt set No_toolbar property directly in method.
Please suggest how to pass the value in the method < set_table_for_first_display>.
I tried to take a variable of type LVC_S_LAYO and pass it in method call, but could'nt do it
successfully.
Thanks.
Ushma
03-31-2009 7:46 AM
Try like this.
create a structure & pass this to method as below
DATA: w_layout TYPE lvc_s_layo,
w_layout-NO_TOOLBAR = 'X'.
CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'TYPE_VBRK'
IS_LAYOUT = W_LAYOUT <<<<<<<<<<<<<< Pass layout here
IS_VARIANT = W_VARIANT
I_SAVE = 'A'
IT_TOOLBAR_EXCLUDING = W_EX_FUNC
CHANGING
IT_OUTTAB = T_VBRK[]
IT_FIELDCATALOG = W_FLD_CATALOG.
03-31-2009 8:20 AM
Hi
Just implement the method HANDLE_TOOLBAR, there delete all the menus as below.
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_toolbar
FOR EVENT toolbar OF cl_gui_alv_grid
IMPORTING e_object e_interactive.
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_toolbar.
REFRESH: e_object->mt_toolbar. " It will remove ALV tool bar
ENDMETHOD.
ENDCLASS. "lcl_eventhandler IMPLEMENTATION