Ansicht
Dokumentation

ABENCOMPARISON_TYPE - COMPARISON TYPE

ABENCOMPARISON_TYPE - COMPARISON TYPE

General Data in Customer Master   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

- Comparison Rules for Comparison Types

When operands with elementary data types are compared, the comparison is performed according to a comparison type that is determined by the involved operands, as described for elementary data objects and calculation expressions. The comparison type can be one of the built-in ABAP types. When incompatible operands are compared, the operands that do not have the comparison type are converted to this type.

Numeric Comparison Type

If the comparison type is one of the numeric data types, the numeric values are compared.

Notes

  • Since platform-dependent rounding errors may occur with data type f, a comparison for equality often does not make any sense for binary floating point numbers.
  • Scale and precision are not relevant in comparisons between decimal floating point numbers.

Example

The comparison of a text string with an integer is performed with numeric comparison type i. If the text string cannot be converted to i, an uncatchable exception would be raised in the comparison. Convertibility is therefore checked first using the conversion operator CONV.

Character-Like Comparison Type

If the comparison type is one of the character-like data types, the content is compared from left to right. Based on the internal binary representation in the code page used, the first differing character from the left determines which operand is greater.

Notes

  • For operands of types c and string, the content is not compared with the locale of the current text environment. The statement CONVERT TEXT can be used to determine the order of the locale.
  • For operands of type n that contain a valid string of digits, the proportions of the numbers represented are determined correctly.

Example

The example shows whether the binary representation of uppercase letters is larger, the same or smaller than the binary representation of lowercase letters for individual characters. For the Unicode character representation UCS-2 used by ABAP, uppercase letters are smaller than lowercase letters. Numbers and special characters are not case-sensitive and the result of the comparison for equality is true.

Byte-Like Comparison Type

If the comparison type is one of the byte-like data types, the content is compared from left to right. Based on the byte values, the first differing byte from the left determines which operand is greater.

Example

A byte-like comparison type is achieved by comparing byte-like operands. Invalid values are converted into hexadecimal zeros here when they are entered.

Date/Time Type as Comparison Type

If the comparison type is one of the date/time types, the content is compared from left to right. Based on the internal binary representation in the code page used, the first differing character from the left determines which operand is greater.

Note

For operands of types d and t that contain a valid date or a valid time, the later date or time is always greater than the earlier one.

Example

Comparison of a date obtained by the addition of a numeric value from the current date to the original date. The later date is always greater than the earlier date.

Time Stamp Type as Comparison Type

If the comparison type is the time stamp type, the times are compared, whereby a later time is always the greater value and the initial value is always less than every real time stamp.






rdisp/max_wprun_time - Maximum work process run time   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5214 Date: 20240419 Time: 175919     sap01-206 ( 69 ms )