07-28-2023 1:05 PM
Hello Experts,
I try to select a entry of a table using the class "cl_gui_alv_grid". When I select the first entry and push a button and go through my code, working with the entry, it works perfectly fine. But the second time it wont select the entry or rather the table lt_selected_rows is empty. Heres my code:
CALL METHOD grid1->get_selected_rows
IMPORTING
et_index_rows = lt_selected_rows.
CASE lines( lt_selected_rows ).
WHEN 0.
MESSAGE 'Please select entry' TYPE 'I' DISPLAY LIKE 'E'.
WHEN 1.
READ TABLE gt_output INTO ls_output INDEX lt_selected_rows[ 1 ]-index.
WHEN OTHERS.
MESSAGE 'Please select one entry' TYPE 'I' DISPLAY LIKE 'E'.
ENDCASE.
Your help would be appreciated
07-28-2023 2:10 PM
I guess the problem is that you have re-instantiated the ALV grid. Only the first-instantiated grid is displayed, the next ones are lost somewhere... I mean grid1 is referencing the one which is not displayed, so there are no selected rows.