Skip to Content
avatar image
Former Member

ALV OO: how to handle events from two alv_grids ?

Hi guys!

hope someone can help me out.

In my program i have three dynpros with differt alv of cl_gui_alv_grid.

In each of these grids i want to implement a "handle_double_click" event.

How can i do this?

acually i have my class lcl_event_receiver and there i have implemented the handle_double_click method.

but how can i figure out which grid triggered the event?

in each dynpro i have

SET HANDLER event_receiver->handle_double_click FOR grid1.

SET HANDLER event_receiver->handle_double_click FOR grid2.

SET HANDLER event_receiver->handle_double_click FOR grid3.

now in the class implementation i need something like

if grid 1 X

if grid 2 Y

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 23, 2008 at 12:15 PM

    using the sender addition you can differentiate.

    double_click         for event double_click
                             of cl_gui_alv_grid
                             importing e_row
                                       e_column
                                       es_row_no
                                       sender,    "<====This can be used

    sender hold the Current Grid reference , based on that you can differentiate.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 12:24 PM

    thanks for that

    but i can't find the information in "sender" which helps me.

    can you show me where it is?

    how can i figure out if the caller is e.g. "grid1"

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 12:29 PM

    Hi,

    Instead of using different double click even

    use the below method to get selected row and based on that go for next detail display in user command

    * Get selected Rows to Update New Entries
      CALL METHOD g_alvgrid->get_selected_rows
        IMPORTING
          et_index_rows = i_index_rows.

    It will be helpful.

    Regards,

    Nandha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2008 at 12:36 PM

    it works like this

    Data:

    grid1 TYPE REF TO cl_gui_alv_grid.

    in the handle_double_click method you can do

    if sender = grid1.

    this works!

    thanks

    Add comment
    10|10000 characters needed characters exceeded