Start of Content Area

Processing Byte Strings  Locate the document in its SAP Library structure

Since release 6.10, ABAP has offered the IN BYTE MODE addition for the statements CONCATENATE, FIND, REPLACE, SHIFTand SPLIT. It allows operands to be processed byte by byte. The functions of these statements remain the same as when they are used for character strings, the only difference being that in this case byte-type data objects (data type x and xstring)are being processed.

Single Bit Processing in Hexadecimal Fields

In a hexadecimal field (type x), you can process the individual bits. ABAP interprets the contents of hex fields byte by byte. For example, a hexadecimal field of length n is n bytes long and has a display length in ABAP of 2xn. The decimal values 0-255 are represented in hexadecimal by the characters '00' to 'FF'.

This graphic is explained in the accompanying text

The illustration shows how a byte in a sequence with the decimal value 181 is represented in hex. The first four bits have the decimal value 11, the second four bits have the decimal value 5. This leads to the hexadecimal value ‘B5’ - 11x16+5 = 181.

ABAP contains statements that allow you to read and set the individual bits in a type x field. There are also statements which allow bit operations between fields of type x. Furthermore there are special relational operands in logic expressions for bit patterns.

Bit sequence processing allows you to process complex conditions and set operations more efficiently.

Setting and Reading Bits

Bit Operations

Set Operations with Bit Sequences

 

 

End of Content Area