ABAP Keyword Documentation → ABAP - Reference → Processing Internal Data → Character String and Byte String Processing → Expressions and Functions for Byte String Processing → bit_exp - Bit Expressions
bit_exp - Calculation Length
A bit expression has been assigned a calculation length in which the operation is executed.
The calculation length is the length of the longest bit expression operand involved. Differently from the calculation type of an arithmetic expression, the type of the result is not included.
Before the entire expression is evaluated, all operands involved are converted to the length of the
longest operand involved based on the rules for the
source field type x
and
xstring. This means that shorter operands are hexadecimally filled with 0 on the right.
The result in the calculation length is handled as follows:
- If used in the statement
COMPUTE
, the final result of the entire expression is converted to the length of the data objectresult
based on the rules for source field typex
andxstring
.
- If used in logical expressions, the result is used as an operand in the length resulting from the calculation.
- If used as an actual parameter for
input parameters of
methods, the final result of
the entire expression is converted to the length of the formal parameter based on the rules for source
field type
x
andxstring
. If the formal parameter has been typed generically, it is set to the typex
in the length determined by the operands.