Start of Content Area

Procedure documentation Defining Default Values for Variables to Allow Overwriting  Locate the document in its SAP Library structure

Use

Using variables, you can define a query in such a way that when users execute the query, they can specify at runtime with which value or values the query is to be started.

This allows you to change the default values for variables in the executed query and override the variable entry using the dynamic filter (input help dialog). After you execute the query, you can then not only select from the values you entered on the variable screen but you can also use other values as dynamic filters for the query.

Procedure

...

       1.      When you define a query in the Query Designer, use drag and drop to drag a characteristic value variable, hierarchy variable, or hierarchy node variable from the InfoProvider screen area to the Default Values area to the right in the Filter screen area.

Alternatively, you can also drag a characteristic from the InfoProvider screen area to the Default Values screen area to the right in the Filter screen area and then restrict the characteristic to one variable. Select the characteristic and in the context menu, choose Restrict.

More information: Restricting Characteristics

Note

If, in addition to restricting the characteristic to variables, you also define further restrictions on characteristic values or other variables, the default values can be changed at runtime by using the input help dialog only; the variable screen cannot be used for this purpose. You can only override default values at runtime by using the variable screen if you have restricted a characteristic in the Default Values screen area to one variable. This also applies when you use the variable more than once in the query. You can only override the default values of the variables by using the variable screen if the variable is used in one drilldown characteristic only.

Background documentation

The Query Designer displays only those variable types that are supported technically for selection.

       If a characteristic has an active display hierarchy, you can only select from hierarchy node variables as default values.

       If a characteristic does not have an active display hierarchy, you can only select from characteristic value variables as default values. You cannot select characteristic value variables with the following properties:

        The variable represents a precalculated value set

        The variable has the processing type Replacement from Query Result

       2.      Continue defining the query as required.

More information: Defining New Queries

       3.      Save the query.

Note

When you open a query with SAP BW 3.x format that contains variables with the property Can be changed in query navigation in the new Query Designer, or when you execute this type of query, variables that have the Can be changed in query navigation property and that are used in the free characteristics are automatically added to the Default Values screen area for the filter.

Result

When users execute the query, they can specify on the variable screen with which value or values the query is to be started. If, while analyzing the data, users want to view other data from the query, they can change the values selected on the variable screen:

      Users call the variable screen (for example, by choosing the corresponding pushbutton in the BEx Web Analyzer) and select one or more other values.

      Users call the input help dialog (for example, by choosing Change Filter Values in the context menu or in the filter pane) and select one or more other values.

Values that are not within the value range for variable entry are also available for selection in the input help dialog. The values entered for the variables are only used to parameterize the dynamic filter for the start list.

Caution

If, while analyzing the data, you have already overridden the selected values from the variable screen with other values from the input help dialog, and then call the variable screen to change the values again, check that the previous values selected in the input help dialog match the variable type. For single value variables, the variable is only available on the variable screen when just one value is selected in the input help dialog.

 

End of Content Area