cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting of data in a Table

Former Member
0 Kudos

Hi

I am displaying some data in a table, but when i sort any column of the table output, it is giving preference to the rows which are in Capital letter then it is considering small.

Eg:

A

B

C

a

b

c

Is there any work around to make the sort as:

A

a

B

b

C

c

Regards,

Trikanth

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Senthil,

Thanks for you reply,

I have seen the thread, it shows how to sort the table in the backend and send it to the VC, but that is not my requirement.

My issue is in the runtime, when the user clicks on a particular column name, the table gets sorted by that columm and i have my data starting with Caps and Small letters, but is not considering A and a as same and the result is all the caps are sorted and then all the small are sorted like:

America

Boston

Canada

austria

berlin

Regards,

Trikanth

Former Member
0 Kudos

Hi Trikanth,

but the sort function works correctly (have a look at the ASCII table: A = ASCII 65, B = ASCII 66 and so on a = ASCII 97, b = ASCII 98 and so on). If you want to have another sort order you must do it as it is mentionend in the post before with a backend functionmodule.

Best Regards,

Marcel

Former Member
0 Kudos

Hi Marcel,

I am not so aware of ASCII Values, but a small question:

A is 65 and a is 97 where as B is 66, and when we sort it should be like

65 , 66, 97 right ? i.e., A, B, a

Regards,

Trikanth

Former Member
0 Kudos

This is correct and that#s why you get:

America (ASCII for A = 65)

Boston (ASCII for A = 66)

Canada (ASCII for A = 67)

austria (ASCII for A = 97)

berlin (ASCII for A = 98)

Best Regards,

Marcel

Former Member
0 Kudos

Hi Marcel,

Finally i go back to my original question that is there any way to tweak and make it sort like AbBbCc in the runtime of column sort event ?

Some how i can get the data from backend in the order how i need by writing code in the backend FM , but problem is when user shuffles the data in the table during runtime then again the table will be sorted based on ASCII code.

Regards,

Trikanth

Former Member
0 Kudos

Hi Trikanth,

Ok by default you can not sort it like you wanted. A workaround could a function module which sorts it like you want. When a user click on the sort function (table header) then it sorted based on ASCII that's correct. I'm sorry to say that it is not possible to disable the default sort function. This is something which I also need for some apps.

Another question. Which data service returns you the data? If it is a RFC you can modify it, so that the data sorted as you want or otherwise you can modify the data, e.g. that everything is in lower case or in caps, therefore you can use a VC function UPPER().

Best Regards,

Marcel

If this question is answered for you please mark the question as answered and reward points, otherwise ask me again.

Former Member
0 Kudos

Hi Marcel,

I have no option to change the text to either Caps or Small( as per my requirement ). Is there any official note or any thing that i can have to close my requirement as technical limitaion ?

Regards,

Trikanth

Former Member
0 Kudos

Hi Trikanth,

Sorry, but I don't know any note. You can only use the workaround with function module for sorting then you can add a toolbar button "sort" for sorting again when the users has used the default sort function.

Best Regards,

Marcel

Answers (0)