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 a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on 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 a 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 😊

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.