Skip to Content

SAP CRM WebUI : Sorting custom columns (custom attributes)

Hi to everybody,

i have a little problem on SAP CRM WebUI.

I created a whole custom view inside factsheet page, component BP_FACTSHEET.

I have already filled inside method GET_P_* the following code :

WHEN if_bsp_wd_model_setter_getter=>fp_sortable.

rv_value = 'TRUE'.

but data is NOT being sorted by custom columns.

How can i solve this problem? Someone could you help me,please?

Thanks in advance.

Best regards.

Dario.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 29, 2011 at 11:45 AM

    Hi Dario

    Are the custom attributes that you have mentioned part of BOL?

    You can find the procedure here.

    [Sorting on custom fields|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=237176002]

    Regards

    Leon

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      my Method is very similar to Leon's

      1. On sort Event

         

      if lv_attr_name eq 'ELAPSEDTIME'.
          me->typed_context->srvreq->collection_wrapper->sort(
            iv_attr_name    = if_bol_col_sorting=>custom
            iv_sort_order   = lv_sort_order
            iv_stable       = abap_false
            iv_sort_callback  = lr_callback ).

      endif.

      if for the specified column, call Custom sort

      2. Add interface if_bol_col_sorting into the class

      3. Implement if_bol_col_sorting~is_a_greater_b for custom-defined compare function

      method if_bol_col_sorting~is_a_greater_b.

           ....

           if me->gv_sort_field eq 'ELAPSEDTIME'.

                lv_s1 = .....

                lv_s2 = .......

                if lv_s1 > lv_s2.
            rv_result = abap_false.
          else.
            rv_result = abap_true.
          endif.

           endif.

           ...

      endmethod.

      Hopefully, It will help you out 😊