Operators in ABAP
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.
Arithmetic Operators
Statements also can be used instead of operators
Relational 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
Example:
5 < 3 is false.
5 GT 3 is True.
5 = 5 is True.
Logical Operators
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
wildcard characters
'*' 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
Comments
Post a Comment