What does it do? Arithmetic expression in AB_SQL . The operators perform arithmetic calculations between two adjacent operands sql_exp1>, sql_exp2 >, .... The possible operators are:
+> for adding the operands
-> for subtracting the right operand from the left operand
*> for multiplying the operands
/> for dividing the left operand by the right operand The operators *> and /> have a higher priority than the operators +> and ->. Within a parenthesis level>, operations with a higher priority are performed before those with a lower priority. Operations with identical priorities are performed from left to right. A minus sign -> can be placed in front of an operand that does not directly follow an operator +>, ->, *> , or />. The arithmetic expressions in AB_SQL are distinguished depending on the data type of the operands as follows:
Integer expressions Integer expressions use only integer operands, regardless of the parenthesis level. These have the dictionary type INT1> , INT2>, INT4>, and INT8> or the ABAP type b> , s>, i>, and int8> plus packed numbers of the types DEC>, CURR>, and QUAN> or p> without decimal places. The operator /> is not allowed in integer expressions. An overflow occurs and an exception of the class CX_SY_OPEN_SQL_DB> is raised when
the value range of the type INT4> or i> is exceeded in operations between two integer numbers where neither of the numbers has the type INT8>,
the value range of the type INT8> or int8> is exceeded in operations between two integer numbers where one of the numbers has the type INT8>,
the value range of a packed number with length 31 without decimal places is exceeded in operations using packed numbers. Depending on the types of the operands and whether packed numbers are involved, the result has the type INT4>, INT8> or is a packed number with length 31 and no decimal places. Using the associated assignment rule>, it can be assigned to all numeric ABAP types> whose value range is large enough, except for decimal floating point numbers.