Created by Wang, Jerry, last modified on Dec 20, 2014

bit processing:
http://help.sap.com/saphelp_nw04/helpdata/en/b6/e7d716f46711d195200000e8353423/frameset.htmSetting Bits
To set an individual bit, use the statement
SET BIT OF [TO ].
This statement sets the bit at position of field to 1 (or to the value of field ). The system must be able to interpret field as a positive integer. The field must have data type X. The field must contain the value 0 or 1. If the bit is set, SY-SUBRC is set to 0. If is greater than the length of , SY-SUBRC is unequal to zero. If or contain invalid values, a runtime error occurs.
DATA HEX(3) TYPE X.
SET BIT: 09 OF HEX TO 1,
10 OF HEX TO 0,
11 OF HEX TO 1,
12 OF HEX TO 1,
13 OF HEX TO 0,
14 OF HEX TO 1,
15 OF HEX TO 0,
16 OF HEX TO 1.
WRITE HEX.
The bits of the second byte in the three-character hexadecimal field HEX are set to ‘10110101’, and the list output is as follows:
00B500
The decimal value of the second byte is 181.
Hexadecimal Type
The remaining non-numeric type - X - always interprets individual bytes in memory. One byte is represented by a two-digit hexadecimal display. The fields with this type are called hexadecimal fields. In hexadecimal fields, you can process single bits.
0A
00 是一個位元組
32是一個位元組
31 00 20 00 一共4個位元組
x length 4 4個位元組。
字元串變量char1的1對應3100
char2 的1對應31002000
2000代表空格
char1 : UTF16 兩個位元組代表1個字元。 1個位元組8位,2個16位
Byte order
Determines the order in which a number of the data types i, decfloat16, decfloat34, f, s or a character in a Unicode system is stored in the memory. A distinction is made between big and little endian. In the former case, the system writes the byte with the highest level, and in the second case the byte with the lowest level, to the first position in the memory. The byte order on the current application server can be derived from the static attribute ENDIAN in the system class CL_ABAP_CHAR_UTILITIES.