Show TOC

Bit OperationsLocate this document in the navigation structure

Bit operations are executed in Bit expressions of the COMPUTEstatement.

[COMPUTE] x = bitexp.

bitexp can be one of the following bit expressions:

Bit Expression Meaning

BIT-NOT y

Negation

y BIT-AND z

And

y BIT-XOR z

Exclusive or

y BIT-OR z

Or

As with mathematical expressions, you can use parentheses with bit expressions.

To find the meaning of the individual bit operators (BIT-NOT, BIT-AND, BIT-XOR, BIT-OR), refer to the ABAP keyword documentation.

Tip

DATA: hex1(1) TYPE x VALUE 'B5',      hex2(1) TYPE x VALUE '5B',      hex3(1) TYPE x.

hex3 = BIT-NOT ( hex1 BIT-XOR hex2 ).

WRITE hex3.

The list output is:

11

The bit operation is processed as displayed below: