Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing Internal Data →  Assignments →  = - Assignment Operator →  = - Assign Calculation Expressions 

=, Bit Expression

Other versions: 7.31 | 7.40 | 7.54


result = bit_exp.


If a bit expression bit_exp is specified on the right side of the assignment operator =, a byte chain with the calculation length is calculated and assigned to the left side result like a source field with the type xstring.

The following can be specified for result:

  • A variable with the type x or xstring.
  • A variable with the type c or string .
  • An inline declaration DATA(var). The data type of the declared variable var is xstring.


Bit expressions as the right side of assignments. The expressions can also be used directly as input parameters of the output methods.

DATA hex1 TYPE xstring VALUE '0123456789ABCDEF'. 
DATA hex2 TYPE xstring VALUE 'FEDCBA9876543210'. 

DATA(result1)  = hex1 BIT-AND hex2. 
DATA(result2)  = hex1 BIT-OR hex2. 
cl_demo_output=>write(   result1 ). 
cl_demo_output=>display( result2 ).