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: 

Underlying Table Line in Grid after Filter

mike_mcinerney
Participant
0 Kudos

Easy Question.

When I present a table in an alv grid, I allow the user to double click to perform additional operations on the record.

The double click is handled as follows....


* --- Get the row index ---
call method obj_alv_grid->get_current_cell
      importing
        e_row     = cc_index
        es_col_id = cc_col_id.

* --- Get the underlying row
    read table t_outtab index cc_index into wa_outtab .

* --- subsequent code
   ...

Lets say my t_outtab has 12 records, labeled, in order, January-December.

When I select June, cc_index would be set to 6.

But, lets say the user filters the data so that only Apr, May, and Jun are shown.

When June is selected, cc_index is set to 3 (as it is the 3rd record shown).

This messes up my subsequent read.

How do I know the index into the underlying data table. ?

Thanks...

...Mike

1 REPLY 1

mike_mcinerney
Participant
0 Kudos

So, it seems this was easy.

I should be looking at the e_row imported with the event


class lcl_event_receiver definition .
  public section .
    methods on_double_click
    for event double_click
    of cl_gui_alv_grid
    importing e_row e_column es_row_no sender