Logical Expressions - Comparison Operators for Byte-Type Fields
In the condition "c1 op c2", the comparison operator op
between the fields
c1 and c2 may
be any of the operations listed below, but
c1 and c2 must
be byte-type fields (X or XSTRING).
-
BYTE-CO
(Contains Only):
x1 contains only
bytes from the byte set
x2.
If x1
has the type XSTRING and is empty, the result of the comparison
is always positive.
If x2 has the XSTRING
and is empty, the result of the comparison is always negative, unless x1
is also an empty field with the type XSTRING.
If the
result of the comparison is negative, the field SY-FDPOS
is filled with the offset of the first byte in x1 that
is not also included in x2.
If the result of the comparison
is positive, the field SY-FDPOS is filled with the length
of
x1.
Examples:
x1
= '01020304'.
x2 = 'FEFF'.
x3
= '0102'.
x1 BYTE-CO x2 is false; SY-FDPOS
= 0.
x1 BYTE-CO x3 is false; SY-FDPOS
= 2.
x1 BYTE-CO x1 is true; SY-FDPOS = 4.
-
BYTE-CN (Contains Not only):
"x1 BYTE-CN x2"
is equivalent to "
NOT ( x1 BYTE-CO x2 )".
x1
contains not only bytes from x2.
If
the result of the comparison is positive, SY-FDPOS is
filled with the offset of the first byte in x1 that is
not also included in x2.
If the result of the comparison
is negative, SY-FDPOS is filled with the length of x1.
-
BYTE-CA (Contains Any):
x1
contains at least one byte from the byte set x2.
If x1 or x2
has the type XSTRING and is empty, the result of the comparison
is always negative.
If the result of the comparison is positive, SY-FDPOS
is filled with the offset of the first byte in x1 that
is also included in x2.
If the result of the comparison
is negative,
SY-FDPOS is filled with the length of x1.
Examples:
x1 = '01020304'.
x2
= '03FF'.
x3 = 'FEFF'.
x1
BYTE-CA x2
is true; SY-FDPOS = 2.
x1 BYTE-CA x3 is false; SY-FDPOS = 4.
-
BYTE-NA (contains Not Any):
"x1 BYTE-NA x2"
is equivalent to "
NOT ( x1 BYTE-CA x-c2 )".
x1 contains no
bytes from x2.
SY-FDPOS is set accordingly.
-
BYTE-CS (Contains String):
x1 contains
the byte sequence
x2.
An empty field of the type XSTRING
is contained in any byte sequence x1, including the empty
X-string itself. However, there is no (non-empty) byte sequence x2
contained in an empty byte sequence x1.
If the result
of the comparison is positive, SY-FDPOS is filled with
the offset of the first byte of
x2 in x1.
If
the result of the comparison is negative, SY-FDPOS is
filled with the length of
x1.
Examples:
x1
= '01020304'.
x2 = '0304'.
x3
= 'FEFF'.
x1 BYTE-CS x2 is true; SY-FDPOS
= 2.
x1 BYTE-CS x3 is false; SY-FDPOS
= 4.
x1 = '00000102'.
x2
= '000102'.
x1 BYTE-CS x2 is true; SY-FDPOS = 1.
-
BYTE-NS (contains No String):
"x1 BYTE-NS x2"
is equivalent to "
NOT ( x1 BYTE-CS x2 )".
x1
does notcontain x2.
SY-FDPOS is set accordingly.