Lesson 16 – Arithmetic, Logical and Other Operators

Lesson 16 – Arithmetic, Logical and Other Operators

In SAP, we use all the operators like arithmetic, logical, Relational operations and Control statements.

 

1) Arithmetic Operators –

 

All the arithmetic operations are operated in the below mentioned manner.

 

+,     -,     /,     *,     MOD

 

2) Relational Operators –

 

All the relational operations are operated in the below mentioned manner.

 

EQ OR = OR Equals to
GE OR >= OR Greater than Equals to
GT OR > OR Greater than
LE OR <= OR Less than equals to
LT OR < OR Less than
NE OR <> OR Not equals to

 

3) Logical Operators –

 

All the logical operations are operated in the below mentioned manner.

 

AND
OR
NOT

 

4) Control Statements –

 

All the Control Statement operations are operated in the below mentioned manner.

 

a) If < Condition >

 

Statements ….

 

Endif.

 

b) If < Condition >

 

Statements ….

 

Else.

 

Statements ….

 

Endif.

 

c) If < Condition >

 

Statements ….

 

Elseif < Condition >.

 

Statements ….

 

Elseif < Condition >.

 

Statements ….

 

Else.

 

Statements ….

 

Endif.

 

d) Case < Field >

 

When < Value >.

 

Statements ….

 

When < Value >.

 

Statements ….

 

When Others.

 

Statements ….

 

Endcase.

 

e) Do [n] times.

 

Statements ….

 

enddo.

 

f) While < Condition >.

 

Statements ….

 

Endwhile.

 

Exit.

 

Note : EXIT keyword terminates the current loop.

 

g) CHECK key word terminates single loop pass conditionally.

 

Do [n] times.

 

Statements ….

 

Check < Condition >.

 

Enddo.

Add a Comment

Your email address will not be published. Required fields are marked *