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

Handling Multiple ALV Grids

Former Member
0 Likes
601

Moderator message: do not post the same question in more than one forum. Duplicate has been rejected

Hi,

I have 3 ALV Grids in my reports done by using containers with CL_GUI_ALV_GRID....

Each ALV Grid display a table....

Each toolbar of the grid has a print button.....

Here i have 2 questions...

i) when a print button of a grid is pressed..how can i know the grid of which the print button is pressed...i.e. if grid one print button is pressed..then how can i know it is triggered from Grid one and likewise for grid 2 and grid 3.

Im using same method for the event user_command for the three grids.......

ii) WHen layout is changed for a particular ALV grid...i.e. if some columns are made hidden...then when print button is pressed..Then i need to print only the columns of changed layout.............

How can i know the columns of the changed layout..........

<<Forbidden phrase removed>>

Thanks in Advanceeee

Sai Santosh

Edited by: Matt on Dec 15, 2008 3:45 PM

Moderator message: do not post the same question in more than one forum. Duplicate has been rejected

Hi,

I have 3 ALV Grids in my reports done by using containers with CL_GUI_ALV_GRID....

Each ALV Grid display a table....

Each toolbar of the grid has a print button.....

Here i have 2 questions...

i) when a print button of a grid is pressed..how can i know the grid of which the print button is pressed...i.e. if grid one print button is pressed..then how can i know it is triggered from Grid one and likewise for grid 2 and grid 3.

Im using same method for the event user_command for the three grids.......

ii) WHen layout is changed for a particular ALV grid...i.e. if some columns are made hidden...then when print button is pressed..Then i need to print only the columns of changed layout.............

How can i know the columns of the changed layout..........

<<Forbidden phrase removed>>

Thanks in Advanceeee

Sai Santosh

Edited by: Matt on Dec 15, 2008 3:45 PM

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
402

1 - In local class definition, use the [SENDER|http://help.sap.com/saphelp_nw04s/helpdata/en/71/a8a77955bc11d194aa0000e8353423/frameset.htm] parameter of the event you manage.

CLASS lcl_event_receiver DEFINITION.
  PUBLIC SECTION.
    METHODS:
      handle_double_click
        FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING e_row e_column sender.
  PRIVATE SECTION.
ENDCLASS.

Then in the implemented method check the value, or use the object sender like any alv grid object.

CLASS lcl_event_receiver IMPLEMENTATION.
  METHOD handle_double_click.
    CASE sender.
      WHEN grid1.

(Doc: [Event Handling|http://help.sap.com/saphelp_sm32/helpdata/EN/9b/d080b49fc111d2bd68080009b4534c/frameset.htm])

2-use the method [GET_FRONTEND_FIELDCATALOG|https://www.sdn.sap.com/irj/scn/advancedsearch?query=get_frontend_fieldcatalog&cat=sdn_all] of CL_GUI_ALV_GRID to get the curent layout.

Regards