on 04-21-2010 2:14 PM
Hi All,
I searched on the forum for a solution for my problem, but I could not find anything that could help me.
I have a AVL table that has the selection mode single. Now when the user has sorted a column I can't set the lead selection anymore because when the user has edited an row via another form I reload the data on the context node and try to set the lead selection afterwards, but somehow he is not selecting the row.
Does anyone has a solution / workaround for this issue?
Thank you in advance.
Chris
Hi Frans,
This is a how standard ALV works.
ALV re-executes all the services like sorting/filtering whenever node data changes. Once the sort is re-applied the lead selection is reset, as after the sort the rows might be re-ordered and the lead selection might refer to another row.
ALV does not raise any event to indicate the lead selection lost and this entire process happen in the Modify View of SALV_WD_TABLE. As this will normally be a child component (used component) of your application, the modify view of this will be executed only after all the modify views of the parent component (our application where the ALV is embedded).
So there is no way you can re lead-select the row.
However there are work arounds
1) ALV component SALV_WD_TABLE provides a interface method REFRESH, that does exactly the same as executing the services again.
What you can do is, once the user has changed data or you have updated the node, you can execute REFRESH method and check if the lead selection is lost. Then you can again lead select
2) If you are sure that the changed data will not affect the sort sequence (the column data on which the sort is there is not being modified), there is a Table setting that you can do.
Below is the code
DATA: lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
DATA lo_value TYPE REF TO cl_salv_wd_config_table.
DATA lr_table_settings TYPE REF TO if_salv_wd_table_settings.
lo_interfacecontroller = wd_this->wd_cpifc_candidate_alv( ).
lo_value = lo_interfacecontroller->get_model(
).
lr_table_settings ?= lo_value.
CALL METHOD lr_table_settings->set_refresh_on_data_change
EXPORTING
value = if_salv_wd_c_table_settings=>refresh_data_only.
Note of Caution:
The Refresh data only setting, disables the auto sort of ALV on data change (and any other service like filters).
I am not exactly sure if auto sort will happen even after bind table.
If you are sure you did a bind table to node and want sort to be applied, execute the interface method Refresh.
Most important of all, test the application with different view layout that has sort and filters set.
Thanks,
Anand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Does anyone has a solution for this issue?
Thanks,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.