In ABAP SQL, arithmetic expressions can be used as elements of the field list.

ABAP SQL supports the four basic operators, brackets and three different arithmetics (integer, decimal, and floating point). The value range and precision of intermediate results highly depends on the arithmetic that is used. The arithmetic is derived from the operands used in the expression.

### Example: Some Arithmetic Expressions in ABAP SQL

This example shows two examples for arithmetic expressions in the filed list of an ABAP SQL SELECT statement.

Field SEATS_AVAILABLE is calculated by subtracting the number of occupied seats (table field SEATS_OCCUPIED) from the overall number of seats on that flight (table field SEATS_MAX). Because both operands are of type integer, the result of this expression is also an integer.

Field PERCENTAGE_FLTP calculates the percentage of occupied seats as a number between 0 and 100. For this, it is necessary to multiply the number of occupied seats with literal 100 and divide the result by the overall number of seats. Because the division operator is only available in floating point expressions, all operands have to be converted into type FLTP. As a consequence, the result is also of type FLTP, which is displayed in scientific notation by default.