| Parameter | Reference | Type | Length | Default | Optional | Text |
|---|---|---|---|---|---|---|
| FORMULA | 0 | Formula to be checked | ||||
| PROGRAM | 0 | SPACE | X | Program for value assignment to a variable | ||
| ROUTINE | 0 | SPACE | X | Routine for value assignment to a variable | ||
| UNIT_OF_MEASURE | 0 | SPACE | X | Unit of measurement for calculated value |
| Parameter | Reference | Type | Length | Text |
|---|---|---|---|---|
| FUNCNAME | 0 | Function name of the called routine | ||
| MESSAGE | 0 | Error Message | ||
| POS | 0 | Position of first error | ||
| SUBRC | 0 | Error status |
| Exception | Text |
|---|---|
| ERROR_IN_FORMULA | Error in formula (with MESSAGE E... RAISING) |
| MISSING_PARAMETER | Program or Routines Missing for Variables |
|
Functionality
IF ,,ELSE Example: FORMULA = COS(A**2+B**2) FORMULA = IF X>0 THEN SIN(X) ELSE SIN(-X) FORMULA = SY-TZONE / 2.324 The following operands are allowed: The FM supports the following functions: ABS,,absolute value ,,Example: FORMULA = ABS(-2) ,,result: 2 NOT,,negation ,,Example: FORMULA = IF NOT(2<3) THEN (5*6) ELSE (5-7) ,,result: -2 SIN,,sine function ,,Example: FORMULA = SIN(PI/2) ,,result: 1 COS,,cosine function ,,Example: FORMULA = COS(0) ,,result: 1 TAN,,tangent function ,,Example: FORMULA = TAN(2*PI) ,,result: 0 LOG,,logarithm to base e (natural logarithm) ,,Example: FORMULA = LOG(2.7182746352) ,,result: 1 EXP,,exponential function to base e ,,Example: FORMULA = EXP(1) ,,result: 2.7182746352 SQRT,,square root function ,,Example: FORMULA = SQRT(144) ,,result: 12 ROUND,,round to a whole number ,,Example: FORMULA = ROUND(3.14159) ,,result: 3 TRUNC,,truncate; the whole number part of a real number ,,Example: FORMULA = TRUNC(5/3) ,,result: 1 MOD,,modulus function ,,Example: FORMULA = 10 MOD 3 ,,result: 1 DIV,,whole number part of a division ,,Example: FORMULA = 10 DIV 3 ,,result: 3 The operators are classified in 6 priority groups. The operators ingroup 0 have the lowest priority and those in group 6 the highest. The operators are: AND,,logical AND OR,,logical OR =,,equals <>, ><,,not equals <,,less than >,,greater than <=, =<,,less than or equal to >,,greater than =>, >=,,greater than or equal to +,,plus value (of an expression) -,,minus value (of an expression) +,,addition -,,subtraction *,,multiplication /,,division **,,exponent ABS,,absolute value NOT,,negation (of a logical expression) You can define functions in a table like TFKT and use them as well asstandard functions. The function name is the table key. The table andfunction names (separated by a colon) are specified in calls. Example The FORMULA User-defined functions can be nested. Example: The expression If a user group needs another table than TFKT (e.g. to structure thekey or include user fields), the reference table TFKT should be copied.User functions can be inserted from position 79. Tables used to store FORMULAs must have a key length of 13 and afunction length of 65. Notes Description Description Value range Default Description Default Description Value range Description Default Description Description Value range |