01-09-2006 8:56 AM
Hi !
I wanted to ask how to enable multiple selection for table created by Alv grid control ? how to handle the multiple selection ? by which event ?
Also i wanted to ask how to transfer the selected internal table to other screen which too show other alv grid control based on the selection of the first screen ?
Please send me programs examples and reference to written material.
Thanks
moshe
01-09-2006 9:09 AM
Hi,
If you pass the mode for selection as 'A'[if not,try 'B'] in layout,then you will get the selection enabled.
data w_layout TYPE lvc_s_layo.
w_layout-sel_mode = 'A'.
Then pass the layout parameter in method set_table_for_first_display.
Kindly reward points by clicking the star on the left of reply,if it helps.
01-09-2006 9:04 AM
Boker tov
1/ To enable selection you have to give a layout to the method set table for first display
param : IS_LAYOUT
and fill the field
SEL_MODE LVC_LIBOX CHAR 1 0 ALV control: SelectionMode
with the value that you can find here
http://help.sap.com/saphelp_erp2005/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/content.htm
or check this out :
Selection modes for SEL_MODE
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.
2/ to get selected rows you can use method
GET_SELECTED_ROWS
with these parameters
ET_INDEX_ROWS Exporting Type LVC_T_ROW
ET_ROW_NO Exporting Type LVC_T_ROID
--> Indexes of Selected Rows
3/ Use method set table for first display with another internal table that you will fill with selected entries...
4/ dont forget the reward if I did at last help you!!!!
01-09-2006 9:09 AM
Hi,
If you pass the mode for selection as 'A'[if not,try 'B'] in layout,then you will get the selection enabled.
data w_layout TYPE lvc_s_layo.
w_layout-sel_mode = 'A'.
Then pass the layout parameter in method set_table_for_first_display.
Kindly reward points by clicking the star on the left of reply,if it helps.
01-09-2006 12:27 PM
Hi Stephan !
First thanks for the answer. I want more information of how to get the multi selected row and transfer them to another ALV screen. Can you give me more detail or an example of how to do this.
thanks
moshe
01-09-2006 12:35 PM
Hi Moshe,
you need to call the method of cl_gui_alv_grid class.
<b>GET_SELECTED_ROWS</b>
regards
vijay
01-09-2006 12:38 PM
DATA: it_rows TYPE lvc_t_row,
CALL METHOD shipto_alv->get_selected_rows
IMPORTING et_index_rows = it_rows.
Vijay