Entering content frameFunction documentation Using Variables in Browser-Based PI Sheets and Cockpits Locate the document in its SAP Library structure

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.

Example

The simple variable VAR is defined for the input value "Material quantity". The value of variable VAR is to be displayed in process instruction 0020 of the same PI sheet.

Process instruction 0010:

PPPI_INPUT_REQUEST

Material quantity

 

PPPI_VARIABLE

VAR

 

PPPI_REQUESTED_VALUE

PPPI_MATERIAL_QUANTITY

Process instruction 0020:

PPPI_OUTPUT_TEXT

Material quantity

 

PPPI_OUTPUT_VARIABLE

VAR

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

Note

Variables referring to tables are transferred line by line. If you want to display a variable as the default value (PPPI_DEFAULT_VARIABLE), for example, the system displays the relevant default value when a new line is added. If no value has been assigned to a variable, the new line in the output table remains empty.

Using Global Variables

When using global variables, you can choose from the following options:

For more information on Manufacturing Data Access, see:

You use the following characteristics in the sequence specified:

Read Data

 

Characteristic

Meaning

PPPI_DATA_ACCESS

Manufacturing Data Access

 

PPPI_BUTTON_TEXT

Text for pushbutton

 

PPPI_FUNCTION_DURING_DISPLAY

Setting to specify whether the function is permitted in display mode

 

PPPI_IMPORT_DATA

Global variable of the application from which the value is to be transferred to the subsequent variable

 

Parameter characteristic

Variable names with the corresponding data type

Example
Global variable VARGL is defined for the input value "Material quantity" in cockpit PMC1.
The value of the global variable VARGL is to be read as a data point in cockpit PMC2 using Manufacturing Data Access. The value of variable VARGL is to be transferred to the local variable VARLC and displayed in the cockpit.

Cockpit PMC1:

PPPI_INPUT_REQUEST

Material quantity

 

PPPI_GLOBAL_VARIABLE

VARGL

 

PPPI_REQUESTED_VALUE

PPPI_MATERIAL_QUANTITY

Cockpit PMC2:

PPPI_DATA_ACCESS

Manufacturing Data Access

 

PPPI_BUTTON_TEXT

Read material quantity from PCM1

 

PPPI_FUNCTION_DURING_DISPLAY

Permitted

 

PPPI_IMPORT_DATA

PMC:1100.PMC1.VARGL

 

PPPI_STRING_VARIABLE

VARLC

 

PPPI_OUTPUT_TEXT

Material quantity from PMC1

 

PPPI_OUTPUT_VARIABLE

VARLC

Write Data

 

Characteristic

Meaning

PPPI_DATA_ACCESS

Manufacturing Data Access

 

PPPI_BUTTON_TEXT

Text for pushbutton

 

PPPI_FUNCTION_DURING_DISPLAY

Setting to specify whether the function is permitted in display mode

 

PPPI_EXPORT_DATA

Data point or global variable of the application into which the value of the subsequent variable is to be transferred

 

Parameter characteristic

Variable names with the corresponding data type

To enter this information, you assign the following characteristics to the process instruction in the sequence 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

Example

PI sheet 0001:

PPPI_INPUT_REQUEST

Material quantity

 

PPPI_GLOBAL_VARIABLE

VARGL

 

PPPI_REQUESTED_VALUE

PPPI_MATERIAL_QUANTITY

PI sheet 0002:

PPPI_DECLARE_VARIABLE

VARGL

 

PPPI_VARIABLE_TYPE

PPPI_MATERIAL_QUANTITY

 

PPPI_OUTPUT_TEXT

Material quantity from

 

PPPI_OUTPUT_VARIABLE

VARGL

Note the following with repeated data requests:

You can use global variables, to transfer entire tables (repeated data request) to another control recipe, for example to a function module.

At present, it is, however, not possible to display the entire table in the PI sheet. 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. To do so, you add the suffix _1, _2, _3 and so on to the variable name for every table line.

Example:

WERT_1 -> Value in the first table line
WERT_2 -> Value in the second table line
And so on

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

 

 

Leaving content frame