Comparison/ Relational Operators in SAP ABAP
Comparison operators in SAP ABAP are utilized to compare data and offer conclusions depending on the comparison’s results. These operators include equal to (EQ), not equal to (NE), less than (LT), less than or equal to(LT) , greater than(GT) , and greater than or equal to (GE). Here we are sharing you a table in which every comparison operator is discussed in detail.
Operator |
Function |
---|---|
=, EQ |
returns true If two operands are equal to each other |
<>, NE |
returns true If two operands are not equal to each other |
<, LT |
returns true If first operand is less than second. |
>, GT |
returns true If first operand is greater than second. |
<=, LE |
returns true If first operand is less than or equal to second. |
>=, GE |
returns true If first operand is greater than or equal to second. |
IS INITIAL |
returns true if the variable declared is not modified |
IS NOT INITIAL |
returns true if the variable declared is modified |
a BETWEEN b AND c (INTERVAL TEST) |
returns true if a lies in between b and c |
Here’s an example:
DATA: value1 TYPE I VALUE 10,
value2 TYPE I VALUE 20,
result TYPE C LENGTH 1.
IF value1 EQ value2.
result = 'X'. " True
ELSE.
result = ' '. " False
ENDIF.4
Output:
False
Operators in SAP ABAP
High-level programming languages like SAP ABAP (Advanced Business Application Programming) are used to create apps in the SAP environment. Operators are essential for the execution of many different operations in SAP ABAP, ranging from straightforward arithmetic computations to complex logical analyses. This article will examine the various SAP ABAP operator types and offer examples to show how to use them.
Table of Content
- SAP ABAP Operators
- Arithmetic Operators in SAP ABAP
- Comparison/ Relational Operators in SAP ABAP
- Bitwise Operators in SAP ABAP
- Character String in SAP ABAP
- Automatic Type Adjustment in SAP ABAP
- String Operators in SAP ABAP
- FAQS on Operators in SAP ABAP: