Conditions, formulas, substitute functions

In the production master data, which include resource lists, operations, routings, and bills of material, it is possible to add the following data to particular line items:

  • Alternative item – it makes it possible to define an alternative item to be available in the Production orders application
  • Substitute function – it allows the user to define a condition in the Operations or Bills of material applications, according to which a given material or resource will be substituted
Example
If an item is ordered in a specific color variant, a material with a particular color can be defined in a bill of material, which will be taken from the warehouse and will change according to the color variant of the ordered item. This dependency will be described by a substitute function.
  • Main condition – it allows the user to define a condition for a line item that will allow this line item to be used in production only if the value of the condition is TRUE. Conditions can also be used in product configuration rules.
Example
Different casing colors can be added in a bill of material. Depending on the item ordered, it is possible to use a condition to define which casing will be used in the production process.
  • Formulas – they are used in operations or bills of material in order to flexibly calculate fixed and variable quantities, setup times, processing times, or buffering times. Formulas require conditions that need to be set as TRUE in order to perform calculations using a given formula. Formulas may also be used in calculation schemas and product configuration rules.
Example
An example of a formula may look as follows: “If a pink item has been ordered (condition), subtract 10 minutes from the assembly operation (formula).”

Apart from formulas, in some cases it is also possible to use conditions in calculation schemas and product configuration rules. Production master data can react to all kinds of outside influences and/or output data. The following figure presents some examples.

Examples of data affecting master data

A line item is calculated during the production order dispatching and planning, taking into account such conditions, formula definitions, and substitute functions. Presented mathematical functions and operators are available in the Calculation and Production frameworks.

There is no separate application for determining conditions, formula definitions, and substitute functions. Instead, it is done in the following applications:

  • Operations, for the line items of:
    • resources
    • resource lists
  • Routings, for the line items of:
    • operations
    • routings
  • Bills of material, for the line items of:
    • items
    • co-products
    • bills of material
  • Resource lists, for the line items of:
    • resources
  • Production orders, for the line items of:
    • material reservations
    • operation reservations
    • external manufacturing operations
    • resource reservations

The following rules must be met in order to use alternative items, substitute functions, main conditions, and formulas:

  • The user can specify conditions for each line item; several main conditions are possible
  • The user has the possibility to add one substitute resource to each line item; when specifying a substitute resource, it is also possible to provide conditions
  • The variable and fixed target values of a line item can be calculated using formula definitions
  • It is possible to define lists of alternative items

To create a new condition in applications that allow this, the user should select the button [Edit condition with substitute or formula of selected line item] that opens the Manage conditions with substitute or formulas dialog box. The button is available in the work pane table and in the line item editor.

Hint
Data with defined functions are assigned a relevant symbol if:

  • There is an alternative item – the system displays the icon
  • There is a condition – the system displays the icon
  • There is a formula – the system displays the icon

Manage conditions with substitute or formulas dialog window

Manage conditions with substitute or formulas dialog window

The Manage conditions with substitute or formulas dialog window is composed of:

  • Line item table – it contains all defined line item functions
  • Line item editor – it allows defining and assigning functions to line items
Hint
To open the window, it is necessary to select a line item for which conditions are to be defined.

Line item table

The line item table is composed of the following fields and buttons:

  • Sequence – it allows defining a line item sequence number that will be displayed in the line item editor after selecting the [Process] button
  • [Process] – it enables editing a selected line item or sequence
  • [Mark/unmark for deletion] – it allows setting/deleting a deletion marker for a function line item. The line item will be deleted after confirming and closing the window with the [Accept] button and finishing the editing of the line item in the main application with the [Accept current line item] button.
  • [Validate] – it allows the system to verify formulas and conditions added
  • [Output pages already displayed into file] – it exports table data into an XLS file
  • [Show/hide title bar] – it displays/hides the row with table column names

The table is composed of the following columns:

  • Text note – it displays the symbol of a defined function. Available options include:
    • Alternative item
    • Substitute function
    • Main condition
    • Formula
  • Sequence – it displays a number assigned to a line item in the table
  • Condition – it displays a condition defined for a line item
  • Formula – it displays a formula defined for a line item
  • Substitute/Alternate – it displays the name of a defined substitute/alternative item

Line item editor

The line item editor in the Manage conditions with substitute or formulas dialog window is composed of the following buttons:

  • [New line item of selected category] – it allows the user to add a new function according to the previously edited category
  • [New alternative] – it allows defining an alternative item. More information may be found in the Line item editor – [New alternative] chapter.
  • [New substitute function] – it allows defining a substitute function. More information may be found in the Line item editor – [New substitute function] chapter.
  • [New main condition] – it allows defining a new main condition. More information may be found in the Line item editor – [New main condition] chapter.
  • [New formula] – it allows defining a new formula. More information may be found in the Line item editor – [New formula] chapter.
  • [New] → [Duplicate] – it allows duplicating an existing condition
  • [Accept current line item] – it allows defining and accepting a function
  • [Mark/unmark for deletion] – it allows setting/deleting a deletion marker for a function line item
  • [Validate when accepting] – it allows performing validation when the [Accept current line item] button is selected
  • [Validate] – it allows the system to verify formulas and conditions added. More information about the validation process may be found in the Checks chapter

Line item editor – [New alternative]

It makes it possible to define an alternative item for a line item. It contains the following fields:

  • Sequence – it allows defining an appropriate numbering sequence for a given line item. By default, it is generated automatically from the value of 10 in a sequence of 10 increments. This allows the user to add new line items between the existing ones.
  • Item – it makes it possible to define an alternative item for a line item. The item can be either selected manually from a production order or automatically according to a condition defined in the Condition field.
  • Condition – it allows defining a condition that will make it possible to use the defined alternative item instead of the original one when the condition’s value is TRUE
Hint
Only inventory items containing inventory management data can be selected as alternative items.

Alternative items may only be created for material line items in bills of material.

It is not possible to create alternative items in the line items of production orders.

If the user wants to select one of available alternative items in a production order, it is necessary to select the button [Display list of alternative items].

Line item editor – [New substitute function]

It makes it possible to define a substitute function for a line item. It contains the following fields:

  • Sequence – it allows defining an appropriate numbering sequence for a given line item. By default, it is generated automatically from the value of 10 in a sequence of 10 increments. This allows the user to add new line items between the existing ones.
  • Condition – it allows defining a condition that will make it possible to carry out the substitution process when the condition’s value is TRUE
  • Substitution category – it allows determining on what basis the system will substitute a given line item. Available options include:
    • Item/resource – it allows defining a specific item or resource that will substitute a given line item
    • Formula – it allows defining a formula based on which the system will substitute a given line item. This gives more flexibility when substituting line items. For instance, it means that user-defined configuration parameters can also be used as substitute items or resources.
  • Item/Resource – it allows defining an alternative item/resource for a line item. The item can be either selected manually from a production order or automatically according to a condition defined in the Condition field. The field is activated after selecting the substitution category Item/resource. The field’s name changes accordingly, depending on the line item being edited. If the user adds a substitute function for a resource, the field’s name is displayed as Resource. If the user adds a substitute function for a material, the field’s name is displayed as Item.
  • Formula – it allows defining a formula. For instance, it means that user-defined configuration parameters can also be used as substitute items or resources. Formulas are created on the basis of queries and functions described in detail in the Conditions, formulas, and substitute functions chapter.
Hint
A selected substitute resource must be of the same category as the original resource.

For a resource list line item, an assigned resource or resource group can be substituted with another resource or another resource group.

For an operation line item, an assigned resource, resource group, or resource list can be substituted with another resource, another resource group, or another resource list.

For bill of material line items (items or co-products), an assigned item may be substituted with another item.

Note
A single condition may be used when creating multiple substitute resources. When doing so, their sequence must be observed. After a line item has been accepted as valid based on the main condition, the resolution of the substitution condition starts. It ends with the first valid substitution condition found.
Note
It is not possible to create substitute resources in the line items of production orders and routings.

Line item editor – [New main condition]

It allows defining a new main condition for a line item. It contains the following fields:

  • Sequence – it allows defining an appropriate numbering sequence for a given line item. By default, it is generated automatically from the value of 10 in a sequence of 10 increments. This allows the user to add new line items between the existing ones.
  • Condition – it allows defining a condition that will make it possible to accept the line item when the condition’s value is TRUE.
Note
It is possible to define multiple main conditions. When doing so, their sequence must be observed. The resolution of conditions ends with the first valid condition found; this condition is then used. It is not possible to create main conditions in the line items of production orders.

Line item editor – [New formula]

It makes it possible to define a new formula for a line item. It contains the following fields:

  • Sequence – it allows defining an appropriate numbering sequence for a given line item. By default, it is generated automatically from the value of 10 in a sequence of 10 increments. This allows the user to add new line items between the existing ones.
  • Formula category – depending on the application, it allows defining a formula reference. The following categories are available in particular applications:
    • Operations:
      • Processing time
      • Setup time
      • Resource count
    • Routings:
      • Variable quantity
      • Buffer time before
      • Buffer time afterward
    • Bills of material:
      • Fixed quantity
      • Variable quantity
  • Condition – it allows defining a condition that will make it possible to use the formula when the condition’s value is TRUE.
  • Formula – it allows defining a formula for calculating data defined in the Formula category field. To create a formula, components presented in the Conditions, formulas, and substitute functions chapter should be used.

In the Bills of resources application, it is not possible to define formulas for line items.

If formulas are entered in the line items of production orders, they will be resolved when executing the [Change due date/quantity] action in the course of quantity recalculation.

Example
Formula definitions always require mathematical constants (e.g. 12) and/or mathematical functions and/or operations,
for instance: 2 * ProdPlan.DURCHMESSER * MATH.PI.

Line item editor – Texts tab

This tab makes it possible to add texts to the functions entered.

Conditions, formulas, and substitute functions

The following tables present elements used to create formulas and conditions.

Mathematical constants

ConstantExplanation
Math.E Euler’s number e (≈ 2,718281…)
Math.PI Constant PI (≈ 3.14159…)

Mathematical functions

FunctionExplanation
round(x, y) Round the value x to y decimal places
abs(x) Absolute value
min(x, y) Minimum of the two values
max(x, y) Maximum of the two values
floor(x) Round down to integer
ceil(x) Round up to integer
ex(x) Euler’s number e (≈2.718281…), to the power of x
ln(x) Natural logarithm of x
pow(x, y) x to the power of y
sqrt(x) Square root of x
cos(x) Cosine of x in radians
acos(x) Arc cosine of x in radians
sin(x) Sine of x in radians
asin(x) Arc sine of x in radians
tan(x) Tangent of x in radians
atan(x) Arc tangent of x in radians
atan2(x, y) Gives the theta value in polar coordinates for the point (x,y) in Cartesian coordinates
toDegrees(x) Convert angle x from radians into degrees
toRadians(x) Convert angle x from degrees into radians

Mathematical operators

OperatorExplanation
=Equals
>; >=Is greater than; is greater than or equal
<; <=Is less than; is less than or equal
<> Is not equal
toDecimal(String) Using this operation, it is possible to perform type casting and convert strings into numeric values.

Example:
If LENGTH is a selection field of a product configuration for a length specification in meters with the discrete values of 10, 20, 30, toDecimal(ITEM_PRODCONF.LENGTH) will, e.g., return a numeric value of 10 with which a bill of material quantity can be recalculated.

The conversion is performed according to the number format (decimal separator, etc.) stored in the user settings.
toString(Decimal) Using this operation, it is possible to perform type casting and convert numeric values into strings.

The conversion is performed according to the number format (decimal separator, etc.) stored in the user settings.
+Plus
-Minus
*Multiplication
/Division
%Remainder (modulo)

Example:
11/3=3, remainder 2
Syntax: 11%3, result: 2
Hint
Using inequality symbols, only the same types can be compared. Where applicable, the user may also convert the types accordingly by means of the operation toDecimal() or toString().

Parentheses

ParenthesisExplanation
(Open parenthesis
) Closed parenthesis
Hint
Parentheses can be used to enable validation apart from the usual priority rules. The user should make sure to always use parentheses in pairs, i.e. each open parenthesis must be closed again.

Variables

The following functions are available as variables in a concrete dispatching or planning context and refer to configuration, production, or item master data:

Item-based variables

VariableExplanation
ITEM_PRODDATA.name

TOP_ITEM_PRODDATA.name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Items application (Production view, Other fields tab). It refers to production items.

The name variable is the identification of the field (not the field’s description).

The TOP prefix allows the user to refer the function to an item that is highest in the production structure.
ITEM_INVDATA.name

TOP_ITEM_INVDATA.name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Items application (Inventory Management view, Other fields tab). It refers to production items.

The name variable is the identification of the field (not the field’s description).

The TOP prefix allows the user to refer the function to an item that is highest in the production structure.
ITEM_PROPERTY.name

TOP_ITEM_PROPERTY.name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Item characteristic classifications application. It refers to production items.

The name variable is the identification of the field (not the field’s description).

The TOP prefix allows the user to refer the function to an item that is highest in the production structure.
ITEM_PRODCONF.nameIt makes it possible to define a formula referring to item configuration defined in the Product configuration rules application. It refers to production items.

The name variable is the identification of the field (not the field’s description).
MATERIAL_PRODDATA. name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Items application (Production view, Other fields tab). The function refers to items that are materials in a given production process.

The name variable is the identification of the field (not the field’s description).
MATERIAL_INVDATA. name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Items application (Inventory Management view, Other fields tab). The function refers to items that are materials in a given production process.

The name variable is the identification of the field (not the field’s description).
MATERIAL_PROPERTY. name
It makes it possible to define a dependent formula containing a value in a user-defined field in the Item characteristic classifications application. The function refers to items that are materials in a given production process.

The name variable is the identification of the field (not the field’s description).
ORDER.ITEM

TOP_ORDER.ITEM
It makes it possible to refer a formula to a production item in a production order.

The TOP prefix allows the user to refer the function to an item that is one level higher in the production structure.
ORDER.VARIANT

TOP_ORDER.VARIANT
It makes it possible to refer a formula to a variant of a production item in a production order.

The TOP prefix allows the user to refer the function to an item that is one level higher in the production structure.
ORDER.PRODQTY

TOP_ORDER.PRODQTY
It makes it possible to refer a formula to a quantity of a produced item in a production order.

The TOP prefix allows the user to refer the function to an item that is one level higher in the production structure.
ORDER.METHOD

TOP_ORDER.METHOD
It makes it possible to refer a formula to a selected production method for a production item in a production order.

The TOP prefix allows the user to refer the function to a production method that is one level higher in the production structure.
Production structure – How TOP prefix works

[Indicator]In the case of multi-level dispatching, no reference can be made to a production item, e.g. ORDER.ITEM or ITEM.PROPERTY. In the case of this dispatching category, a subordinate production order is resolved in a production order, becoming part of it.[/indicator]

Formulas referring to operations, routings, and bills of material

VariableExplanation
ProdPlan.NAME Routing and/or bill of material identification
ProdPlan.VARQTY Variable quantity
ProdPlan.BASEQTY Reference factor of routing or bill of material
ProdPlan.SCRAP Rejects factor
ProdPlan.PERF Performance grade
ProdPlan.nameIt makes it possible to define a dependent formula containing a value in a user-defined field in the Operations application on the Parameters tab.

The name variable is the identification of the field (not the field’s description).

Formulas referring to resources and resource groups

VariableExplanation
Resource.NAME Resource identification
Resource.GROUP Resource group identification
Resource.FIXTIME Fixed time
Resource.VARTIME Variable time
Resource.BASEQTY Reference factor of the operation
Resource.SCRAP Rejects factor
Resource.PERF Performance grade
Resource.
NUMBER_OF_RESOURCES
Number of resources to be utilized in production. It is only usable with shift-specific dispatching.
Resource.nameIt makes it possible to define a dependent formula containing a value in a user-defined field in the Operations application on the Parameters tab.

The name variable is the identification of the field (not the field’s description).

Checks

The system checks the syntax of defined data when the user creates conditions and formulas. Logical structures are not checked. Besides, when using variables in formulas and conditions, only such variables take concrete effect that are given in the direct context.

Example
A “ProdPlan.PARM1” operation variable provided with the condition of a bill of material line item has no impact since it refers to routing parameters and therefore it cannot be used in this context.

When using variables within conditions, it is necessary to observe the respective data types:

  • Alphanumeric data types must be put in double quotes.
    Example: ORDER.ITEM = ”10010”
    The line item will be applied if the main item of a production order equals 10010. Since the item number represents an alphanumeric data type, it must be put in double quotes within the condition.
  • Numeric data types must be indicated without any special marking.
    Example: ORDER.PRDQTY > 500
    The line item will be applied if the quantity of a production order is greater than 500. Since the quantity represents a numeric data type, the user must not indicate any special marking.
  • Business objects need to be put in double quotes as well. In this case, the functional key of a business object is used as a string.
  • Quantity and currency fields are generally used without units
  • Date fields are used according to the date format set in the system
  • When defining functions for classifications, it is always necessary to indicate a hierarchy leaf. The user should specify KLA = “A” to compare with 1-1-A.
  • Multiple values in conditions are connected by common Boolean operators such as AND and OR.
    Example of use and correct syntax:
    Correct:
    ITEM_PRODCONF.PAR = ”A” OR
    ITEM_PRODCONF.PAR = ”B”
    Incorrect:
    ITEM_PRODCONF.PAR = ”A” OR ”B”

Including substitute items

A special case of the substitute function is the use of an item’s replacement status. After changing a replacement status in the Items application from Not replaced to Replaced if availability = 0, an additional field is displayed, allowing the selection of a substitute item. Note that this special case only works if the sales organization is a manufacturing organization. When a production order is dispatched, a material defined in this way is then replaced by the specified substitute item.

The function may be deactivated through the following system property: com.cisag.app.production.SkipItemReplacement=true.

Czy ten artykuł był pomocny?