Sunteți pe pagina 1din 6

Products

Products Industries
Industries Support
Support Training
Training Community
Community Developer
Developer Partner
Partner About
About  
Home / Community / Blogs + Actions

Sort sequence on Linux


July 6, 2007 | 15 Views |

Former Member

Retagging required

hannes kuehnemund

share
0 share tweet share

Follow RSS

Sort Sequence on Linux


Did you know, that the sorting order on Linux differs from that on HP-UX or Windows? Imagine that you
have SAP Application Servers running on a heterogeneous system environment. When you display an
ABAP list on an Application Server running on Linux the sorting of this list differs compared when
displaying it on an Application Server running on HP-UX. This blog give you some background
information, why the sorting is different and what these differences are. We’ll close it with some
suggestions, how to solve this fuzziness.

How does the SAP system de ne the sort sequence?

There are basically two different methods, how the SAP system gets the information about the sort
sequence. One method is used on Non-Unicode systems, the other one on Unicode systems. Having a
Non-Unicode system, the SAP system get the sort sequence information from the locale provided by
the operating system. Whereas having a Unicode system, the sorting sequence is defined using the
ICU (International Components for Unicode) definition which comes with the SAP system.

Non-Unicode

As already mentioned, Non-Unicode systems get the sort sequence directly from the locale, which
comes with the operating system. The locales which are used are stored in SAP table TCP0C. The
locale names on Unix operating systems are normally the same, but their sort sequence differs! I’ll give
you an example. I have a file with the following content:

Original text:

Z_SAPTEST
Z:ABC
ZAA_TESTS
ZZSAPTOP
ZSAPGAME
ZAAALLOW
ZAA:ALLOW
ZSDTEST
Having HP-UX 11, the sorting looks like:

Z:ABC
ZAA:ALLOW
ZAAALLOW
ZAA_TESTS
ZSAPGAME
ZSDTEST
ZZSAPTOP
Z_SAPTEST

Whereas on Linux (SLES10) the sorting is:

ZAAALLOW
ZAA:ALLOW
ZAA_TESTS
Z:ABC
ZSAPGAME
Z_SAPTEST
ZSDTEST
ZZSAPTOP

It seems, that Linux ignores special characters like colon or underscore. HP-UX does have a ranking
for these special characters. If you are used to the sort sequence of HP-UX it would really be hard to
navigate through large lists generated on a Application Server on Linux. The entries you search for,
are not at the position you expect them.

A solution for this unwanted behavior is available for both Novell SUSE Linux Enterprise Server and
Red Hat Enterprise Linux. You need adapted locales, which implement a new sorting order. For more
information, please have a look at SAP Note 1069443 how you can obtain these locales for your SUSE
or Red Hat system.

Unicode

Having a Unicode system, makes life pretty much easier for you. As Unicode systems use the ICU sort
sequence (which is part of the SAP kernel), it doesn’t matter on which platform you display your text or
lists. They are sorted always correctly!

Conclusion

As you face these problems only on Non-Unicode systems, it’s obvious that moving to Unicode is the
only option that provides a consistent state of sorting. I’m not sure if the sorting between AIX, Solaris,
HP-UX, Tru64 or Windows is always the same. We are lucky that the Linux distributors provide extra
packages for Linux, but in general I strongly encourage you to move to Unicode.

Alert Moderator

3 Comments
You must be Logged on to comment or reply to a post.
Former Member

July 6, 2007 at 3:43 am

You are right about solaris and windows. I have faced these problems earlier with solaris and windows and was looking at HP-UX as a
probable solution. But since you have done the r’n’d for me, makes life easier for me. Thank you.
Call center outsourcing

Former Member Post author

July 19, 2007 at 8:11 am

I checked the sort sequence (using the example from above) on Solaris. Thats the result:

Z_SAPTEST
Z:ABC
ZAA_TESTS
ZZSAPTOP
ZSAPGAME
ZAAALLOW
ZAA:ALLOW
ZSDTEST

As expected, Solaris also differs from Linux and HP-UX!

Former Member Post author

July 20, 2007 at 1:43 am

Sorry, pasted the wrong list. This is the one from Solaris:
Z_SAPTEST
Z:ABC
ZAA_TESTS
ZAA:ALLOW
ZAAALLOW
ZSAPGAME
ZSDTEST
ZZSAPTOP

Share & Follow


Privacy Terms of Use Legal Disclosure Copyright Trademark Cookie Preferences Sitemap Newsletter

S-ar putea să vă placă și