The byte order determines the order in which bytes of specific data objects are stored in the memory.
Binary Representation of Numbers
The number 16909060 can be represented using the following byte sequences (in hexadecimal notation):
|Endian||Byte 1||Byte 2||Byte 3||Byte 4|
The most common processors are Intel and DEC alpha, both of which use little endian. Most other processors use big endian.
Binary Representation of Characters
In the Unicode format UCS-2, supported by the ABAP programming language, characters are represented using 2-byte unsigned integer values. This means that this format depends on the number representation used by the hardware. This means that UCS-2BE (big endian) must be distinguished from UCS-2LE (little endian).
Character-like or byte-like data objects of the type
xstring are often used as anonymous containers for data objects, especially structures, and stored persistently.
If such a container is stored and imported on an
application server with a different byte order, problems can arise if the container is used for
contents for which the byte order is important. This is always the case when numeric content of the
s is stored in character-like or byte-like containers. In
Unicode Systems further problems can arise when byte-like content is stored in character-like containers.
Usually, to be able to work with the contents of an imported container, a casting is executed on the data type, whose data is stored in the container. However, because no type information is stored in the container, any necessary conversion of the byte order cannot take place.
The only way to prevent these problems arising is to avoid having numeric components in anonymous containers and never store byte-like contents in character-like fields.