Using Variables in Browser-Based PI Sheets and Cockpits 

Use

When defining process instructions, you can use simple or global variables that you have defined in another process instruction:

You can use variables in the following functions, for example:

Prerequisites

Exception:
The following system variables that are defined by SAP and start with SY_ need not be defined in the process instruction:

System Variable

Meaning

SY_MODE

Current mode of the PI sheet

SY_TEST

Status of the PI sheet (test or active)

SY_ROW

Current table line

SY_VALUE and X

Refers to the immediately preceding input value

See also: Using System Variables

The data type of a variable is identical to that of the characteristic or parameter to which it refers.

See also: Definition of Variables

Activities

Using Simple Variables

Simple variables defined in a simple data request or function call refer to exactly one value. In this case, you must only enter the variable name to transfer the value into another process instruction.

Simple variables defined in a repeated data request, however, represent an entire table column. To refer to a specific table entry, you must extend the variable name. The following rules apply:

<Variable name>_1

->

Value in first line of table

<Variable name>_2

->

Value in second line of table

And so on

 

And so on

<Variable name>_SUM

->

Sum of the values in the table column

<Variable name>_COUNT

->

Number of values in the table column

Using Global Variables

You may define and use global variables in simple data requests of PI sheets only. You must first declare the global variable in the control recipe in which you want to use it. You can declare and use as many global variables in a process instruction as you like.

To do so, you define the following information in the process instruction:

To enter this information, you assign the following characteristics to the process instruction in the order specified below:

Characteristic

Meaning

Allowed Values

PPPI_DECLARE_VARIABLE

Declaration of global variable

Existing variable name

PPPI_VARIABLE_TYPE

Type of variable

Characteristic used to define the global variable

You cannot use global variables to transfer entire tables (repeated data request) to another control recipe.

However, you can refer to individual values in a table. To do so, you must define a variable with an extension for the relevant table line for each table value by adding _1, _2, _3, and so on to the variable name for each table line.

Example:

VALUE_1 -> Value in the first table line
VALUE_2 -> Value in the second table line
and so on

To be able to use the variables in a control recipe, you must then first declare each name (along with the above extension) in the recipe in which you want to use the variable.