on 07-26-2013 7:09 AM
Hi,
You can group the values and sort using interface IF_SALV_WD_SORT (implementing class CL_SALV_WD_FIELD)
use method SET_GROUPING_ALLOWED.
You can refer this thread for code snippet: http://scn.sap.com/thread/1609584
Pass abap_true to method SET_GROUPING_ALLOWED to group the values.
Hope this helps u.,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kiran,
I have applied the following code.
DATA: lo_field TYPE REF TO CL_SALV_WD_FIELD.
CREATE OBJECT lo_field
EXPORTING
fieldname = 'PERNR'
.
CALL METHOD lo_field->if_salv_wd_sort~set_grouping_allowed
EXPORTING
value = ABAP_TRUE
.
On click of header of PERNR column, that column gets sorted .
but If i comment the above code and run again , same sorting happening.
and i cant able to sort more than one column.
Please clarify my doubts.
Best regards,
Narasimha
Hi,
Use SET_MULTI_COLUMN_SORT method IF_SALV_WD_TABLE_SETTINGS (implementing class CL_SALV_WD_CONFIG_TABLE) to enable multiple coulmns sort.
Try this code
DATA lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
DATA lr_field TYPE REF TO cl_salv_wd_field.
DATA lo_config_model TYPE REF TO cl_salv_wd_config_table.
lr_salv_wd_table = wd_this->wd_cpifc_alv( ).
lo_config_model = lr_salv_wd_table->get_model( ).
lo_config_model->if_salv_wd_table_settings~set_multi_column_sort( value = abap_true ).
lr_field = lo_config_model->if_salv_wd_field_settings~get_field( 'PERNR' ).
lr_field->if_salv_wd_sort~create_sort_rule( sort_order = if_salv_wd_c_sort=>sort_order_ascending ).
lr_field->if_salv_wd_sort~set_grouping_allowed( value = abap_true ).
Regards,
Kiran
User | Count |
---|---|
83 | |
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.