Arithmetic Operators in SAP ABAP

Arithmetic Operators are used to perform basic operations in mathematics that are used in algebra, Here we are sharing you a list of arithmetic operators in SAP ABAP. Basic mathematical operations in SAP ABAP are carried out using arithmetic operators. Addition (+), subtraction (-), multiplication (*), division (/), and modulus (MOD) are some of these operators. Here we are sharing you a table in which every arithmetic operator is discussed in detail.

Operator

Function

Order

+

Adds the operands

From left to Right

Subtract the operands

From left to Right

*

Multiply the operands

From left to Right

/

Divide the left operand by the right operand

From left to Right

DIV

integer parts after the division of the left operand by the right operand

From left to Right

MOD

Positive remainder of the division of the left operand by the right; 

From left to Right

**

Raises the left Operand to the right Operand

From Right to left

Let’s examine an example:

DATA: num1 TYPE I VALUE 10,
num2 TYPE I VALUE 5,
result TYPE I.
result = num1 + num2. " Addition
result = num1 - num2. " Subtraction
result = num1 * num2. " Multiplication
result = num1 / num2. " Division
result = num1 MOD num2. " Modulus



Output:

15
5
50
2
0



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:

Similar Reads

SAP ABAP Operators

In SAP ABAP, operators are symbols or special characters that apply particular operations on operands. Variables, constants, or expressions can all be considered operands. Numerous operator types are supported by SAP ABAP, such as bitwise, arithmetic, comparison, automated type adjustment, and character string operators....

Arithmetic Operators in SAP ABAP

Arithmetic Operators are used to perform basic operations in mathematics that are used in algebra, Here we are sharing you a list of arithmetic operators in SAP ABAP. Basic mathematical operations in SAP ABAP are carried out using arithmetic operators. Addition (+), subtraction (-), multiplication (*), division (/), and modulus (MOD) are some of these operators. Here we are sharing you a table in which every arithmetic operator is discussed in detail....

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....

Bitwise Operators in SAP ABAP

In SAP ABAP, bitwise operators are used to manipulate data at the bit level. Bitwise AND (&), bitwise OR (|), bitwise XOR (^), and bitwise NOT (~) are some examples of these operators. In ABAP, bitwise operators can be helpful in some situations and are frequently utilized in low-level programming....

Character String in SAP ABAP

Here we are sharing you a table in which every Character string operator is explained:...

Automatic Type Adjustment in SAP ABAP

The data type of an operand can be automatically changed during an operation in SAP ABAP using automated type adjustment operators. For example, you can concatenate strings and add numeric values with the ‘+’ symbol. Here’s one example:...

String Operators in SAP ABAP

In SAP ABAP, strings are worked with using character string operators. These operators include pattern matching (contains, find, find regex), substring (substring, OFFSET), and concatenation (concatenate, &&)....

FAQS on Operators in SAP ABAP:

1. What are logical operators in SAP ABAP? Answer: Logical Operators are used in SAP ABAP for comparing the data. these are also known as conditional or relational operators. These operators include equal to (EQ), not equal to (NE), less than (LT), less than or equal to(LE) , greater than(GT) , and greater than or equal to (GE). Comparison operators in SAP ABAP are utilized to compare data and offer conclusions depending on the comparison’s results. Please refer the above mentioned table for more details....