Show TOC

Function documentationExpression Editor Locate this document in the navigation structure

 

You can use functions in the Expression Editor area of the Link Editor in the SAP Manufacturing Integration and Intelligence (SAP MII) Workbench to modify data before it is used by an input or output of an action.

Features

You can build expressions of the following types:

  • Boolean

  • Byte

  • Calendar or date

  • Double

  • Float

  • Integer

  • Long

  • Short

  • String

  • XML

  • List

  • Map

The following rules apply to expressions:

  • If you are working with strings, all literals must be in double quotation marks. For example, "This is an example of a string that is not a variable."

  • To concatenate strings, use the ampersand character. The plus sign is interpreted as mathematical addition. For example, "This is the first string " & "This is the second string " & VariableNameConcatenated. For more information, see Expression Editor Operators.

  • If you have a quote within a string literal, use an escape character before it so it is properly interpreted. For example, \". If you have a backslash within quotation marks, use two backslash characters. For example, "\\".

  • Datetime input variable values must be in XML format (yyyy-MM-dd'T'HH:mm:ss). For example, 2003-07-25T04:00:00.

  • If an expression does not have the correct data type, an exception occurs. The Transaction attribute, or legacy processing mode, is set to true on imports of transactions from versions before 12.1. The setting is false on new transactions.

  • Calculations that include null values return a value of NA.

  • An expression can comment any expressions using the following syntax: /* My Comment */

  • The expression engine handles implicit conversions whenever possible.

Activities

You can double-click a source property to place it at your cursor's position in the Expression Editor pane. You can also copy a source property into the Expression Editor pane using drag and drop.

You can use source properties as inputs in expressions to perform calculations, and when you click Add, the result of the expression is linked to the selected destination property.

You can click the buttons (addition, subtraction, and so on) to the left of the Expression field to insert the key values at your cursor's position.

To test your expression, click Evaluate.

To insert the value of the selected source element or attribute into the expression, click Property Value.

To define an expression within an expression, click Dynamic Link. You can provide a subexpression to the parent expression at execution time, when the system evaluates the subexpression, replaces it with the appropriate value, and evaluates the overall expression. For example, you can use this function when you are using XPath to select specific nodes in an XML document.

To access list members, use List{<index>}, where index is zero-based. For example, Local.MyList{0} returns the first element in the list.

To add to, remove from, or change the list, use the following list functions:

  • append

  • find

  • insert

  • remove

  • set

  • size

To access map member values, use map{<key>}. To return a value for “name“, use Local.MyMap{“name”}.

You can use the following functions:

  • containskey

  • containsvalue

  • keys

  • put

  • remove

  • size

  • getvalue