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: 

Object oriented ALV..get_selected_rows not working...URGENT !!!

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

gabriel_braun
Explorer
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Hi,

Thanks for solving my problem..

KK