Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sort internal table on name (case sensitive sort)

Former Member
0 Likes
1,391

Hi Experts,

I want to sort my internal table by a certain field, but without it taken in account lower- or upper-case.

Let's say I have the following list:

- Abe

- celine

- bart

- Zorro

- Bambi

I do this in my code:

SORT it_names BY name

The result:

- Abe

- Bambi

- Zorro

- bart

- celine

How do I get the following result?

- Abe

- Bambi

- bart

- celine

- Zorro

3 REPLIES 3
Read only

Former Member
0 Likes
595

Hi,

try below

loop at it_names into wa_name.
translate wa_name-name to lowercase..
append wa_name to it_names_final.
endloop.

then try to sort it_names_final by names.

now table it_names_final will sort out correctly.

Read only

0 Likes
595

But then I don't get the original name (?)

Read only

Former Member
0 Likes
595

I added a new field to the internal table where I put the name in upper case and sorted on this...