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: 

Selecting multiple rows in an ALV without using control

Former Member
0 Kudos

Hi All,

I am trying to find a way to select multiple items from an alv without needing to use the CTRL key. The popup to select a maintenance package that appears when you attempt to manually call a strategy-based maintenance plan using transaction IP10 appears to have such functionality, but I don't think it uses an ALV grid. Answers on these forums were split between "set the box_fname field of the layout" (which almost always ended in the person giving up and simply calling get_selected_rows( ) ), and "it can't be done".

So I have three related questions

1) How can I select multiple rows in an ALV without needing the control key?

2) What kind of control is that popup using if its not an ALV?

3) What does the box_fname field of the layout actually do? Most people seem to think that it can replace get_selected_rows( ) and then it never works.

Thanks in advance.

9 REPLIES 9

GauthamV
Active Contributor
0 Kudos

Please SEARCH in SCN before posting.

This has been asked many times here.

http://scn.sap.com/thread/1515175

Former Member
0 Kudos

I don't want to sound like a jerk here, but I think it's pretty obvious that I did SEARCH before posting. As a matter of fact, I reported the results of my search in my post. The thread you linked to says exactly what I said that I already found, that it can't be done and that you should use get_selected_rows( ). Rather than being rude and implying that I didn't put forth due diligence before asking my question and offering no new information, perhaps you should either take a stab at the part that hasn't been answered in many other threads (how the maintenance package selection popup works) or just refrain from posting.

Former Member
0 Kudos

Hi,

you can create checkbox,assign HOTSPOT to that ,YOu can select ALV entries without comtrol,,you can pass those values for further processing.

Create internal table with CHECKBOX with all other required fields,then from alv_grid assign HOTSPOT to CHECKBOX,,IN OOABA you can use DOUBLE_CLICK event to know which line pressed...from that you can achieve easily,,,,

In normal alv grid you can write in USER_COMMAND  form to update CHECKBOX field,,,,

Hope this help you,

Regards,

Lingaraj

Kartik2
Contributor
0 Kudos

Hi,

For selecting multiple lines without using control you can use the class 'CL_GUI_ALV_GRID' and method 'SET_TABLE_FOR_FIRST_DISPLAY'.

Here after the ALV is generated. you can left click and drag the rows that you want to select. Refer the screen shot below :

Hope it helps you . Thank you.

Regards,

Kartik

Former Member
0 Kudos

Hi Former Member,

     The suggestion of and  will work as per your requirements to select multiple lines in ALV. Yes, by using "layout BOX_FIELD...

Worth thinking of, isn't it?

Regards,

Jake

Former Member
0 Kudos

see this if it helps:

in the layout of method set_table_for_first_display of class cl_gui_alv_grid.

if u set the parameter sel_mode then its value will decide ur selection.

whether u will be able to slect multiple rows with ctrl or only single rows.

also check link:

http://help.sap.com/saphelp_46b/helpdata/en/bf/3bd1369f2d280ee10000009b38f889/frameset.htm

revert back if still feel confusion in any concept of ALV.

Former Member
0 Kudos

As a developer, "it can't be done" isn't something I will accept easily. However, I will accept that this can't be done with the level of efficiency required for production code.

For example, by handling to the DELAYED_CHANGED_SEL_CALLBACK event of cl_gui_alv grid and manually keeping track of which rows had been previously selected I could manually call set_selected_rows to provide my desired functionality. However, this presents a two-fold problem. First, this should be a quick front end only deal and not require trips to the back end. Second, the delay event is delayed. I could lower the delay timer (either by calling some higher level set_property or by extending cl_gui_alv_grid so that I can access its private methods) but I don't believe it's worth the effort to do that instead of just training the end user to use the CTRL key.

Thanks for the answers.

0 Kudos

Hi,

I have suggestion, working around why don't you use ALV checkboxes instead?

By ticking those checkboxes in every row will indicate that the user selected the line.

Regards,

Jake

Former Member
0 Kudos

Hi

I'll have a "stab" at (1) and (2).

1) I can't give you a definitive answer but I suspect that if the question has been asked numerous times but hasn't been answered then the answer probably is that "it can't be done"... with ALV.

2) Plant Maintenance hasn't been implemented in my current system so I can't run IP10 to confirm this but I strongly suspect that the maintenance package selection popup you mentioned is implemented using a dynpro table control, not ALV.

Probably not the answers you were hoping for but I hope it helps a little.

Regards

Glen