cancel
Showing results for 
Search instead for 
Did you mean: 

CRM Web UI table sorting field

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi all,

I have a question about sorting field.

Basically, there are two types of field, BOL attribute and single value attribute.

I use method "EH_ON_SORT" and "me->collection_wrapper->sort(attribute_name)" to sort, but this only works for BOL attribute. If I passed signle value attribute as parameter, the method would catch an error "CATCH cx_crm_cic_parameter_error."

Does anyone know how to sort by single value attribute?

Accepted Solutions (0)

Answers (2)

Answers (2)

Kinsbrunner
Active Contributor
0 Kudos

Yes, the GET_P should have something like this:

METHOD get_p_attr_code.
  CASE iv_property.
    WHEN if_bsp_wd_model_setter_getter=>fp_sortable.
      rv_value = 'FALSE'.
  ENDCASE.
ENDMETHOD.

Also, have you checked the xception in ST22? This should be something really straight forward.

Regards.

Alejandro.

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alejandro,

Method "get_p" is just to display sort option in UI, by default the field is sort enable.

Finally, I got it worked. The problem is that I should set property into collection for a value attribute BEFORE sorting.

Now I do the property setting in DO_PREPARE_OUTPUT.

current->set_property( iv_attr_name = 'ZSORT_FIELD' iv_value = xxx ).

Kinsbrunner
Active Contributor
0 Kudos

Hi Eric,

The SORT method which is under the Collection_Wrapper reference should be fine for you. Even more, look at the attached screenshot where I am sorting a Value node:

In addition to this, your exception sounds to me as if you would be sending wrong or incomplelte information to the Sort method. Have you checked that alredy?

Regards.

Alejandro.

phoenixming0912
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Alejandro,

I also used the event "EH_ON_SORT" to sort, but looks like this method only works for BOL attributes, it doesn't work for single attributes. I passed the single attribute name into sort method and got the "parameter error" exception.

I have debugged and found "GET_P_XXX" of value attribute is executed after event "EH_ON_SORT", so what I am thinking of is to sort in method "DO_PREPARE_OUTPUT".