Show TOC

 Definition of Variables Locate this document in the navigation structure

Use

You define variables if you want to transfer the value of a message characteristic to another process instruction.

You can define variables in the following cases, for example:

You can define a variable for every message characteristic of a process instruction. The data type of the variable is identical to that of the message characteristic (for example, CHAR or NUM).

The following types of variables are distinguished:

  • Simple variables

    Can only be used in the same PI sheet or cockpit in which they were defined

    You use characteristic PPPI_VARIABLE.

  • Global variables

    can be exchanged as follows:

Activity

Simple Variables

You define a simple variable by assigning the following characteristic to the process instruction immediately before the message characteristic whose value you want to transfer to the variable:

Characteristic

Meaning

Value

PPPI_VARIABLE

Simple variable that can only be used within one PI sheet or cockpit

New variable name

Example Example

Example of simple variables

The simple variable VAR is defined for the input value “material quantity”. The value of variable VAR is to be displayed somewhere else in the PI sheet.

Process instruction 0010:

End of the example.

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

Global Variables

You define a global variable by assigning the following characteristic to the process instruction immediately before the message characteristic whose value you want to transfer to the variable:

Characteristic

Meaning

Value

PPPI_GLOBAL_VARIABLE

Global variable that can be exchanged between different PI sheets and cockpits

New variable name

Example Example

Example of global variables

A totals calculation is to be executed in cockpit PMC1. The global variable VARSUM was defined for the value calculated.

The value of variable VARSUM is to be read in cockpit PMC2 as a data point using Manufacturing Data Access and transferred to the simple variable VARLC. The value calculated is to be displayed in cockpit PMC2.

End of the example.

Caution Caution

This functionality is available for two cockpits or for one cockpit with a PI sheet in the same frameset only.

Cockpit PMC1:

End of the caution.

PPPI_INPUT_REQUEST

Calculate value

PPPI_GLOBAL_VARIABLE

VARSUM

PPPI_CALCULATED_VALUE

PPPI_MATERIAL_CONSUMED

PPPI_CALCULATION_FORMULA

VAR1 + VAR2

Cockpit PMC2:

PPPI_DATA_ACCESS

Manufacturing Data Access

PPPI_BUTTON_TEXT

Read value from PCM1

PPPI_FUNCTION_DURING_DISPLAY

Permitted

PPPI_IMPORT_DATA

PMC:0001.PMC1.VARSUM

PPPI_STRING_VARIABLE

VARLC

PPPI_OUTPUT_TEXT

Value calculated

PPPI_OUTPUT_VARIABLE

VARLC

Note the following:

In general, you can choose any name for a variable. To avoid conflicts with other functions, do not use:

  • Variable name X

  • Variable names that start with SY_ since these are system variables predefined by SAP

  • Blanks and arithmetic operators as part of the variable name

  • The following character strings at the end of the variable name:

    _< number >, for example, _1, _2

    _ COUNT

    _ SUM

For more information, see Using Variables in Browser-Based PI Sheets and Cockpits .