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

User command in ALv

Former Member
0 Likes
1,434

how to handle user command in alv grid?

if we want to select only one row, but we get a table from calling method

get_selected_rows.

is there any method or way of getting a single row which is selected?

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
1,011

Hi,

This method indeed returns the table but only with the selected rows. Therefore when you select only one row, it will contain only one entry. For this use second parameter of the method ET_ROW_NO as the first one is obsolete. It will contain indexes of the selected rows.

Note!

You must use one of the these selection modes (A, C, D) in this case. The default one is B, so you have to change it in layout structure.


layout_structure-sel_mode = 'A'.  "i.e.

See possible selection modes [here|http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/frameset.htm]

Regards

Marcin

how to handle user command in alv grid?

if we want to select only one row, but we get a table from calling method

get_selected_rows.

is there any method or way of getting a single row which is selected?

5 REPLIES 5
Read only

Former Member
0 Likes
1,011

HI,

Check the Demo program BCALV_GRID_08

Read only

0 Likes
1,011

Thank you. I checked that program and did it.

Read only

MarcinPciak
Active Contributor
1,012

Hi,

This method indeed returns the table but only with the selected rows. Therefore when you select only one row, it will contain only one entry. For this use second parameter of the method ET_ROW_NO as the first one is obsolete. It will contain indexes of the selected rows.

Note!

You must use one of the these selection modes (A, C, D) in this case. The default one is B, so you have to change it in layout structure.


layout_structure-sel_mode = 'A'.  "i.e.

See possible selection modes [here|http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/frameset.htm]

Regards

Marcin

Read only

0 Likes
1,011

Thanks !

Read only

0 Likes
1,011

hi tanu,

on sdn the right way of saying thanx is by giving points un helpful answers. Please keep that in mind next time onwards.