cancel
Showing results for 
Search instead for 
Did you mean: 

Adding sort ability to a field

Former Member
0 Kudos

To add sorting ability to an field on result set on the web_ui I have made changes in parameter method of the attribute and could see sorting option on the display.

  WHEN IF_BSP_WD_MODEL_SETTER_GETTER=>FP_SORTABLE.

       RV_VALUE = 'TRUE'.     

But when I click on ascending or descending there is no change on the display based on the given sort order.

I could see there is no eh_onsort method in the context node class of the view and when I tried creating eh_onsort with the needed logics, its not getting triggered when ever I click on sort on web_ui.

I hope upon getting the sort field and order in eh_onsort I could sort in eh_on sort or do_prepare_output. But I couldn't trigger eh_onsort.

How could I solve this..? TIA

Thanks,

Karthik

Accepted Solutions (1)

Accepted Solutions (1)

deepika_chandrasekar
Active Contributor
0 Kudos

HI,

Check in DO_HABDLE_EVENT of the IMPL class when you click on sort which name is coming in event for sort. Event handler is case sensitive. You can debugg DO_HANDLE_EVENT for the event name for sorting.

Regards,

Deepika.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all. I created the eh_onsort with small letters in the implementation class. Its working fine now.

former_member210661
Active Contributor
0 Kudos

Hi Karthik,

go through this link..

http://scn.sap.com/message/15215438#15215438

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=237176002

this might be help full to you.. let me know if you any queries.

Thanks & Regards,

Srinivas.

dharmakasi
Active Contributor
0 Kudos

HI karthick,

there will be a standard event EH_ONSORT in standard IMPL class. When you click sort system will trigger only standard event until and unless you redefined it in your custom IMPL class.

You need to redefine the SORT event and use the similar code as in standard sort event method in addition to add your custom logic for sort based on your custom field.

Best Regards,

Dharmakasi.