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: 

How can I use the method, get_selected_rows

Former Member
0 Kudos

CALL METHOD <ref.var. to CL_GUI_ALV_GRID > ->get_selected_rows

IMPORTING

ET_ROW_NO = <internal table of type LVC_T_ROID > .

When I get the selected rows, afterwards I need to read the itab value according to rowid and then send this value to a screen.

How can I process the first selected row of the selected ones.

Thanks.

Deniz.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think I have to loop through the returned ids itab but

Loop into what???

endloop.

I did not understand that.

And what is the index like keyword of the what???-index or ?

I did not expressed it so well, sorry...

Thanks.

Deniz.

3 REPLIES 3

Former Member
0 Kudos

I think I have to loop through the returned ids itab but

Loop into what???

endloop.

I did not understand that.

And what is the index like keyword of the what???-index or ?

I did not expressed it so well, sorry...

Thanks.

Deniz.

Former Member
0 Kudos

Hi...

The following code may help u...

data:it_selected_rows TYPE lvc_t_row, "To get Selected rows from ALV

DATA:lit_cell TYPE lvc_t_cell, "Selected cell

        • To get Selected rows from ALV

CALL METHOD g_ref_alv_grid_summary->get_selected_rows

IMPORTING

et_index_rows = it_selected_rows.

IF it_selected_rows[] IS INITIAL.

****Get the row in focus

CALL METHOD g_ref_alv_grid_summary->get_selected_cells

IMPORTING

et_cell = lit_cell.

IF NOT lit_cell[] IS INITIAL.

READ TABLE lit_cell INTO lwa_cell INDEX 1.

wa_row = lwa_cell-row_id.

APPEND wa_row TO it_selected_rows.

ENDIF.

ENDIF.

Regards,

Pavani

Former Member
0 Kudos

hi,

CALL METHOD ref_alv->get_selected_rows

IMPORTING

et_index_rows = it_row

it will give you the rows which are selected to it_row table.

check the theards

https://forums.sdn.sap.com/click.jspa?searchID=3330780&messageID=2919805

https://forums.sdn.sap.com/click.jspa?searchID=3330780&messageID=117833

Regards