cancel
Showing results for 
Search instead for 
Did you mean: 

How to sort a collection by two componets/Attributes

0 Kudos

Hello All,

Scenario:

I have a result table view with columns Contact Person Number, Central Block flag and Last name. At the instance of BP confirmation in IC this result table(result view displays the contact persons associated with the account id during the BP cofirmation) is filled in a sorted order based on the Contact Person Number.

Requirement:

Sort the result table by Central block flag followed by Contact Last Name.Hence how to sort the collection of the result table view based on two attributes Central Block and Last Name?

Looking forward for your support.

Regards,

Harish P M

Accepted Solutions (0)

Answers (2)

Answers (2)

yevgen_trukhin
Advisor
Advisor
0 Kudos

Hello Harish,

Good question. The framework doesn't seem to support this. When i needed this functionality, i had to create my own implementation of collection. You can inherit from CL_CRM_BOL_ENTITY_COL and overwrite several methods which do the sorting. Check the class CL_CRM_IPM_RAA_BOL_COL.

Best Regards,

Yevgen

0 Kudos

In my case i could manage display of the sorted result by making changes in the GENIL class. Also i commented out the sort by CONTACT_PERSON_NUMBER which was done by standard code.

yevgen_trukhin
Advisor
Advisor
0 Kudos

Of course, another idea would be to do sorting in genil/api but sometimes the implementation is not flexible enough to allow you to do the sorting there.