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: 

ALV_GRID Row selection

Former Member
0 Kudos
170

Hello All,

I am using the Function 'REUSE_ALV_GRID_DISPLAY' and need to process all rows that have been selected (through the row selection button) by the user. Is there a way capture the table index of each row that is selected? Thanks for your help in advance.

John

1 ACCEPTED SOLUTION

former_member221770
Contributor
0 Kudos
44

Hi John,

What I have done in the past is have a checkbox for each record in the ALV. This is generally a CHAR1 field called creatively 'BOX'.

What I do is create the Layout Structure (type slis_layout_alv) and populate the field 'box_fieldname' with 'BOX'. This identifies the field 'BOX' in the internal table as a checkbox (you don't need to define this in the fieldcatalog).

Now at the USER_COMMAND callback routine, you can loop at your internal table (the one with field BOX that is passed to the ALV) and search for the records where BOX = 'X'.

Hope this makes sense. Let me know if you need more info.

Cheers,

Pat.

2 REPLIES 2

former_member221770
Contributor
0 Kudos
45

Hi John,

What I have done in the past is have a checkbox for each record in the ALV. This is generally a CHAR1 field called creatively 'BOX'.

What I do is create the Layout Structure (type slis_layout_alv) and populate the field 'box_fieldname' with 'BOX'. This identifies the field 'BOX' in the internal table as a checkbox (you don't need to define this in the fieldcatalog).

Now at the USER_COMMAND callback routine, you can loop at your internal table (the one with field BOX that is passed to the ALV) and search for the records where BOX = 'X'.

Hope this makes sense. Let me know if you need more info.

Cheers,

Pat.

Former Member
0 Kudos
44

Hello Pat,

You solved the problem. Thanks very much for this.

John