2012 Apr 04 9:28 PM
Hi!
I´m using class CL_GUI_ALV_GRID in my screen.
I created a STATUS-GUI with button in toolbar. When i click in this button, in PAI i execute method get_selected_rows to get lines selected. In the first time that i click on this button this method work fine. But in another time it not work, importing table return null. Why? How can i resolve that?
Please, help me!
2012 Apr 04 11:22 PM
Check out the sample report : BCALV_EDIT_05
In the PAI module you need to invoke the method to get selected rows:
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EDIT'.
DATA: v_ridx TYPE lvc_t_row.
CALL METHOD g_grid->get_selected_rows <<<<<<< Get Rows Selected (Row Index)
IMPORTING
et_index_rows = v_ridx.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Points to remember while using the method:
2012 Apr 04 11:22 PM
Check out the sample report : BCALV_EDIT_05
In the PAI module you need to invoke the method to get selected rows:
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'EDIT'.
DATA: v_ridx TYPE lvc_t_row.
CALL METHOD g_grid->get_selected_rows <<<<<<< Get Rows Selected (Row Index)
IMPORTING
et_index_rows = v_ridx.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Points to remember while using the method:
2012 Apr 04 11:23 PM
Without reviewing your code, my first thought is that you are not re-initializing your variables after the first selection, or you are not setting the values for subsequent clicks. Set a debug and check what the values are during the first click. Then click again and compare the first set of values to the values on subsequent clicks. If you are using loop counters, be sure to check those for reinitializing also.
mr.kim