A range of language elements is supported for dependencies. The language elements that are relevant to classification are described briefly below. For more information on dependencies, see the SAP LO Library Variant Configuration in the section Syntax of Object Dependencies.
General Rules
Put character strings used in dependencies in single quote marks ('). Example: COLOR = 'red'
Note that when you refer to a characteristic or a characteristic value in a dependency, use the language-independent key (name).
You cannot use characteristic names that contain a hyphen in dependencies
Tables and Functions
In dependencies, you can refer to tables or functions created in the variant configuration menu, as well as to characteristics and characteristic values. You can use tables to specify allowed combinations of characteristic values. You can use these tables to check the consistency of the values assigned or to infer values. You can use functions to call your own function modules to copy characteristic values to a dependency.
For more information on creating and using tables and functions, see the SAP LO - Library Variant Configuration.
Comparison Operators
As a rule, a condition consists of one or more comparisons. You express these using the operators in the table below:
Operator 1 |
Operator 2 |
Operator 3 |
Meaning |
< |
LT |
less than |
|
<= |
=< |
LE |
less than or equal to |
= |
EQ |
equal to |
|
> |
GT |
greater than |
|
>= |
=> |
GE |
greater than or equal to |
<> |
>< |
NE |
not equal to |
Example
COLOR = 'red' or COLOR EQ 'red'
LENGTH > '100' or LENGTH GT '100'
Logical Operators
To combine conditional expressions, you can use the logical operators AND, OR, and NOT.
LENGTH EQ '300' AND WIDTH LT '200'
This condition is fulfilled if LENGTH has a value of exactly 300 and characteristic WIDTH has any value that is less than 200.
Arithmetical Expressions
You can also include calculations in conditions. You can use any of the arithmetical expressions shown in the table below:
Character |
Meaning |
+ |
Addition |
- |
Subtraction |
/ |
Division |
* |
Multiplication |
sin |
Sine function |
cos |
Cosine function |
tan |
Tangent function |
exp |
Exponent for base e |
In |
Natural logarithm |
abs |
Absolute |
sqrt |
Sqaure root |
LENGTH * WIDTH + 4
LENGTH * SIN(0.5)
1. The only decimal point allowed in figures with decimal places is a period ('.'). Settings in your user master record are not relevant.
2. You must make all your entries for trigonometric functions (cos, sin, or tan) in radian measure,
Special Expressions
IN
You use IN to express that the characteristic value is within the allowed values defined. This allows you to express an OR relationship.
COLOR IN ('red', 'blue', 'green')
This dependency is only processed if characteristic COLOR has one of these values.
LENGTH IN (250 - 350)
This dependency is only processed if the value of characteristic LENGTH is within the closed interval from 250 to 350.
SPECIFIED:
The condition is fulfilled if the characteristic has any assigned value. You can only use the expression NOT SPECIFIED in procedures.
SPECIFIED Extras
The dependency is only processed if a value is assigned to characteristic EXTRAS.
$SELF
In actions, you must declare exactly to which object the action refers. In classification, an action always refers to the object being classified, so you must start the source code of each action with the expression $SELF.
$SELF.MODEL EQ ‘Childrens_bike’
IF
You can include a condition in an action. You use IF to connect the condition to the action.
$SELF.QUANTITY = ‘6’ if LENGTH > 200