on 04-25-2008 6:56 AM
Hi Experts
Hi,
I have a dynamic ALV table. I also have a button 'Select All Rows'. On clicking the button I want all the rows in the ALV table selected which is done by using set_selected method at the context node.
All the rows in the alv is selected after clicking select_all except for the first row.
Need your inpts to solve the same.
Regards
Karthick
Thx for your opinions. The solution for this issue is selection mode "Multi_no_lead" which contradicts if u set initialize lead selection at context node...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use the folowing code
*... get model
data:
lr_model type ref to cl_salv_wd_config_table.
lr_model ?= me->r_model.
*... get columns
data:
ls_column type salv_wd_s_column_ref,
lt_column type salv_wd_t_column_ref.
lt_column = lr_model->if_salv_wd_column_settings~get_columns( ).
data:
l_selected type abap_bool.
loop at lt_column into ls_column.
l_selected = abap_false.
read table value transporting no fields with key column = ls_column-id.
if sy-subrc eq 0.
l_selected = abap_true.
endif.
try.
me->if_salv_bs_model_column~set_selected(
column = ls_column-id
value = l_selected ).
catch cx_salv_bs_sc_object_not_found. "#EC NO_HANDLER
endtry.
endloop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jaques
The icon doesnt appear in my alv table used in WD Abap application. Is there any settings tobe done at the alv comp. interface otherthan selection mode ? If yes kindly update..
My selection critearia at the context is at 0...n only but still the selection is set at the first element.
Thanks and Regards
Karthick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthick,
Why are you using a separate button for select all?
By default, the ALV table has the select all option. There is an icon which appears at the top left corner of the table. Clicking on it provides you with 2 options - Select All and Delete selection. You can use this. But i your 'Selection' property of the context node bound the the table must be 0...n.
Regards
Wenonah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.