Application Development and Automation 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: 
Read only

ALV Grid Single Row Selection Only

former_member194669
Active Contributor
0 Likes
316

Hi,

I have a requirement to select a single row in an ALV grid using class

I tried with layout-sel_mode = 'B' its not working, and don't want to use

call method g_grid->get_selected_rows

importing

et_row_no = lt_row_no.

and check for number of rows and giving error message " select only one row".

Is there any other way to tackle this issue

Thanks

aRs

2 REPLIES 2
Read only

Former Member
0 Likes
228

Hi,

DATA:
* Internal table for indexes of selected rows
gi_index_rows TYPE lvc_t_row,
* Information about 1 row
g_selected_row LIKE lvc_s_row.

  CALL METHOD go_grid->get_selected_rows
    IMPORTING
      et_index_rows = gi_index_rows.
  DESCRIBE TABLE gi_index_rows LINES l_lines.

Here the L_Lines will contain the number of rows selected

Regards

Sudheer

Read only

Former Member
0 Likes
228

Hi,

i think its not possible to restrict the selection to one row..with the method..

however in addition to the above code given by sudheer...description of

itab lines..u can flag en error msg stating the user to select only one row..

hope this helps u a bit,

all the best,

regards,

sampath

  • mark helpful answers