SAP UNICODE BYTEFOLGEN

Get Example source ABAP code based on a different SAP table
  


ARTICLE

String Processing for Byte Sequences
Overview
1 IN BYTE MODE addition
2 Determining the string length
3 String comparison operations

1 The IN BYTE MODE addition
You differentiate between the hexadecimal (X) and character variants of the string statements using the IN BYTE MODE addition. The IN CHARACTER MODE addition can be used optionally for the character string variants. If you define the IN BYTE MODE addition, only hexadecimal fields and hexadecimal strings are allowed as arguments. There is a syntax or runtime error if arguments of a different type are passed.
CLEAR ... WITH IN BYTE MODE
CONCATENATE ... IN BYTE MODE
FIND ... IN BYTE MODE
REPLACE ... IN BYTE MODE
SEARCH x FOR x1 IN BYTE MODE
SHIFT x ... IN BYTE MODE
SPLIT ... IN BYTE MODE
The full length of the hexadecimal fields are always used in all string commands for byte strings, so that bytes with contents X'00' are never truncated at the end of the field. There are no variants that search for sub-sequences for the FIND, SEARCH, and REPLACE statements with the IN BYTE MODE addition.

2 Determining the length of the string
You can ascertain the string length for byte strings using the XSTRLEN XSTRLEN function. XSTRLEN returns the current length for X strings and the defined length in bytes for X fields, where null bytes at the end of fields are also counted.

3 String comparison operations
The X variants of the string comparison operations differ from the string variants by the BYTE prefix. Only X fields and fields of type XSTRING are allowed as arguments for these operations.
BYTE-CO
BYTE-CN
BYTE-CA
BYTE-NA
BYTE-CS
BYTE-NS