Thursday, April 25, 2013

0 Operators in ABAP


Operators in SAP ABAP
In the abap we have 3 types of operators
1.Mathematical Operator
2.Comparitive Operator
3.Relational (or) Logical Operator
Mathematical Operator:
         Basic operations +,-, / and * along with functions like sin, sqrt etc. are supported
         Priority of the operations
        functions ,
        exponential
        multiplication  ,division
-       addition  , subtraction
Operators
Description
Example
      +
Addition
3+2 = 5
      -
Subtraction
3-2 = 1
      *
Multiplication
3*2 = 6
     **
Exponential
3**2 = 9
     /
 Division
10/2 = 5.
  Mod
Reminder of division of 2 integers
3 mod 2 = 1

Comparitive Operator:

Operators
Description
Example
<(or) LT
Less than
a < b (or) a LT B
> (or) GT
Greater than
a > b (or) a GT b
< =(or) LE
Less than or equal
a <= b (or) a LE b
>= (or) GE
Greater than or equal
a >= b (or) a GE b
 = (or) EQ
Equal
a = b  (or) a EQ b
<> (or) NE
Not equal
a <> b (or) a NE b


Relational (or) Logical Operator:
Operators
Description
Example
AND
and
(a<b) and (a<c)
OR
or
(a<b) or (a<c)
NOT
not
A NOT b

Operands:
Operands are the variables which we need to perform the particular operator
Ex: c = a + b.
Here a,b and c are the operands and + and = are operators 
 

SAP-ABAP Copyright © 2011 - |- Template created by Vishnu - |- Powered by Blogger Templates