SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Program Flow Logic → Expressions and Functions for Conditions → log_exp - Logical Expressions → rel_exp - Relational Expressions → rel_exp - Relational Operators →
rel_exp - Relational Operators for Byte-Like Data Types
The following table shows the relational operators for comparisons between byte-like operands (single data objects or return values or bit expressions) in comparison expressions.
operator | Meaning |
BYTE-CO | Contains Only: True, if operand1 only contains bytes from operand2. If operand2 is of type xstring and initial, then the relational expression is false, except if operand1 is also of type xstring and initial. In this case, the relational expression is always true. If the comparison is false, then sy-fdpos contains the offset of the first byte in operand1, which is not contained in operand2. If the comparison is true, sy-fdpos contains the length of operand1. |
BYTE-CN | Contains Not Only: True, if a relational expression with BYTE-CO is false, if therefore operand1 does not only contain bytes from operand2. If the comparison is true, then 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. |
BYTE-CA | Contains Any: True, if operand1 contains at least one byte from operand2. If operand1 or operand2 are of the type xstring and initial, the relational expression is always false. If the comparison is true, then sy-fdpos contains the offset of the first byte in operand1 that is also contained in operand2. If the comparison is false, sy-fdpos contains the length of operand1. |
BYTE-NA | Contains Not Any: True, if a relational expression with BYTE-CA is false, if therefore operand1 does not contain a byte from operand2. If the comparison is false, then sy-fdpos contains the offset of the first byte in operand1 that is also contained in operand2. If the comparison is true, sy-fdpos contains the length of operand1. |
BYTE-CS | Contains String: True, if the content of operand2 is contained in operand1. If operand1 is of type xs and initial, then the relational expression is false, except if operand2 is also of type xstring and initial. In this case, the relational 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. |
BYTE-NS | Contains No String: True, if a relational expression with BYTE-CS is false, if therefore 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. |
Example
The logical expression in the IF statement is true, if the second half-byte is not filled for any of the bytes in hex1.