Operators are symbols used to perform some operations on Data Objects. In ABAP language, at least one SPACE must be provided in both sides of every operator.
Statements also can be used instead of operators
These are for comparing the item. Their result is always either True or False.
=, <>, <, >, <=, >= or their equivalents
EQ, NE, LT, GT, LE, GE
and a special operator BETWEEN AND for range checking
5 < 3 is false.
5 GT 3 is True.
5 = 5 is True.
For combining two or more conditions into a single condition.
AND OR NOT
String Comparison Operators
CO Contains Only
CA Contains any
CS Contains String
CP Suits Pattern
‘*’ stands for no. of chars
‘+’ denotes any character
They are usually used along with IF statement.
Ex. IF ‘ABAP’ CO ‘AB’. //Condition is False because there is P.
Ex. IF ‘ABAP’ CA ‘AB’. //Condition is TRUE.
Ex. IF ‘ABAP’ CP ‘+B’ //Condition is TRUE because 2nd character is B