The following table shows comparison operators for comparisons between character-like operands. The
trailing blanks are respected for operands of type string.
operator |
Meaning |
CO |
Contains
Only: True, if operand1 only contains characters from operand2. It is
case-sensitive and trailing blanks are respected in both operands. If
operand2 is of type string and initial, then the logical expression is false,
except if operand1 is also of type string and initial. In this case, the
logical expression is always true. If the comparison is true, sy-fdpos
contains the offset of the first character in operand1 that is not contained
in operand2. If the comparison is true, sy-fdpos contains the length of
operand1. |
CN |
Contains
Not Only: True if a logical expression with CO is false, that is, if operand1
contains not only characters from operand2. sy-fdpos is set in the same way
as for CO. If the comparison is true, sy-fdpos contains the offset of the
first character in operand1 that is not contained in operand2. If the
comparison is false, sy-fdpos contains the length of operand1. |
CA |
Contains
Any: True, if operand1 contains at least one character from operand2. It is
case-sensitive and trailing blanks are respected in both operands. If
operand1 or operand2 is of type string and initial, the logical expression is
always false. If result of the comparison is positive, sy-fdpos contains the
offset of the first character in operand1 that is also contained in operand2.
If the comparison is false, sy-fdpos contains the length of operand1. |
NA |
Contains
Not Any: True, if a logical expression with CA is false, that is if operand1
does not contain any characters from operand2. If the result of the
comparison is negative, sy-fdpos contains the offset of the first character
in operand1 that is also contained in operand2. If the comparison is true,
sy-fdpos contains the length of operand1. |
CS |
Contains
String: True, if the content of operand2 is contained in operand1. It is not
case-sensitive and trailing blanks in the left operand are respected. If
operand1 is of type string and initial, or of type c and contains only blank
characters, the logical expression is false, unless operand2 is also of type
string and initial, or of type c and only contains blank characters. In this
case, the logical expression is always true. If the comparison is true,
sy-fdpos contains the offset of operand2 in operand1. If the comparison is
false, sy-fdpos contains the length of operand1. |
NS |
Contains
No String: True, if a logical expression with CS is false, that is if
operand1 does not contain the content of operand2. If the comparison is
false, sy-fdpos contains the offset of operand2 in operand1. If the
comparison is true, sy-fdpos contains the length of operand1. |
CP |
Covers
Pattern: True, if the content of operand1 fits the pattern in operand2.
Wildcard characters can be used to create the operand2 pattern, where
"*" represents any character string (including a blank string) and
"+" represents any character. It is not case-sensitive. Trailing
blanks in the left operand are respected. If the comparison is true, sy-fdpos
contains the offset of operand2 in operand1, whereby leading wildcard
characters "*" in operand2 are ignored if operand2 also contains
other characters. If the comparison is false, sy-fdpos contains the length of
operand1. You can select characters in operand2 for a direct comparison by
adding the escape symbol"#" before the required characters. For
characters flagged in this way in operand2, the operator is case-sensitive.
Also, wildcard characters and the escape symbol are not subject to special
handling and trailing blanks are relevant. |
NP |
No
Pattern: True, if a logical expression with CP is false, that is, if operand1
does not fit the pattern operand2. If the comparison is false, sy-fdpos
contains the offset of operand2 in operand1, whereby leading wildcard
characters "*" in operand2 are ignored if operand2 also contains
other characters. If the comparison is true, sy-fdpos contains the length of
operand1. |
Comments
Post a Comment