ARTICLE
rel_exp - Comparing String Expressions
String expressions can be used as operands in comparison expressions
with
relational operators for all data types
relational operators for character-like data
types
It is possible to compare a string
expression with a single operand with any
elementary data type or with
another string expression.
If one of the operands in a comparison is a string expression, the
comparison type is always string . If
necessary, single operands are converted
to the type string before the comparison.
Note
A string expression cannot be specified as the operand of a
predicate expression .
Example
This example demonstrates the effect of different comparison types. The
first comparison is true, since the character-like operand is converted
to the type of the numeric operand (in accordance with the rule for
comparing character-like data types ) and
the numeric value is compared. The second comparison is false, since the
numeric operand is converted to the type string of the string
expression and the internal representation of the code page used is
compared.
IF `02` > 1.
WRITE / 'yes'.
ELSE.
WRITE / 'no'.
ENDIF.
IF |02| > 1.
WRITE / 'yes'.
ELSE.
WRITE / 'no'.
ENDIF.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved