on 09-28-2011 3:57 PM
Hi,
I have the above mentioned problem. The Coding I use is:
DATA: lr_field_settings TYPE REF TO if_salv_wd_field_settings,
lt_fields TYPE SALV_WD_T_FIELD_REF.
FIELD-SYMBOLS: <fs_field> LIKE LINE OF lt_fields.
lr_field_settings ?= lr_config.
lt_fields = lr_field_settings->get_fields( ).
READ TABLE lt_fields ASSIGNING <fs_field> WITH KEY fieldname = 'ANSPRECH_DETAILS'.
IF sy-subrc EQ 0.
<fs_field>-r_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
<fs_field>-r_field->if_salv_wd_sort~set_grouping_allowed( abap_false ).
ENDIF.
When debugging I can see that the object attributes for sort_allowed and grouping_allowed are changed from 'X' to ' '
but the running application still allows sorting and grouping for the column 'ANSPRECH_DETAILS'.
So what did I forget or what is my mistake ????
Thx for your help.
Dino Dini
You might want to try using some methods from CL_SALV_WD_CONFIG_TABLE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhalps I should have mentioned using cl_salv_wd_config_table for getting the lr_config reference:
DATA: lr_config TYPE REF TO cl_salv_wd_config_table.
I don't see any methods of this class where I can set the sorting behavior for only one specific column. Following the integrated SAP class description you have to use objects of type lr_field. You get this lr_field ref by using the lr_config ref to get it for a specific field (column). But something seems to be missing. Perhalps I have to use something like a refresh method at the end (but I tried it already and it didnt solve the problem).
DATA:
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lv_refresh_in TYPE if_salv_wd_table=>s_type_param_refresh_in.
lr_if_controller->refresh( lv_refresh_in ).
(All the above coding is within the wddomodifyview Method of the relevant view)
Thx Dino Dini
Edited by: dinodini on Sep 28, 2011 6:21 PM
I got the similar requirement and I tried to do the below way.. it worked for me..
DATA: lr_field_settings TYPE REF TO if_salv_wd_field_settings.
DATA: lr_field TYPE REF TO cl_salv_wd_field.
lr_field_settings ?= lr_table.
lr_field = lr_field_settings->get_field( 'MATNR' ).
lr_field->IF_SALV_WD_SORT~SET_SORT_ALLOWED( abap_false
).
you can observe in the below image that sort option is not enabled for MATNR in the ALV.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.