Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Removing menu-bar from alv in module

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

hiii

please refer to following link

[ALV|]

i hope it can solve your problem.

regards

twinkal

Former Member
0 Kudos

hi,

IS_LAYOUT-NO_TOOLBAR = 'X' in method CALL METHOD < ref. var. to CL_GUI_ALV_GRID> ->set_table_for_first_display.

thanks

0 Kudos

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

0 Kudos

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.

asik_shameem
Active Contributor
0 Kudos

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