05-21-2008 7:37 AM
Hi Experts,
I am using Object oreinted ALV and used set_table_for_first_display to display values and in layout i made SEL_MODE as A.
After displaying the list I want to get the rows that are selected and for this I used the method
CALL METHOD gr_alvgrid->get_selected_rows..
But I am not getting values from either et_index_rows or et_row_no...both of them are initial.
even if I change sel_mode to D , i am not getting the values of selected rows...
Another info......I populated the fieldcatalog manually..
please tell me how I can get the multiple selected rows.
Thanks in Advance,
KK.
05-21-2008 7:50 AM
You have to write the code in the user-command module.you have to get the selected rows. Check in debug if the method is triggered or not. check the following code:
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR:ok_code.
CASE save_ok.
WHEN 'EDIT'.
DATA: i_rowindex TYPE lvc_t_row.
CALL METHOD customer_grid->get_selected_rows
IMPORTING
et_index_rows = i_rowindex.
ET_ROW_NO =
.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Rajesh
05-21-2008 7:45 AM
Hi,
Try this:
DATA: lr_selections TYPE REF TO cl_salv_selections.
DATA: lt_rows TYPE salv_t_row,
l_row TYPE i.
lr_selections = gr_alvtab->get_selections( ).
lt_rows = lr_selections->get_selected_rows( ).
Regards
Gabriel
05-21-2008 7:50 AM
You have to write the code in the user-command module.you have to get the selected rows. Check in debug if the method is triggered or not. check the following code:
MODULE user_command_0100 INPUT.
save_ok = ok_code.
CLEAR:ok_code.
CASE save_ok.
WHEN 'EDIT'.
DATA: i_rowindex TYPE lvc_t_row.
CALL METHOD customer_grid->get_selected_rows
IMPORTING
et_index_rows = i_rowindex.
ET_ROW_NO =
.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Rajesh
05-21-2008 8:31 AM