Get Example source ABAP code based on a different SAP table
ARTICLE
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. ITOC
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 - decfloat34decfloat16fp <(>int8<)> isb decfloat34decfloat34decfloat34 decfloat34 decfloat34 decfloat34 decfloat34decfloat34decfloat34 decfloat16decfloat34decfloat34 decfloat34 decfloat34 decfloat34 decfloat34decfloat34decfloat34 fdecfloat34decfloat34ff f fff pdecfloat34decfloat34fp p ppp <(>int8<)>decfloat34decfloat34fp int8int8int8int8 idecfloat34decfloat34fp int8 iii sdecfloat34decfloat34fp int8 iss bdecfloat34decfloat34fp int8 isb Value Ranges and Length Adjustments
When two operands with data type p are compared, numbers with more than 31 decimal places are edited internally to ensure that there is no overflow.
When two operands with data type p but with different lengths are compared, the shorter operand is converted to the length of the longer operand.
When two operands with data type p but with different numbers of decimal places are compared, the operand with fewer decimal places is converted to a number with the same number of decimal places as the other operand.
When an operand with type p is compared with an operand with type int8, i, s, or b, the comparison type p has 31 decimal places and the number of decimal places of the operand of type p. Wenn der Wert eines Operands vom Typ int8 nicht in den Wertebereich eines Vergleichstyps p passt, wird die Ausnahme intern abgefangen und der Vergleich liefert das richtige Ergebnis. ABAP Code Snippet 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. ABAP Code Snippet
Comparisons with Character-Like Data Types - decfloat34decfloat16fp <(>int8<)> isb d,tdecfloat34decfloat34 f p int8 iii string, c, ndecfloat34decfloat34 fp int8. i ii ABAP Code Snippet Value Ranges and Length Adjustments
When the types string and c are compared with packed numbers of the type p, the comparison type p has 31 decimal places together with the decimal portion of the operand of type p. This can raise exceptions if overflows occur.
When the type n is compared with packed numbers of the type p , the numeric text can contain up to 31 places, excluding leading zeroes and regardless of how big the decimal portion of the type p operand is.
When the types string, c, and n are compared with whole numbers of the types int8, i, s, and b, the number value in the character-like operand does not need to fit the value range of the comparison type i. If the number value is not in the value range, the comparison produces the correct result and no exception is raised. ABAP Code Snippet
Comparisons with Byte-Like Data Types - decfloat34decfloat16fp <(>int8<)> i, s, b xstring, xdecfloat34decfloat34 f p int8 i ABAP Code Snippet 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. ABAP Code Snippet
Note When converting byte-like data types to numeric types, note that all bytes are ignored except for the final four.