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

operatorsoperator1

 

 

 

 

 

 

 

 

 

Statements also can be used instead of operators

operator2

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.

operator3

 

 

 

 

 

 

 

 

 

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

Popular posts from this blog

Domains and Data Elements

Sample ABAP program for Updating notepad file data to Internal table and Sending it to Application server

OPEN SQL EXAMPLES IN ABAP – PART 2