Show TOC

Function documentationVariable Locate this document in the navigation structure

 

Variables are used to parameterize a query, a planning function, a filter, a characteristic relationship or a data slice. When a query, planning function or Web application is executed, they are filled with values.

Variables act as placeholders for characteristic values, hierarchies, hierarchy nodes, texts, and formula elements, and can be processed in many different ways.

  • Depending on the objects for which you want to define variables, there are different variable types. For more information, see the documentation on the Query Designer under Variable Types.

  • The processing type determines how a variable is filled with a value for the runtime of the query, planning function or Web application. For more information, see the documentation on Query Designer under Processing Types for Variables.

    Example Example

    Variables allow you to use a single planning function definition as the basis for many different queries. You want to create a planning function of type Copy that copies your current data from the current version to another one. You use a variable for the Version characteristic in the To parameters of the planning function. Before executing the planning function, decide which version you want to copy the current data to.

    End of the example.

    Note Note

    For formula variables that are used in planning functions, for conversion functions for example, processing type Replacement Path cannot be used. Only the Number dimension is supported here.

    You can make unrestricted use of text variables in input-ready queries.

    End of the note.

Integration

Variables as Reusable Objects

Variables do not depend on an InfoProvider, but on the respective InfoObject only. A variable that you define for an InfoObject is available in all InfoProviders that use this InfoObject.

You can define variables can in Query Designer and im Planning Modeler.

Validity Area of Variables

The same variable can have different values in different locations. A separate instance of the variable is created whenever a variable is filled with a value. In some cases different instances (and therefore the values) of variables are merged into a single instance. This means that the variable has the same value in all the objects involved. This happens, for example, when a variable is used in two different queries. However, this is only the exception.

Features

Variables help you to flexibly set or parameterize your objects. The following objects support the use of variables:

Using variables

Object

Using Variables

Queries (especially input-ready queries)

  • To parameterize characteristic restrictions in the query for example

  • In formulas, conditions, exceptions and as a placeholder for text

    When a query is started, variables can be assigned values in three different ways:

  • With a predefined value

  • With a variant

  • With a user entry

Filter

To parameterize characteristic restrictions that describe the filter.

Planning Functions

Depending on the respective planning function type, to parameterize conditions and parameters, for example, to parameterize the conversion factor in planning functions of type conversion.

Variables can be assigned values in the following ways:

  • With a predefined value

  • With a command in the application

Characteristic relationships

  • To parameterize the hierarchy used

  • To parameterize the selection from a DataStore object

Data slices

To parameterize characteristic restrictions that describe the data slice.

Note Note

Variables that are used in characteristic relationships and data slices cannot call a dialog for the manual entry of values. These variables must have a value at the time of execution.

End of the note.
Times of Variable Calls

The different ways in which variables are used result in different times at which variables are executed and at which they are assigned new values.

Use

Time of Variable Call

Query

  1. The variable is processed each time the application is restarted.

  2. When the Change Values for Variables (also known as the Variables screen) is called. This forces the query to be restarted.

    If you end the Variables Screen with OK, the value of the variable does not change if you did not actively make any changes. This means that the Exit is not executed for input-ready variables of type Exit in order to redefine the default value in the dialog box (since it could overwrite the value that is already defined). Variables in the area of the default values and variables for defining the presentation hierarchy take on the value of the current filter state of the characteristic or the currently defined presentation hierarchy. (You can override this behaviour using the relevant flag in Query Designer). In general, explicitly setting variable values (for example with URL parameters) has priority over implicitly setting these values (for example default value of a variable).

    For more information about the dialog box Change Values for Variables, see Changing Variable Values in the BEx Analyzer documentation.

Planning function

Only when executing the planning function. Explicitly set variable values have priority over implicitly set variable values here too. This results in the following conditions for defining the priority when filling a variable:

  1. Is the variable set explicitly in the command with data binding?

  2. Is a variant of the variable specified in the command?

  3. Is the variable personalized?

  4. Is there a default value?

  5. Are none of these conditions satisfied? In this case, the Variables Editor opens in BEx Web, while the system merges the variables merge in BEx Analyzer.

Planning sequence

See Planning Function

Filter in planning sequence

Each time the planning sequence is executed.

Data slice

The first time it is called. You cannot change data slices by changing variables. If no variables are set, the dialog box Change Variables for Variables does not appear.

Note Note

It must be possible to replace variables used in data slices automatically. Variables that are entered manually are not allowed.

End of the note.

Characteristic relationship

See Data Slice

Merging Variables

If there are two variables with the same name in two different objects, the system creates instances of these variables. From then on there are physically two variables. In certain constellations the system automatically merges these instances so that all variable instances have the same value.

Constellation

Merge

Variables with same name in two queries

Yes.

Variables with same name in planning function and query

Only in BEx Analyzer and if the variable value was not replaced by a command there.

Note Note

To ensure the same value in a Web application, the executing command must perform data binding.

End of the note.

Variables with same name in planning sequence and query

See Planning Function

Filter and planning function within a planning sequence

Yes.

Data slice or characteristic relationship with any other object

No.

Activities

You can find more (context-sensitive) information about creating and changing variable definitions (Variables Wizard and Variables Editor) under Variables in the documentation for Query Designer and for Planning Modeler, under Editing Variables .