‎2005 Oct 18 1:38 PM
I have created an ALV Grid the oop way. I am trying to get the selection buttons on each row to stay selected as I do not want to select individual lines while holding down Ctrl. Sel_mode in my layout table is set to A. I am using event button_click. I have used get_selected_rows in the PAI and set_selected_rows in the PBO and still I cannot get the lines to stay selected when I selected a different line.
Can anyone suggest how I can do this?
Any suggestions would be appreciated.
‎2005 Oct 18 1:43 PM
Did you try any of the other values for SEL_MODE?
'A'
Column and row selection
(see graphic)
Multiple columns
Multiple rows
The user selects the rows through pushbuttons at the left border of the grid control.
'B'
Simple selection, list box
Multiple columns
Multiple rows
'C'
Multiple selection, list box
Multiple columns
Multiple rows
'D'
Cell selection
Multiple columns
Multiple rows
Any cells
The user selects the rows through pushbuttons at the left border of the grid controlRegards,
Rich Heilman
‎2005 Oct 18 1:47 PM
declare
data: gs_layout TYPE lvc_s_layo.
gs_layout-sel_mode = 'A'. multiple row & column selection
or you can have
gs_layout-sel_mode = 'C'. multiple selection listbox (multiple row & column selection)
CALL METHOD grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
(other export parameter)
CHANGING
it_outtab = (your itab)
it_fieldcatalog = (your fieldcat).
‎2005 Oct 18 1:59 PM
Yes I have tried the others. What I want is upon pressing the selection button on the row, this continues to be selected until I process those lines or clear the selections. There is no checkbox field in my ALV structure so could this be my problem?
‎2005 Oct 18 2:02 PM
No, not have a checkbox in the row is not the problem. But using the checkbox in the row would probably solve your problem. The functionality built in for selecting rows is pretty standard. You have to hold down control to do muliple selection when skipping rows. This is how the gui works. Have checkboxes in your ALV grid for row selection would solved your problem.
Regards,
Rich Heilman
‎2005 Oct 18 2:12 PM
From SAP HELP PAGE
http://help.sap.com/saphelp_47x200/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/content.htm
Value
Mode
Possible selections
Comment
SPACE
same as 'B'
see 'B'
Default setting
'A'
Column and row selection
(see graphic)
Multiple columns
Multiple rows
The user selects the rows through pushbuttons at the left border of the grid control.
'B'
Simple selection, list box
Multiple columns
Multiple rows
'C'
Multiple selection, list box
Multiple columns
Multiple rows
'D'
Cell selection
Multiple columns
Multiple rows
Any cells
The user selects the rows through pushbuttons at the left border of the grid control.
CHERZ
‎2005 Oct 18 2:43 PM
Could people please stop pasting information about the various A, B,C,D selection modes. I understand all that. I have used all that. This is being able to single click on say line 1, then line 3 and line 1 still being selected without having to use the Ctrl button to do this.
Thank you
Larissa
‎2007 May 29 7:16 PM
Sorry, dupplicated post.
Message was edited by:
Alejandro Bindi
‎2007 May 29 7:21 PM
I'm in exactly the same situation with an OO ALV. Is it possible to do what Larissa asked for? I would prefer using standard ALV selection without a checkbox (sel_mode = 'A').
You can get an example of the functionality I want anytime you get asked to activate several inactive programs at once: you can select some of them, without pressing Ctrl. But that's implemented with a Table control instead.
Or the only similar option is to implement an additional field with checkbox as Rich suggests?
In that case, how do you handle selection with checkbox? I've already declared an additional field as C, and loaded the fieldcatalog accordingly:
lwa_fieldcat-checkbox = k_true.
lwa_fieldcat-edit = k_true.
But the clickings in the checkboxes don't get reflected in the internal table behind the ALV.
Should I implement an event handler? Can you please help me out with this?
EDIT: Standard example program BCALV_EDIT_05 has this functionality using checkboxes. So post only if you know how to do what Larissa asked for in the first post.
Thank you very much.
‎2007 May 30 6:55 AM
Hi Larissa Maryniuk,
I dont think button_click event is triggered once U select a row. So try to provide a field like button as the 1st field and when U click on u can use Ur previous logic of using the button_click event and in it U can set the rows as selected using set_selected_rows.One thing I am not able to understand if this happens continuously the when should the deselection happen.