SAP Variable Support

In this section:

About SAP Variables

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.

Variables and Processing Types

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 TypeCharacteristic ValuesHierarchiesHierarchy NodesFormula
 Variable Type
Manual Entry/Default ValueXXXX
Customer ExitXXXX
SAP ExitX XX
AuthorizationX X 
Replacement PathX  X

Table 2. Variable Descriptions

Variable/Processing TypeDescription
CharacteristicMost 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.
HierarchyBehaves 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 NodeBehaves in same manner as characteristic variables. Represents a given substructure within a hierarchy.
FormulaQuery 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 ValueVariables 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 ExitABAP code that may be written by SAP customer to fill a variable.
SAP ExitABAP code written by SAP to fill a variable value.
AuthorizationIndicates that variable value is stored with user authorization.

Variable Options

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 NameVariable Represents
Single ValueOne value only.
Multiple Single ValuesNumber of single values. Useful in hierarchy nodes, for example, to allow you to enter several single nodes.
IntervalFrom and to value, that is, an interval.
Selection Option Any combination of single values and intervals.
Precalculated Value SetSet 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 OptionDescription
OptionalVariable does not need a value during runtime.
MandatoryAt least one value must be entered for the variable during runtime:
  • Initial value (#) is permitted explicitly

  • Initial value # means “unassigned”, that is, you cause it to explicitly select all data that has no booked values for this characteristic

Mandatory, Initial Value Not AllowedAt 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.