Syntax documentation Using Arithmetic Operations Locate the document in its SAP Library structure

Basic Arithmetic Operations:

You can use the following basic arithmetic operations in dependencies to perform calculations:

+ Addition

- Subtraction

/ Division

* Multiplication

Example

CHAR_WIDTH = CHAR_LENGTH / 4

Standard Functions

You can use the following standard functions:

sin

Sine function

cos

Cosine function

tan

Tangent function

exp

Exponent for base e

ln

Natural logarithm

abs

Absolute amount

sqrt

Square root

log10

Logarithm for base 10

arcsin

Arc sine (inverse function of sin)

arccos

Arc cosine (inverse function of cos)

arctan

Arc tangent (inverse function of tan)

sign

Sign (plus or minus sign) of x

frac

Decimal part of x

Example

SIN (2*3.14 * ANGLE / 360)

No distinction is made between upper and lower case letters in functions. Function names are automatically converted to upper case letters.

Precision and Rounding for Numeric Characteristics

You can use the following commands to round a value calculated by dependencies:

Function

Description

X = 3.1

X = -3.1

ceil

Lowest integer that is not less than x

+4

-3

trunc

Integer part of x

+3

-3

floor

Highest integer that is not greater than x

+3

-4

Example

Use in an action:

$SELF.CHAR_A = FLOOR ($SELF.CHAR_B + $SELF.CHAR_C + 0.5)

The action calculates the sum of characteristics B and C and rounds the result to an integer.

You see the rounded value on the screen. However, if the value is used in subsequent calculations, the exact value is used, not the rounded value.

 

Leaving content frame