Ansicht
Dokumentation

ABENLOGEXP_RULES_OPERANDS_COMPA - LOGEXP RULES OPERANDS COMPA

ABENLOGEXP_RULES_OPERANDS_COMPA - LOGEXP RULES OPERANDS COMPA

Vendor Master (General Section)   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

log_exp - Comparing Compatible Elementary Operands

If operand1 and operand2 have elementary data types and are compatible, their contents are compared without prior conversion based on the following rules: :

  • For operands with a numeric data type (i, decfloat16, decfloat34, f, p), the numeric values are compared. Since platform-dependend rounding errors may occur with data type f, it often does not make sense to compare floating-point numbers to see if they match. Scale and precision are not relevant in comparisons between decimal floating point numbers.
  • For operands with a character-type data type (c, d, n, t, string), the contents are compared from left to right. Based on the internal binary representation in the code page used, the first differing character from left determines which operand is greater.
  • For operands with a byte-type data type (x, xstring), the contents are compared from left to right. Based on the byte values, the first differing byte from left determines which operand is greater.

In particular, the rule for character-type types produces the following behaviour:

  • For operands of types c and string, the contents are not compared on the basis of the locale of the current text environment. To specify the sequence with reference to the locale, you can use the CONVERT TEXT statement.
  • For operands of type n, the contents are compared based on the numeric value represented.
  • For operands of types d and t containing a valid date or a valid time, the later date or time is greater than the earlier one.

Examle

In the following comparison "a" is bigger than "Z" for most code pages. Refer also to the example for CONVERT TEXT.

IF 'a' > 'Z'.
  WRITE / `'a' > 'Z'`.
ELSE.
  WRITE / `'a' < 'Z'`.
ENDIF.






BAL Application Log Documentation   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 2878 Date: 20240419 Time: 221004     sap01-206 ( 40 ms )