Sunteți pe pagina 1din 4

Variable

PDF download from SAP Help Portal:


http://help.sap.com/saphelp_nw73/helpdata/en/4c/adb1cdd5943b9de10000000a42189b/content.htm
Created on October 09, 2014

The documentation may have changed since you downloaded the PDF. You can always find the latest information on SAP Help Portal.

Note
This PDF document contains the selected topic and its subtopics (max. 150) in the selected structure. Subtopics from other structures are not included.

2014 SAP SE or an SAP affiliate company. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose
without the express permission of SAP SE. The information contained herein may be changed without prior notice. Some software products marketed by SAP SE
and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by
SAP SE and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be
liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express
warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other
SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE in Germany and other
countries. Please see www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.

Table of content

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 1 of 4

Table of content
1 Variable

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 2 of 4

1 Variable
Use
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
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.

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.

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:
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

Data slices

To parameterize the hierarchy used


To parameterize the selection from a DataStore object
To parameterize characteristic restrictions that describe the data slice.

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.
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

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

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.

Page 3 of 4

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.
2.
3.
4.
5.

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


Is a variant of the variable specified in the command?
Is the variable personalized?
Is there a default value?
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
It must be possible to replace variables used in data slices automatically. Variables
that are entered manually are not allowed.
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
To ensure the same value in a Web application, the executing command must
perform data binding.
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.

PUBLIC
2014 SAP SE or an SAP affiliate company. All rights reserved.

Page 4 of 4

S-ar putea să vă placă și