cancel
Showing results for 
Search instead for 
Did you mean: 

How to set sales contract search result sorted Descending by default

Former Member
0 Kudos

Dear Expert,

the search result of sales contract is sorted ascending by default (column 'valid from'). How can i set it to sorted Descending by default ?

Is there any IMG setting or notes? or do i need to change the code?

Thanks!!

Hedy

Accepted Solutions (1)

Accepted Solutions (1)

former_member202474
Contributor
0 Kudos

Hi ,

You can do this by coding. In the result view in the do prepare method, Get the collection wrapper and use the method sort.

me->typed_context->(result context node)->collection_wrapper->sort( iv_attr_name = lv_attr_name

iv_sort_order = cl_bsp_wd_collection_wrapper=>sort_descending iv_stable = lv_stable )

Hope this helps.

Regards,

Ruby.

Answers (1)

Answers (1)

former_member193352
Active Contributor
0 Kudos

Dear Hedy,

Please implement the following sample code to do so:



data: lv_sort_order type char1.
lv_sort_order = cl_bsp_wd_collection_wrapper=>sort_descending.

me->typed_context->XYZ->collection_wrapper->sort( iv_attr_name     = if_bol_col_sorting=>custom
                                                  iv_sort_order    = lv_sort_order ). " XYZ name of Context Node

Thanks

Vishal