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: 

Mark just one line in ALV

former_member680493
Participant
0 Kudos

Hi everybody!

I'm doing an ALV (with FM REUSE_ALV_GRID_DISPLAY) that the user should mark just one line and click in a button to starting the process... But today the user can mark more than one line. I don't know how to configure just to mark just one line...

Can you help me???

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check the number of lines selected and process further only if its equal to 1 else display an error message.

regards,

6 REPLIES 6

Former Member
0 Kudos

Hi,

Check the number of lines selected and process further only if its equal to 1 else display an error message.

regards,

0 Kudos

Hi! thanks!

But how i check this? there's a itab with these values????

BR!

Former Member
0 Kudos

HI,

you check the number of lines selected by the user

if the user selects more then 1 line you can throw a error message

refresh gt_selected_rows.

call method vl31_grid->get_selected_rows

importing et_index_rows = gt_selected_rows.

*-- more than one line was marked

READ TABLE gt_selected_rows INDEX 2 TRANSPORTING NO FIELDS.

IF sy-subrc = 0.

MESSAGE s755(06).

EXIT.

ENDIF.

*-- nothing marked

READ TABLE gt_selected_rows INDEX 1 INTO wa_selected_rows.

IF sy-subrc <> 0.

MESSAGE s277(me).

Check the above example if the user selects more than one row throws a error message

Regards,

siva chalasani.

<b>Reward points if usefull</b>

0 Kudos

Hi Siva!

thanks,

But i'm not using an ALV OO, how i can associate my table with the grid???

BR!

0 Kudos

Hi,

See if this helps,

Regards

former_member680493
Participant
0 Kudos

Hi everybody!

That's not the way I thinked to solve the problem, but I think that it doesn't have another way to solve the problem! I will do as you are telling me!

Thank's for the help!

BR