In this section:
SAP variables are query parameters defined in the BEx Query designer. They function as a store for characteristic values, hierarchies, hierarchy nodes, texts, and formula elements.
SAP variables are displayed in a Variable dialog box when creating a new Web Analysis, Production Reporting, or Financial Reporting document, opening a Web Analysis, Production Reporting, or Financial Reporting document, or explicitly selecting to refresh the variables from the shortcut menu in the Content pane. SAP variables are displayed only if the database connection is created against a BEx query with variables defined.
Users are prompted for variable values only if the variable was created in the original BEx query with Ready for Input selected. For variables that do not have Ready for Input selected, the default variable values are applied to the Web Analysis, Production Reporting, or Financial Reporting document upon creation.
In order to run a variable, it must be associated with a processing type, which identifies the way the variable is processed.
Table 1. Variable and Processing Type Combinations
Processing Type | Characteristic Values | Hierarchies | Hierarchy Nodes | Formula |
---|---|---|---|---|
Variable Type | ||||
Manual Entry/Default Value | X | X | X | X |
Customer Exit | X | X | X | X |
SAP Exit | X | X | X | |
Authorization | X | X | ||
Replacement Path | X | X |
Table 2. Variable Descriptions
Variable/Processing Type | Description |
---|---|
Characteristic | Most common type of variable. Most common processing type is manual/default with ready for input setting. Allows characteristic value to be selected at query run time. Authorization processing type—looks to the end-users’ authorization settings as defined with transaction RSMM and uses the value found there as input for the variable. |
Hierarchy | Behaves in same manner as characteristic variables. Represents an entire hierarchy tree for a given characteristic. Allow the query user to select new hierarchies versus simply selecting a different node within the same hierarchy. |
Hierarchy Node | Behaves in same manner as characteristic variables. Represents a given substructure within a hierarchy. |
Formula | Query parameters set in the query definition and not filled with values (processed) until the query is inserted into a workbook. Formula variables function as a store for individual formula elements. |
Table 3. Processing Type Descriptions
Variable/Processing Type | Description |
---|---|
Manual Entry/Default Value | Variables processed with this processing type allow you to manually enter a value before inserting the query into the workbook. When you create the variables, you determine whether to enter a default value using the default value data. |
Customer Exit | ABAP code that may be written by SAP customer to fill a variable. |
SAP Exit | ABAP code written by SAP to fill a variable value. |
Authorization | Indicates that variable value is stored with user authorization. |
There are five options for each variable type (with the exception of Hierarchies variables with all processing types and any variable type with the Replacement Path processing type) that determine the way values are selected for each variable. In the BEx variable dialog box, they are listed under Variable Represents. Values for each of these options are supported in the Variable dialog box.
Table 4. Variable Options
Option Name | Variable Represents |
---|---|
Single Value | One value only. |
Multiple Single Values | Number of single values. Useful in hierarchy nodes, for example, to allow you to enter several single nodes. |
Interval | From and to value, that is, an interval. |
Selection Option | Any combination of single values and intervals. |
Precalculated Value Set | Set of values that are staged persistently in a database table by the Reporting Agent. |
There are three additional options for each variable type that determine whether a value is required for the variable. In the BEx Variable dialog box, they are listed under Variable Value Is.
Table 5. Options for Variable Value Is
Variable Value Is Option | Description |
---|---|
Optional | Variable does not need a value during runtime. |
Mandatory | At least one value must be entered for the variable during runtime:
|
Mandatory, Initial Value Not Allowed | At least one value must be entered for the variable during runtime; Initial value (#) is not permitted (that is, you must enter one or more concrete values in order to execute the query). |
Note: | Variable Value Is can be modified after creating a variable in BEx, but Variable Represents can be set only at variable creation time. |