on 06-25-2013 2:28 PM
Hi Experts,
do you know if it is possible to change the value in the standard dropdownlist in the header area for the available views by code? I debugged and checked the forum but i didn't found an answer. Or is there another way to change the view or at least reset the view to the standard view?
Background is that in case a custom view is set the excel export only contains the columns shown in the grid and I want to avoid to implement a custom excel export having all columns independent from UI.
Thanks,
Gerd
Hi,
Check this code:
DATA: lt_alv_views TYPE wdr_pers_variants,
ls_param_out TYPE if_salv_wd_table=>s_type_param_config_out,
ls_param_in TYPE if_salv_wd_table=>s_type_param_config_in.
FIELD-SYMBOLS: <ls_alv_view> TYPE wdr_pers_variant.
ls_param_in-action = if_salv_wd_table=>list.
ls_param_out = lo_comp_if_alv->get_config_data( ls_param_in ).
lt_alv_views[] = ls_param_out-t_view_list[].
READ TABLE lt_alv_views ASSIGNING <ls_alv_view> WITH KEY description = 'FULL'.
IF sy-subrc = 0.
ls_param_in-action = if_salv_wd_table=>set.
ls_param_in-view = <ls_alv_view>.
MOVE-CORRESPONDING <ls_alv_view> TO ls_param_in-config_key.
ls_param_out = lo_comp_if_alv->get_config_data( ls_param_in ).
ENDIF.
Best regards,
Guillaume
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guillaume,
many thanks! This works perfect! I already tried this method but unfortunately not hard enough. Do you know how to identify which view is the current one? It would be great to set back the original view after the export.The returned list doesnt contain a flag for this.
Best regards,
Gerd
Hi,
Try this for the initial view:
ls_param_in-action = if_salv_wd_table=>default.
ls_param_out = lo_comp_if_alv->get_config_data( ls_param_in ).
And this for the current one:
ls_param_in-action = if_salv_wd_table=>actual.
ls_param_out = lo_comp_if_alv->get_config_data( ls_param_in ).
Best regards,
Guillaume
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.