Application Development and Automation 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: 
Read only

ALV grid new button

Former Member
0 Likes
1,015

Hi Gurus,

I make an alv with  cl_gui_alv_grid I'd like to disable the alv original toolbar and I'd like to add one new button.

How can I do this?

Now I made this:

DATA: lt_toolbar      TYPE ttb_button.

class lcl_alv_grid  DEFINITION create public INHERITING FROM cl_gui_alv_grid.
   PUBLIC SECTION.
     methods m1.
endclass.

class lcl_alv_grid IMPLEMENTATION.
     method m1.

       CALL METHOD  SET_TOOLBAR_BUTTONS
       EXPORTING

         TOOLBAR_TABLE = lt_toolbar.

     ENDMETHOD.
endclass.


If I CREATe the local class before my Creat Object cl_gui_custom_container, my toolbar is apering but the alv is not If I create the my object after cl_gui_custom_container the alv grid is showed well but my toolbar is not.

Do you have any idea/ hint?

If you have other way to make button to alv please say this!


Really Thanks,

Mark

1 ACCEPTED SOLUTION
Read only

former_member201285
Active Participant
0 Likes
934

Deactivation of the standard toolbar:

DATA: wa_layout TYPE lvc_s_layo.

      wa_layout-no_toolbar = 'X'.

    CALL METHOD grid->set_table_for_first_display
      EXPORTING
        i_structure_name = ...

        is_layout        = wa_layout
      CHANGING
        it_outtab        = ...
        it_fieldcatalog  = ...

Add a new button by using event TOOLBAR of class CL_GUI_ALV_GRID (implement a suitable event-handler)

There's no need to use inheritance here.

Hi Gurus,

I make an alv with  cl_gui_alv_grid I'd like to disable the alv original toolbar and I'd like to add one new button.

How can I do this?

Now I made this:

DATA: lt_toolbar      TYPE ttb_button.

class lcl_alv_grid  DEFINITION create public INHERITING FROM cl_gui_alv_grid.
   PUBLIC SECTION.
     methods m1.
endclass.

class lcl_alv_grid IMPLEMENTATION.
     method m1.

       CALL METHOD  SET_TOOLBAR_BUTTONS
       EXPORTING

         TOOLBAR_TABLE = lt_toolbar.

     ENDMETHOD.
endclass.


If I CREATe the local class before my Creat Object cl_gui_custom_container, my toolbar is apering but the alv is not If I create the my object after cl_gui_custom_container the alv grid is showed well but my toolbar is not.

Do you have any idea/ hint?

If you have other way to make button to alv please say this!


Really Thanks,

Mark

5 REPLIES 5
Read only

former_member201285
Active Participant
0 Likes
935

Deactivation of the standard toolbar:

DATA: wa_layout TYPE lvc_s_layo.

      wa_layout-no_toolbar = 'X'.

    CALL METHOD grid->set_table_for_first_display
      EXPORTING
        i_structure_name = ...

        is_layout        = wa_layout
      CHANGING
        it_outtab        = ...
        it_fieldcatalog  = ...

Add a new button by using event TOOLBAR of class CL_GUI_ALV_GRID (implement a suitable event-handler)

There's no need to use inheritance here.

Read only

0 Likes
934

Thanks I'll check this!

Can You say me an example program?

Read only

0 Likes
934

Program  BCALV_GRID_05

Read only

venuarun
Active Participant
0 Likes
934

Hi Mark,

Regards

Arun VS

Read only

Former Member
0 Likes
934

Thanks, it working!