Show TOC

BitoperationenLocate this document in the navigation structure

Bitoperationen werden in Bit-Ausdrücken der Anweisung COMPUTEausgeführt:

[COMPUTE] x = bitexp.

Hierbei ist bitexp einer der folgenden Bit-Ausdrücke:

Bit-Ausdruck Bedeutung

BIT-NOT y

Negation

y BIT-AND z

Und

y BIT-XOR z

Exklusives oder

y BIT-OR z

Oder

Bit-Ausdrücke sind wie mathematische Ausdrücke durch Klammern schachtelbar.

Zur Bedeutung der einzelnen Bitoperatoren (BIT-NOT, BIT-AND, BIT-XOR, BIT-OR) siehe ABAP-Schlüsselwertdokumentation.

Tipp

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.

Die Listenausgabe ist:

11

Die Bitoperation verläuft wie in folgender Abbildung gezeigt: