on 03-09-2009 6:27 AM
Hi All,
Could some one help me on how to group similar values in an alv column when it is displayed for the first time itself, i know we can set/reset this functionality on sort by using the ~set_grouping_allowed method of the interface if_salv_wd_sort but i would like to group on first display itself.
I Apologise if the question was already posted.
Thanks In Advance,
Chaitanya.
Hi Chaitanya,
Please refer the following code:
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_first( ). " alv_first is the name of my alv component
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv_first( ).
DATA: lr_field TYPE REF TO cl_salv_wd_field.
DATA lo_config_model TYPE REF TO cl_salv_wd_config_table.
lo_config_model = l_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( 'CONNID' ).
lr_field->if_salv_wd_sort~create_sort_rule( sort_order = if_salv_wd_c_sort=>sort_order_descending ).
lr_field->if_salv_wd_sort~set_grouping_allowed( value = abap_true ).
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arjun,
Thanks a lot for your quick reply, your code works fine the only problem is say i am trying to group data in the column 'matnr' because i am using the statement:
l_if_field->if_salv_wd_sort~create_sort_rule( sort_order = if_salv_wd_c_sort=>sort_order_descending )
the display order of the matnr's gets changed , is there a way i can retain the order given to me by the function module and still have the column sorted.
Thanks A Lot,
Chaitanya.
Hi,
By using the below class properties you can do what ever action you require.
cl_salv_table
http://help.sap.com/saphelp_nw04/helpdata/en/10/e4eb40c4f8712ae10000000a155106/content.htm
Best Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.