Entering content frame

Object documentation Using Variables: The Variable Wizard and the Variable Editor Locate the document in its SAP Library structure

Definition

Variables are parameters of a query that you defined in the Query Designer and that are filled with values when you execute the query or Web application. They serve as a store for characteristic values, hierarchies, hierarchy nodes, texts and formula elements, and can be processed in different ways.

The processing type determines how a variable is filled with a value for the runtime of the query or Web application.

There are different types of variables depending on the object for which you want to define variables. These types specify where you can use the variables.

Note

Variables are reusable objects. This means that when you define a variable for a query in the Query Designer, this variable can be used in all other queries. Variables are not dependent on the InfoProvider, only on the InfoObject. A variable that you define for an InfoObject is available in all InfoProviders that use this InfoObject.

Use

Variables enable you to customize queries flexibly (parameterize the query) possible. If you use variables in the Query Designer, do not select any fixed characteristic values, hierarchies, hierarchy nodes, texts, or formula elements. Instead, set up variables as place holders. These are then filled with values when the query is running (when you insert the query into a workbook, when you refresh the workbook or when you execute the query on the Web. You can use one query definition as the foundation for many different queries if you use variables.

Example

You want to create one query for all the people responsible for customer groups, who each only evaluate the data for one customer group. In the Query Designer, you insert a variable for the characteristic ‘customer group’. Just before the query is executed, decide for which customer group(s) you want the query to apply to.

There are two tools in the Query Designer for designing and changing variables.

The variable wizard takes you step-by-step through the process of defining a variable. Each individual step is context-sensitive and is adjusted according to the combination of variable and processing types used. This means that the variable wizard only offers the selection options that are permitted for that combination of variable and processing types. For more information, see Defining Variables with the Variable Wizard.

The variable editor dialog box offers all of the selection options for changing an existing variable. The individual fields in the dialog box show the settings affected in the variable. You can change these settings here. If you want to make the changes using a step-by-step process with explanatory texts, you can jump to the variable wizard using This graphic is explained in the accompanying text. For more information, see Changing Variables in the Variable Editor.

Integration

The variable wizard and the variable editor are functions in the Query Designer and are context-sensitive.

In principle, the two dialog boxes appear wherever you can enter constants (that is, values) in input fields. One of these input fields is the Entry of Variables checkbox.  If you select this option, the following options for using a variable appear, instead of a fixed value:

·        The variables that are available appear in the dropdown box for the input field. You can select a variable from the dropdown box.

·        The symbol This graphic is explained in the accompanying text Change Variable appears next to the Entry of Variables checkbox. You can change the variable using This graphic is explained in the accompanying text . The Variable Editor dialog box appears.

·        The symbol This graphic is explained in the accompanying text New Variable appears next to the Entry of Variables checkbox. Choose This graphic is explained in the accompanying text if you want to create a new variable. The Variable Wizard dialog box appears.

Example

By way of an example, when defining conditions for the value limit of the condition, you can not only enter fixed values but also formula variables. Mark the Entry of Variables checkbox and you can then use the options described above. The settings are context-sensitive so that the formula variables that only those formula variables that are available appear in the dropdown box.  The variable wizard is set up automatically in the same way for entering formula variables.

You can also get to the variable wizard and the variable editor from the context menu of those objects for whose values you can define variable placeholders. From the context menu, choose New Variable. The SAP BW Variables Wizard appears. In the context menu for variables that have already been defined, you can choose Edit. The SAP BW Variables Editor appears.

Example

In the InfoProvider objects dialog box, you select a characteristic (for example, Order) and from the context menu, choose New Variable. You reach the variable wizard, which is already set up for you to enter a characteristic value variable.

In the InfoProvider objects dialog box, you select a characteristic value variable and from the context menu, choose Edit. You reach the variable editor where you see all of the settings for the variable. You can make changes to the variables here.

 

Leaving content frame