ABAP Keyword Documentation →  ABAP − Reference →  Program Flow Logic →  Expressions and Functions for Conditions →  log_exp - Logical Expressions →  rel_exp - Relational Expressions →  rel_exp - Comparison Rules →  rel_exp - Comparing Elementary Data Types →  rel_exp - Comparisons of Elementary Data Objects → 

rel_exp - Comparing Numeric Data Types

The following tables show the comparison types for comparisons between numeric data types and other data types. If the type of an operand is not the same as the comparison type, then it is converted to this type.

Note

If a decimal floating point number is involved in a comparison, the comparison is always made with the type decfloat34.

Comparisons with Numeric Data Types

- decfloat34 decfloat16 f p i s b
decfloat34 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34
decfloat16 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34 decfloat34
f decfloat34 decfloat34 f f f f f
p decfloat34 decfloat34 f p p p p
i decfloat34 decfloat34 f p i i i
s decfloat34 decfloat34 f p i s s
b decfloat34 decfloat34 f p i s b

Value Ranges and Length Adjustments

Comparisons with Character-Like Data Types

- decfloat34 decfloat16 f p i s b
d,t decfloat34 decfloat34 f p i i i
string, c, n decfloat34 decfloat34 f p i i i

Value Ranges and Length Adjustments

Comparisons with Byte-Like Data Types

- decfloat34 decfloat16 f p i, s, b
xstring, x decfloat34 decfloat34 f p i

Length Adjustments

The comparison type p has 31 decimal places and the number of places in the decimal portion in the operand of type p.

Note

When converting byte-like data types to numeric types, note that all bytes are ignored except for the final four.