SlideShare a Scribd company logo
Query Design: BEx Query Designer
PDF download from SAP Help Portal:
http://help.sap.com/saphelp_erp2004/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm
Created on December 15, 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 62
Table of content
1 Query Design: BEx Query Designer
1.1 Functions of the BEx Query Designer
1.2 Defining New Queries
1.2.1 Restricting Characteristics
1.2.2 Restricting Characteristics: Hierarchies
1.2.3 Selecting Hierarchies
1.2.4 Defining Selections
1.2.5 Defining Formulas
1.2.5.1 Percentage Functions
1.2.5.2 Data Functions
1.2.5.3 Boolean Operators
1.2.5.4 Technical Notes about the Formula Operators
1.2.6 Defining Exception Cells
1.2.7 Save Queries
1.3 Using Variables: The Variable Wizard and the Variable Editor
1.3.1 Variable Types
1.3.1.1 Using Text Variables
1.3.2 Variable Processing Types
1.3.2.1 Manual Entry / Default Value
1.3.2.2 Replacement Path
1.3.2.3 Customer Exits
1.3.2.3.1 Dependencies for Variables of Type Customer Exit
1.3.2.4 SAP Exit (delivered variables)
1.3.2.5 Authorization
1.3.3 Overview of Variable Types and Processing Types
1.3.4 Defining Variables with the Variable Wizard
1.3.4.1 Details
1.3.4.1.1 Special Features with Dynamically Changeable Variables
1.3.4.2 Default Values
1.3.4.3 Replacement Path
1.3.4.3.1 Replacement Path: Replacement with a Characteristic Value
1.3.4.3.1.1 Calculating Variables for Processing Type “Replacement Path”
1.3.4.3.1.2 Variable Replacement Example
1.3.4.3.2 Replacement Path: Replacement with Query
1.3.4.4 Characteristic
1.3.4.5 Currencies and Units
1.3.5 Changing Variables in the Variable Editor
1.3.6 Examples for Using Variables
1.4 Query Properties
1.5 Properties of Query Components
1.5.1 Characteristic Properties
1.5.2 Attribute Properties
1.5.3 Structure Properties
1.5.4 Selection/Formula Properties
1.5.5 Restricted Key Figure Properties
1.5.6 Calculated Key Figure Properties
1.6 Defining Conditions
1.7 Defining Exceptions
1.7.1 Conditions/Exceptions: Inserting, Changing, Deleting Rows
1.8 Tabular Query Display
1.9 Defining Calculated Key Figures
1.10 Defining Restricted Key Figures
1.11 Structures
1.11.1 Creating Reusable Structures
1.11.2 Structure Element Texts and Their Language-Dependency
1.12 Displaying and Changing Existing Queries in the Query Designer
1.13 Functions on the BW Server
1.13.1 Copying Queries Between InfoCubes
1.13.2 Deleting Query Objects
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 2 of 62
!--a11y-->
1 Query Design: BEx Query Designer
Definition
Independent desktop application for defining queries.
Use
You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer . By selecting and combining
InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the
selected InfoProvider.
Integration
You open the Query Designer from Start/Programs/Business Explorer/Query Designer.
You can also call up the BEx Query Designer from the following components:
· BEx Analyzer
· BEx Web Application Designer
· Crystal Reports (Crystal Reports ³ 8.5 incl. CR add-ons for SAP)
Features
The BEx Query Designer contains the following functions:
· You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. For further information, see Tabular Query
Display
· You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. For more information, see
Using Variables: The Variable Wizard and the Variable Editor.
· You can select InfoObjects more precisely by:
· Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes (see Restricting Characteristics).
· Defining formulas
· Defining selections
· Defining reusable calculated and restricted key figures (see Defining Calculated Key Figures, Defining Restricted Key Figures).
· Using local or reusable structures (see Structures, Defining Structures for Reuse).
· Defining exceptions
· Defining conditions
· Defining exception cells
The most significant components of the query definition are the filter and navigation:
· The selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics
or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation.
· For the navigation you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine
the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view
of the query and the rows and columns axes in the results area.
After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of
the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic
according to a single characteristic value.
With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its
execution and navigation.
See also:
Defining New Queries
!--a11y-->
Functions of the BEx Query Designer
Use
This section contains an overview of the functions available in the BEx Query Designer.
Features
Proceed As Follows to Create A Query:
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 3 of 62
· By clicking on the plus or minus symbol of the directories you can expand or compress the directories. You can, for example, display the list of all of the key
figures in the InfoProvider by expanding the key figure node in the InfoProvider tree.
· Using drag and drop or the temporary storage location (Ctrl C – Ctrl V), you can take characteristics and key figures from the InfoProvider into the directories
of the Query Designer ( filter, rows, columns, free characteristics ).
· Use the secondary mouse button to call up all the functions that are available in the respective context menu. First, select the query component you want
to work with (for example, a characteristic) and then, using the secondary mouse button, select a menu entry (for example, Properties ) from the context
menu.
· By double-clicking on an item of the Query Designer, you call up a dialog box containing a function that is executed by default on this item. If, for example,
you double-click on a characteristic, the dialog box for restricting the characteristic appears. If you double-click on a calculated key figure, for example, then
the Calculated Key Figure dialog box, in which you can make changes, appears.
The standard functions for an element in the Query Designer are shown in the context menu in bold type.
Toolbar Functions
Quit and Use Query
Click on this symbol to leave the Query Designer and use the query that you have defined. The format in which the query is used depends on which tool you
called the Query Designer from.
If you have not yet saved your query, the system calls the Check Query function automatically to check the query for errors. Once the system
has checked the query successfully, it asks whether you want to save the query.
BEx Web Application Designer:
You called the Query Designer from the Web Application Designer using the path Tools ® Query Designer and from there you defined a new query or
changed an existing query and saved it. If you now choose Quit and Use Query, the Query Designer session ends and you are able to use the defined query as
a data provider.
See also:
Creating Web Applications with the BEx Web Application Designer
BEx Analyzer:
If you have created or changed the query, you can insert it into a workbook to enable you to navigate in and analyze the query data.
The query definition is saved but is not available universally. If you want the query to be universally (publicly) accessible in the Business Information Warehouse
you must save it using the function Save or Save as .. . .and give it a unique technical name.
See also:
Evaluating Query Data
Crystal Reports:
You called the Query Designer from Crystal Reports and defined or changed a query (in table display) and saved it. You can now use the query as a data source
for a formatted report in the Crystal Reports Designer
Exit Query
Choose Exit Query if you want to leave the Query Designer. Your entries will not be saved.
Display Query on the Web
When you have defined and saved your query, you can display it directly on the Web in a standard view. The query is embedded automatically into a standard
Web template.
You define the standard Web template in the SAP Reference IMG ® Business Information Warehouse ® Reporting-Relevant Settings ® Web-based
Settings ® Determine Standard Web Template .
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 4 of 62
New Query
If you want to create a query, select the symbol for New Query . You reach the BEx Open dialog where you choose the InfoProvider whose data you want to use
as the basis for your query. You can select the InfoProvider either from the InfoProviders in your history or from the list of all available InfoProviders under
InfoAreas.
See also:
Defining New Queries
Open Query
Choose Open Query to get to the BEx Open dialog. Here, all existing queries are available in your history, favorites, roles or listed according to InfoArea. Under
InfoAreas you get a list of all existing queries in the Business Information Warehouse for which you have display authorization.
Save Query
You can save a query that you have changed under its current name using the function Save Query.
If the query does not yet have a technical name, the system offers the function Save Query As... automatically.
See also:
Saving Queries
Save Query As...
If you want to save the query under a new technical name, choose Save Query As... Enter the new technical name. You can save the query in your favorites or
roles.
See also:
Saving Queries
Delete Query
Select Delete Query , if you want to delete a query. You are only able to delete the query if it is no longer being used (that is, if it is not being used in any
workbooks, Web templates, Crystal Reports or Reporting Agent settings).
Publish
You are able to publish queries that you have edited and saved in the Query Designer so that they are available to other users.
Under the small arrow , next to the publish symbol , you can select from the following options:
· Publish in roles
The save dialog appears and you can select a role in which you want to publish the query. The system saves a link to the current query in the selected role.
· Publish to the portal
The save dialog appears and you can publish the query to the Enterprise Portal. Here you can select from several options: for example you can publish the
query to your portfolio or you can put in a collaboration room.
For more information, see Publishing BEX Web Applications and Queries.
· BEx Broadcaster
The BEx Broadcaster, which is a Web application for precalculating and distributing queries, Web templates and workbooks, appears. You are able to
precalculate the query that you edited in the Query Designer or you can generate it as an online link. You can distribute the generated document or the link
by e-mail or you can export it to the Enterprise Portal. Furthermore, you can also precalculate and distribute other queries, Web templates or workbooks. You
can find additional information under Functions of the BEx Broadcaster .
Exception
You can define exceptions for a query. Exceptions are variations in key figure values that you define yourself. They are displayed in a different color in the query
view. This allows you to see, at a glance, any unusual deviations from the results you expect to get.
Under the small arrow next to the exception symbol , you can:
· change exceptions
· define new exceptions
If one or more exceptions have been defined for a query, this is shown by the symbol on the status bar of the Query Designer.
See also:
Exception Reporting
Condition
Choose Condition , if you want to define conditions for a query. You can specify threshold value conditions for the key figure values in every characteristic. For
example, you can specify all sales figures under or above a certain threshold value. In the query, the selected characteristics are displayed with the restricted
key figures.
Under the small arrow next to the condition symbol , you can:
· change conditions
· define new conditions
If one or more conditions have been defined for a query, this is shown by the symbol on the status bar of the Query Designer.
See also:
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 5 of 62
Conditions
Define Cells...
You can define formulas and selection conditions explicitly for cells in queries with two structures. In this way you can override the cell values that are created
implicitly from the intersection of the structure components. This function allows you to design much more detailed queries.
Define Cells... is only available for queries with two structures. For queries with only one structure, the symbol is deactivated.
If one or more exception cells have been defined for a query, this is shown by the symbol on the status bar of the Query Designer.
See also:
Defining Exception Cells
Query Properties
Choose Query properties if you want to change the description of the query or if you want to make settings for the Results Position , Display Options, Number
Display and S uppression of Zeroes for the query. In the query properties, you can also set Release for OLE DB for OLAP . You can also reach any available
documents about the objects used in the query from here.
See also:
Query Properties
Check Query
Before you save a new or changed query, you can check the query definition for errors using the Check Query function.
When you use the function Quit and Use Query , the system calls up the Check Query function automatically for queries that have not yet been
saved. Once the system has checked the query successfully, it asks whether you want to save the query.
Query Where-Used List
With the Query Where-Used List , you can see the objects (workbooks, Web templates, Crystal Reports or Reporting Agent settings) in which the query is used.
Display <-> Change Query
Using this function you can toggle between the display and change mode. You can view the query definition in the display mode but you cannot change it.
See also:
Displaying and Changing Existing Queries in the Query Designer
Change Query (Global Definition)
Choose the function Change Query (Global Definition) , if you are currently in the local query definition, and want to change to the global definition.
Table Display
You can design a query for OLAP reporting and also for tabular reporting by activating or deactivating the Table Display mode when you define a query.
This function is available only for queries with one structure. Queries that have two structures are only available in the multidimensional display
and are suitable only for OLAP reporting.
See also:
Tabular Query Display
Technical Name
You can show or hide the technical names of the query components (InfoObjects, structures, variables, and so on) using this function.
Context Menu
The Context Menu function allows you to display the context menu without using the secondary mouse button (for example, using a touch screen). Select a
directory from the InfoProvider tree or the query definition, and choose the Context Menu function. The context menu for the item you highlighted appears.
Help
Choose Help to go to the Business Information Warehouse online documentation. The Query Design: BEx Query Designer section in the documentation for the
Business Explorer is displayed automatically there.
Using the small arrow next to the help symbol under the entry About..., you can see the version of the Query Designer with the number of the support
package and the revision. You can quote this information to SAP if you need to send any error messages.
!--a11y-->
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 6 of 62
1.2 Defining New Queries
Prerequisites
The Business Information Warehouse must contain at least one InfoProvider.
You have called up the BEx Query Designer from:
· The menu path Start/Programs/Business Explorer/Query Designer
In the Query Designer symbol toolbar, choose Open Query.
· BEx Web Application Designer:
In the Web Application Designer, choose Tools ® Query Designer and chose New Query from the Query Designer toolbar.
· BEx Analyzer:
In the BEx toolbar, choose Open ® Queries and then, in the BEx Open dialog, choose New .
· Crystal Reports:
Call the Query Designer and choose New Query from the Query Designer toolbar.
You get to the InfoProvider selection in the Query Designer automatically in the table display. The procedure for defining a query is aligned with
the procedure for defining a query in OLAP reporting. Therefore, note the differences for the table display when you are defining a query for use in
formatted reporting with Crystal Reports.
Process Flow
You define queries by:
· Selecting an InfoProvider for which the query is defined
· Selecting reusable structures that already contain characteristic or key figure combinations (for example, contribution margin schema)
· Selecting characteristics from the InfoProvider
· Restricting selected characteristics to characteristic values, characteristic value intervals, or hierarchy nodes
· Using variables for characteristic values, hierarchies, hierarchy nodes, formulas and texts or defining new variables where necessary.
· Selecting key figures from the InfoProvider
· Formulating calculated key figures
· Restricting key figures by combining them with characteristics
· Defining exception cells
· Arranging the characteristics and key figures in rows or columns and thereby establishing an initial view for the query analysis.
The steps that are not printed in bold are optional. You do not necessarily have to use these functions.
Procedure
You get to the selection screen for all InfoProviders for which you can define a new query.
1. From your history, or from all available InfoProviders under InfoAreas, select the InfoProvider that you want to base your query on.
If you want to show the technical name of the InfoProvider, choose the symbol Technical Name On/Off .
2. The objects available in the InfoProvider you selected are displayed as a directory tree in the left part of the Query Designer.
The right screen area contains empty directories for the filter selection, the rows, the columns and the free characteristics of the query. The preview of the
results area for the query can be found at the bottom right. This area is also still empty.
For more information about the process of creating a query, see Functions of the BEx Query Designer in the section Proceed as follows to create a query.
3. Make the selections for the filter of the query. Note that the filter selection has a restricting effect on the entire query, meaning that all of the InfoProvider data
is aggregated with the filter selection. Select the characteristics or the key figure on which the query is based from the directory tree of the InfoProvider.
¡ Characteristics
Expand the required dimension directory and first select one or more characteristics that you wish to restrict to one or more values, a variable, a value
interval or a hierarchy node from the InfoProvider. Expand this characteristic and, using drag-and-drop, place a single value in the filter of the Query
Designer. Alternatively, using drag-and-drop, drag the characteristic into the Filter area of the Query Designer. Using the right mouse button select
Restrict from the context menu. Now select a characteristic value interval or a hierarchy node (See also: Restricting Characteristics).
¡ Key figure
Decide whether all of the query data is to refer to the numerical values of a key figure or whether the query should be based on several key figures. If the
query refers to the numerical values of one key figure, select the corresponding key figure of the InfoProvider tree and drag it to the Filter area of the
query definition using Drag&Drop. You can also use a restricted or calculated key figure (see also: Defining Restricted Key Figures and Defining
Calculated Key Figures ).
4. Now determine which characteristics, key figures or structures you want to use for navigating through the query data. Using Drag&Drop, move the
corresponding directories of the characteristics of the InfoProvider tree to the directories Rows, Columns or Free Characteristics in the right-hand screen
area of the Query Designer or drag the structure directories into the rows or columns.
If you have not selected any key figures for the filter, define one or more key figures either in the rows or columns of the query. From the Key Figures
directory of the InfoProvider tree drag a key figure into a directory of the Query Designer using Drag&Drop (either Row or Column ). The key figure is stored
in the new directory Key Figure .
You can also define a new calculated key figure and use it for the query. For example, instead of “Sales revenue”, define the key figure “Price” that is
calculated using “Sales revenue” divided by “Quantity”. Highlight the directory Key Figures in the InfoProvider tree and choose New Calculated Key Figure
from the context menu (right mouse click).
You can restrict key figures to characteristic values, characteristic value intervals or hierarchy nodes by highlighting the key figure and choosing Edit
from the context menu (right mouse click). A restricted key figure would be “Sales revenue in 1st quarter”, for example.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 7 of 62
By placing the characteristics, key figures or structures either in the rows or columns directory of the Query Designer, you configure the first navigational
state of the query (start view). In the lower right area you can see a preview of the results area of the query in the start view that you selected.
You can change the arrangement of the key figures and characteristics in the rows and columns using Drag&Drop until the preview shows the
results area you want.
5. When you have created the query, you can check the query definition by choosing Check Query from the toolbar.
6. Select the symbol for Query Properties from the toolbar if you want to change the Description, settings for Result Position , Display Options and
Number Display , or Key Date for the query. See also Query Properties.
7. Save the query. Enter a Technical Name and a Description for naming the query. The Technical Name must uniquely identify the query, meaning that the
name is allowed to appear only once across all InfoProviders of the Business Information Warehouse. The technical name can be up to 30 characters long
and must begin with a letter.
Result
The query has been saved and you can now:
· Add the query to a workbook in the BEx Analyzer: Choose Quit and Use Query
· Display the query in the Web browser in a standard view: Choose Display Query on the Web.
· Use the query in the Web Application Designer as a data provider for Web items.
· Use the query in the table display in Crystal Reports as a data source for formatted reports
You can analyze the query data in the Business Explorer.
See also:
Creating Reusable Structures
Query Properties
Properties of the Query Components
Functions of the BEx Query Designer
Displaying and Changing Existing Queries in the Query Designer
Authorizations for the Query Definition
!--a11y-->
1.2.1 Restricting Characteristics
Use
When defining a query, you can restrict characteristics to single characteristic values, value ranges, hierarchy nodes or characteristic value variables.
Prerequisites
You want to restrict a characteristic to one or more values in the query or restricted key figure definition. You have selected the characteristic and chosen Restrict
from the context menu (secondary mouse click).
Procedure
When you select characteristics in the query definition, you can use the same functions as the F4 Help in the executed query. For the following functions, see the
descriptions under Selecting Filter Values.
· Selecting single values
· Selecting value ranges
· Selecting hierarchy nodes
· Searching for values
· Deleting values from the selection window
· Excluding characteristic values
· Displaying value keys
You can choose from the following additional functions in the query definition:
Selecting variables
When you select characteristic values in the query definition, you can also select variables instead of fixed values. These act as benchmarks and are only filled
with fixed values when the query is executed.
Selecting single value variables
1. Choose Single Value in the top left area of the selection field and flat list in the top right.
2. Select the Variables tab page.
3. Select one (or, in exceptional cases, more than one) variable from the list of available variables displayed in the left-hand window, and drag the variable(s)
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 8 of 62
into the Selection box on the right (alternatively, use the pushbutton with the arrow pointing to the right to move the values).
Selecting value range limits
1. Choose Value Range from the top left of the selection field, and the operator that you want to use (top right).
2. Select the Variables tab page.
3. If you have chosen the operator Between , first select both the upper and lower interval limits from the list of available variables displayed in the left-hand
window and drag them using Drag&Drop (or using the arrow pointing to the right) in the Selection window on the right-hand side of the screen.
If you choose one of the operators Is greater than or equal to , Is less than or equal to , Is greater than, or Is less than , select a value from the list of
available variables in the left-hand window, drag it across, and drop it into the Selection window on the right (alternatively use the button with the arrow
pointing to the right to move the variable across into the Selection window).
Selecting intervals with variables and a fixed limit
1. In the top left corner of the selection field, choose value range and between as operator.
2. Select the fixed limit on the Fixed Values tab.
3. Select the variable limit on the Variables tab.
4. Finally, choose the arrow button pointing to the right.
Selecting intervals whose upper and lower limits refer to the same variable
1. In the top left corner of the selection field, choose value range and between as operator.
2. Select the required variable from the Variables tab page and drag it into the Selection box on the right (or use the arrow icon pointing to the right).
3. Now specify offsets for the upper and lower limits. (See below: Selecting variable offsets)
Please note that you cannot combine other values, hierarchy nodes or variables with a variable of the type Selection option or Query variable .
Selecting variable offsets
You can only use this function for characteristic value variables of the type single value .
1. Select the required variable in the right-hand window.
2. Choose variable offsets from the context menu (secondary mouse click) . This brings you to the dialog window Entering Variable Offsets .
3. Enter the required offset.
4. Choose OK .
You want to select the period of the last 5 years for evaluating your data.
- In the top left corner of the selection field, choose value range and between as operator.
- Select the variable current calendar year from the Variables tab page and drag it into the Selection box on the right (or use the arrow icon
pointing to the right).
- Choose variable offsets from the context menu (secondary mouse click) . The Variables – Offsets popup appears for both the upper and
lower interval limits.
- For the lower limit, enter the offset 5.
- Do not enter an offset for the upper limit.
- Choose OK .
Swapping interval limits
If you are using variables in the interval limits, you can swap the limits.
1. Select the required variable in the right-hand window.
2. Choose Swap Interval Limits from the context menu (secondary mouse click) .
Selecting fixed/variable hierarchies/hierarchy nodes
You can also restrict characteristics by hierarchy or hierarchy node, on a fixed or variable basis. See Restricting Characteristics: Hierarchies
Excluding variable values
You use this function to select the values that you do not need for your report.
This function is only valid for single value variables and not for variable quantities.
1. Select the desired value in the right Selection window.
2. Choose Exclude from Selection from the context menu (secondary mouse click) .
If you want to include the value in the selection again, choose Include in Selection from the context menu (secondary mouse click).
Direct entry
You cannot use this function if you want to restrict the characteristic. You cannot make a direct entry when you are selecting structure elements (for
example, key figures) or values from a hierarchy.
1. In the entry field (bottom left) specify a characteristic value in external format.
Instead of characteristic values in external format, you can also enter variables in the form of &<variable name>& (ampersand (&) at the beginning and at the
end of the entry, and without blank spaces).
2. Choose the button with the arrow pointing to the right.
The system checks whether this value exists. If the value does not exist, you get a warning. However, you can still use the value in the variable.
Note the following conventions for making entries for value ranges and intervals:
Value range: <operator><value>, for example, >= 1995
Intervals: <lower limit>;<upper limit>, e.g. A01; B99
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 9 of 62
Interval with a variable limit, for example, &VAR&;2000
Empty characters are not allowed in these fields.
Result
You have now restricted a characteristic by certain characteristic values. Choose OK .You return to the query definition. Save your entries and execute the query.
If you have restricted a characteristic to a variable value, before the query is executed, a dialog box appears for you to enter variable values
manually (provided that the variable is flagged as ready for input ). For more information, see Using Variables: The Variable Wizard and the
Variable Editor.
Enter the required values and choose OK . The query is now executed with the chosen values.
The query is created according to your selection conditions. The selected characteristic values are displayed in the filter cells, on the right, next to the
corresponding characteristic. Only the characteristic values you selected are included in the results area.
!--a11y-->
Restricting Characteristics: Hierarchies
Use
In the Query Designer, you can restrict characteristics by hierarchy or hierarchy node, on a fixed or variable basis.
Choose from the following options:
· Fixed hierarchy node – fixed hierarchy
Report on department A (fixed hierarchy node) for the hierarchy valid for 1999 (fixed hierarchy)
· Variable hierarchy node – fixed hierarchy
Report on chosen department (variable hierarchy node) for the hierarchy valid for 1999 (fixed hierarchy)
· Fixed hierarchy node – variable hierarchy
Report on department A (fixed hierarchy node) for the hierarchy valid for the current calendar year (variable hierarchy).
· Variable hierarchy node – variable hierarchy
Report on a chosen department (variable hierarchy node) for the hierarchy valid for the current calendar year (variable hierarchy).
Prerequisites
You use this function if hierarchies exist for the characteristic that you want to restrict.
For more information on hierarchies, see the Hierarchies section of the Administrator Workbench documentation.
Procedure
Fixed hierarchy – fixed hierarchy node
1. In the top left of the selection field, choose Single values and the required hierarchy from the top right corner.
2. Select the Fixed Values tab page.
3. In the list of available hierarchy nodes in the left-hand window, navigate to the hierarchy node you want to use.
4. Select the required hierarchy node and drag it into the Selection box on the right (or use the arrow icon pointing to the right). Next to the name of the hierarchy
node you see the name of the hierarchy in brackets.
Fixed hierarchy – variable hierarchy node
1. In the top left of the selection field, choose Single values and the required hierarchy from the top right corner.
2. Select the Variables tab page.
3. Select the required variable from the list of available variables on the left-hand side.
4. Select the required variable and drag it into the Selection box on the right (or use the arrow icon pointing to the right).
Variable hierarchy – fixed hierarchy node
1. In the top left of the selection field, choose Single values and a hierarchy that contains the required hierarchy node, from the top right corner.
2. Select the Fixed Values tab page.
3. In the list of available hierarchy nodes in the left-hand window, navigate to the hierarchy node you want to use.
4. Select the required hierarchy node and drag it into the Selection box on the right (or use the arrow icon pointing to the right).
5. Highlight a hierarchy node in the right-hand box and choose Select variable hierarchy from the context menu (right mouse button). You reach the Select
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 10 of 62
Variable for Hierarchy dialog box.
6. Select a variable hierarchy. See also: Selecting Hierarchies
7. Choose OK .
Variable hierarchy – variable hierarchy nodes
1. In the top left of the selection field, choose Single values and a hierarchy that contains the required hierarchy node, from the top right corner.
2. Select the Variables tab page.
3. Select the required variable from the list of available variables on the left-hand side.
4. Select the required variable and drag it into the Selection box on the right (or use the arrow icon pointing to the right).
5. Highlight a hierarchy node in the right-hand box and choose Select variable hierarchy from the context menu (right mouse button). You reach the Select
Variable for Hierarchy dialog box.
6. Select a variable hierarchy. See also: Selecting Hierarchies
7. Choose OK .
Result
You have restricted a characteristic according to a node within a hierarchy. Choose OK . This takes you back to the Query Designer. Save your entries and
execute the query.
If you have restricted a characteristic to a variable hierarchy and/or a hierarchy node, before the query is executed, a dialog box appears for you
to enter variable values manually (provided that the variable is flagged as Ready for Input ). For more information, see Defining Variables with the
Variable Wizard.
Enter the required values and choose OK . The query can now be executed, with the values you have selected to fill the variable.
!--a11y-->
1.2.3 Selecting Hierarchies
Use
You select hierarchies at the following stages in the query definition:
· When you select a variable hierarchy for a hierarchy node (see also: Restricting Characteristics: Hierarchies).
· When you select a display hierarchy for a characteristic (see also: Characteristic Properties).
Prerequisites
You use this function if hierarchies exist for the characteristic that you want to restrict.
For more information on hierarchies, see the Hierarchies section of the Administrator Workbench documentation.
If you have activated virtual time characteristics in the SAP Reference IMG for time characteristics, you can select virtual hierarchies when
selecting hierarchies.
For more information, see Activating Virtual Time Hierarchy.
Procedure
Selecting fixed hierarchies
1. Select the required fixed hierarchy from the list of available hierarchies.
2. Choose OK .
You need this function only when you are selecting a fixed display hierarchy for a characteristic.
Selecting variable hierarchies
A hierarchy becomes variable if at least one of its elements (name, version, key date) is variable.
1. Select a hierarchy from the list of available hierarchies.
2. Choose the Variables radio button from the field on the right (name, version, key date) according to which you want to select for the hierarchy. The selection
list now displays the available variables.
3. Select the variable you want to use.
4. Choose OK .
Note that it is possible to fill the fields for version and key date, only if the characteristic has version-dependent or time-dependent hierarchies.
You can also define new variables by choosing New Variables . The Variable Wizard appears. For more information, see Defining Variables with the Variable
Wizard.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 11 of 62
!--a11y-->
1.2.4 Defining Selections
Use
You can define a query by using Drag&Drop to drag the key figure of the InfoProvider into the Query Designer directories. If you move a key figure into the rows or
columns, this key figure automatically becomes part of a structure.
You can restrict (filter) the key figure in the structure using one or more characteristic selections. The key figure itself that is restricted by one or more characteristic
selections can be a basic key figure, a calculated key figure or a key figure that is already restricted.
Procedure
Defining a new selection
1. If the query does not yet have any key figure structures, drag a key figure using Drag&Drop into a directory of the Query Designer. Alternatively, select the
header of the directories for Rows or Columns and, using the secondary mouse button, select New Structure from the context menu.
2. Select the structure directory, and, using the secondary mouse button, choose New Selection from the context menu. The New Selection screen appears.
There is a text field, in which you enter a description of the selection in the upper part of the screen.
You can use Text Variables in the description.
Underneath the text field, on the left, is the directory of all the objects available in the InfoProvider. The empty field for the definition of the new selection is on
the right-hand side of the screen.
3. Using Drag&Drop, choose a key figure from the InfoProvider, and restrict it by selecting one or more characteristic values. See, Restricting Characteristics.
You can also use variables in place of the characteristic values. However, note that you cannot use the following variable types in selection
structure elements for technical reasons.
¡ Variables with the replacement with query processing type (see also Replacement Path: Replacement with Query)
¡ Variables that represent a precalculated value set (see also Detail Statements)
You can use these variable types to restrict characteristics in the rows, columns or in the filter.
4. Choose OK . The new selection is defined in the structure.
Editing selections
1. If you want to change the restriction on a key figure, select the key figure in the structure and from the context menu (secondary mouse click), choose Edit .
The Edit Selection dialog box appears.
2. Make the required changes.
3. Choose OK .
Marking selections as constant
You can mark a selection in the Query Designer as constant. This means that navigation and filtering have no effect on the selection for the runtime. In this way,
you can easily select reference sizes that you cannot change for the rest of the runtime.
For more information, see Selecting Constants.
Defining properties for the selection
1. Highlight the selection in the structure and, from the context menu, choose Properties .
2. Make the required settings for the technical name, description, display, number format, and calculations in the selection. See Selection/Formula Properties
!--a11y-->
1.2.5 Defining Formulas
Use
You can recalculate the key figures in a structure using a formula. You can include basic key figures, restricted key figures, and calculated key figure in the
formula definition.
Procedure
Defining a Formula
1. If the query does not yet have a key figure structure, create a New Structure in the Rows or Columns of the Query Designer by highlighting the row or
column directory using the right mouse button and selecting New Structure from the context menu .
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 12 of 62
2. If the structure does not yet contain any key figures, use Drag&Drop to transfer a (basic) key figure of the InfoProvider into the directory of the new structure.
3. Select the structure directory, and choose New Formula . The formula definition screen appears.
There is a text field, in which you enter a description of the formula in the upper part of the screen.
You can use text variables in the description.
The formula entry field is below the text fields. The bottom left screen area contains all of the operands available for defining the formula. These are:
- The structure elements that you have already defined for the structure
- The cells that you have defined as exception cells
- All form variables
On the right side of the screen, you see the functions that are available as operators:
- Basic functions
- Percentage functions
- Data functions
- Mathematical functions
- Trigonometric functions
- Boolean operators
The symbols for the basic arithmetic operations are displayed between the operands and the functions. There is a number block to the right of the functions.
Proceed as follows to define a formula:
¡ Choose the operands you want to use, and insert them in the entry field for the formula by double-clicking or by using Drag&Drop.
¡ Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the functions, or
using Drag&Drop.
¡ Select the numerical values for the formula by clicking on the number block.
You can also enter digits, parentheses and basic arithmetical operations using the keyboard.
4. Define your formula using the available operands and operators.
If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight the
Formula Variable entry and, from the context menu, choose New Formula . You reach the variable wizard. This takes you through a step-by-
step process for defining a new variable.
If you want to change a formula variable, select the variable and, from the context menu, choose Edit. The variable editor appears.
Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect if, for
example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless of the unit, use
the function Value Without Dimension (Without Units). See Data Functions.
5. Check the formula definition and choose Formula Syntax Check .
The Formula Syntax Check function checks only the correctness of the syntax in the formula. It does not check whether the formula makes
sense semantically, for example, if it contains the same units. You make semantic checks using the function Check Query (see Functions of
the BEx Query Designer).
6. Enter a description for the formula column.
7. Choose OK . The new formula is defined in the structure.
Editing a Formula
1. Highlight the formula in the structure and, from the context menu, choose E dit .
2. Make the required changes.
3. Choose OK .
Defining Properties for the Formula
1. Highlight the formula in the structure and, from the context menu, choose Properties .
2. Make the required settings for the technical name, description, display, number format, calculations, and formula collision in the formula. See
Selection/Formula Properties
See also:
Technical Notes about the Formula Operators
!--a11y-->
1.2.5.1 Percentage Functions
Use
These are functions that you can use as operators for defining a formula or a calculated key figure.
Features
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 13 of 62
Percentage Deviation (%)
<Operand1> % <Operand2>
This gives the percentage deviation between operand 1 and operand 2. It is identical to the formula
100 * (<Operand1> - <Operand2>) / abs(<Operand2>) , if <Operand2> does not equal 0 and the character for “Division by 0” if <Operand2> equals 0.
Plan Sales % Actual Sales, expresses the difference between the plan sales and the actual sales as a percentage.
Percentage Share (%A)
<Operand1> %A <Operand2>
This gives the percentage share of operand 1 and operand 2. It is identical to the formula
100 * <Operand1> / abs(<Operand2>) , if <Operand2> does not equal 0 and the character for “Division by 0” if <Operand2> equals 0.
Character for “Division by 0”: See SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting Settings ®
Display of Numerical Values in the Business Explorer.
Fixed Costs %A Costs expresses the proportion of the total cost of a product that is the fixed cost.
Percentage Share of the Result (%CT)
%CT <Operand>
This shows how high the percentage share is, with regard to the result. The result is the outcome of aggregating the second highest results level (interim result).
If a characteristic has been drilled down upon in both the rows and the columns, this relationship is not unique, causing the system to display the warning, and
relevant symbol for Data does not exis t. See SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting
Settings ® Display of Numerical Values in the Business Explorer.
Year Region Sales %CT ‘Sales’
1999 North 30 50
South 30 50
Result for 1999 60 33.3333
2000 North 60 50
South 60 50
Result for 2000 120 66.6667
Overall Result 180 100
Percentage Share of the Overall Result (%GT)
%GT <Operand>
This shows how high the percentage share is, with regard to the overall result. The overall result is the outcome of aggregating the highest results level. Dynamic
filters (filters that have not been determined already in the query definition) also play a role in calculating the overall result.
Year Region Sales %GT ‘Sales’
1999 North 30 16.6667
South 30 16.6667
Result for 1999 60 33.3333
2000 North 60 33.3333
South 60 33.3333
Result for 2000 120 66.6667
Overall Result 180 100
Percentage Share of the Query Result (%CT)
This is much the same as %GT.
Unlike the process of calculating the overall result, dynamic filters are not used in the calculation of the query result. This means that,
independently of the filter status and the navigational state, the same value is always normalized.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 14 of 62
!--a11y-->
1.2.5.2 Data Functions
Use
These are functions that you can use as operators for defining a formula or a calculated key figure.
Features
Value = 1 if operand <> 0, otherwise 0 (numerator)
COUNT(<Expression>)
Delivers the value 1 if the <Expression> is <> 0, otherwise 0.
Processing a Value as a Date
DATE
The value is seen as the number of days from 00.01.0000 onwards and output as a date.
The value can be between 0 and a million, which gives a date between 01.01.0000 and 27.11.2738.
Value = 1 if operand = 0, otherwise 0
DELTA(<Expression>)
Delivers the value 1 if the <Expression> is 0, otherwise 1.
The function is identical to the NOT operator and should no longer be used.
NDIV0 (x): Equals 0 when divided by 0, otherwise x
NDIV(<Expression>)
Is 0 if the calculation of <Expression> causes a division by 0. Otherwise, the result is the value of the expression. It is used to avoid error messages or so that
you can continue to calculate a defined result.
Values without Dimensions (without Units)
NODIM(<Expression>)
Delivers purely numerical values of <Expression> and suppresses units and currencies.
Using this function, you can avoid the “mixed currency” character. See SAP Reference IMG ® Business Information Warehouse ®
Reporting-relevant Settings ® General Reporting Settings ® Display of Numerical Values in the Business Explorer.
NOERR (x): Equals 0 for undefined calculations, otherwise x
NOERR(<Expression>)
Is 0 if the calculation of <Expression> leads to an arithmetical error. Otherwise, the result is the value of the expression. It is used to avoid error messages or so
that you can continue to calculate a defined result.
NOERR(SQRT(-1)) = 0
Result
SUMCT <Operand>
Delivers the result of the operands to all rows or columns (see also Percentage Functions % CT).
Year Region Sales SUMCT “Sales”
1999 North 30 60
South 30 60
Result for 1999 60 180
2000 North 60 120
South 60 120
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 15 of 62
Result for 2000 120 180
Overall Result 180 180
Overall Result
SUMGT <Operand>
Delivers the overall results for the operands (see also Percentage Functions %GT).
Year Region Sales SUMGT “Sales”
1999 North 30 180
South 30 180
Result for 1999 60 180
2000 North 60 180
South 60 180
Result for 2000 120 180
Overall Result 180 180
Query Result
SUMRT <Operand>
Delivers the query result of the operand. For more information about the difference between the overall result and the query result, see Percentage Functions ®
%GT and %RT.
Processing a Value as a Time
TIME
The TIME operator takes any key figure or (partial) formula in general and makes a TIME type key figure. Go to the formula editor and, for the operator, double-click
the data function Process Value as Time and, for the operand, double-click the key figure you want. For example, the formula is then Time (Sales).
The system cuts off the decimal places, interprets the value as seconds, and displays the value in the form +-hh:mm:ss. For example, -4812 is displayed as –
1:20:12.
Any time is seen as seconds from 00:00:00 and output in hours, minutes and seconds. A TIME type key figure with value 0 is displayed as 00:00:00.
Negative times are permitted: With a negative time the system calculates from 00:00:00 backwards.
The number of hours can be any amount. After 24 hours the system restarts at 0.
This function is designed for offset calculations, among other things. For example, if you need to deduct four hours with time key figures, then you
can set the TIME operator.
!--a11y-->
1.2.5.3 Boolean Operators
Use
These are functions that you can use as operators for defining a formula or a calculated key figure.
Features
Relational Operators (<, <=, <>, ==, >, >=)
<Expression1> <Operator> <Expression2>
The result is 1 if the relationship denoted by <Operator> between expression <Expression1> and <Expression2> holds (that is <Expression> <Operator>
<Expression2> is true), otherwise the result is 0. Only numerical values of <Expression1> and <Expression2> are compared without taking units into account.
Example: Costs < Sales delivers 1 if sales are greater than costs and 0 if costs are greater than or equal to sales.
Logical AND (AND)
<Expression1> AND <Expression2>
The result is 1 if both <Expression1> and <Expression2> do not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1> and
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 16 of 62
<Expression2> are considered, without taking units into account.
Logical OR (OR)
<Expression1> OR <Expression2>
The result is 1 if <Expression1> or <Expression2> does not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1> and <Expression2>
are considered, without taking units into account.
Logical Exclusive OR (XOR)
<Expression1> XOR <Expression2>
The result is 1 if either <Expression1> or <Expression2> (but not both) does not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1>
and <Expression2> are considered, without taking units into account.
Logical NOT (NOT)
NOT <Expression>
The result is 1 if <Expression> is 0, otherwise the result is 0. Only the numerical value of <Expression> is considered without taking units into account.
LEAF
The result is 0 for results rows or real (inner) nodes of a hierarchy, and the value 1 for elementary rows or the leaves of a hierarchy.
This operator allows you to carry out various calculations on results rows and elementary rows.
Conditional Calculations (IF-THEN-ELSE)
You can make conditional calculations using Boolean operators An expression in the form
IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form
<Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2>
Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs
can be written as the following formula:
(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs) ) * Actual Costs
or
(Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs
!--a11y-->
1.2.5.4 Technical Notes about the Formula Operators
Test of <Expression> = 0
The test for whether a mathematical expression is 0 is used to avoid problems based on rounding operations through the inquiry abs (<Expression>) < 10**-6. In
other words, all values in the interval [-10**-6, 10**-6] = [-0,000001; 0,000001] are taken as 0.
Result for Non-Defined Mathematical Operations
If an operation which is not allowed or not defined mathematically (for example, division by 0, square roots of negative values) is executed, the character for
"division by 0" or "data does not exist" (see SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting
Settings ® Display of Numerical Values in the Business Explorer ) is given and is not calculated further. This means that all formulas in which the incorrect
formula appears are not calculated.
You can suppress this reaction that causes the expression to lead to errors by compounding the operators NDIV0() or NOERR() (see
Data Function).
When you use these operators, check that the result can be interpreted meaningfully by the user, even in the case of errors.
ABAP Coding for Calculating Operators
In problematic cases, take a look at the functions of the operators in the ABAP coding (include LRRK0F10, form LOC_RECHNEN).
!--a11y-->
1.2.6 Defining Exception Cells
Use
When you define selection criteria and formulas for structural components and there are two structural components of a query, generic cell definitions are created at
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 17 of 62
the intersection of the structural components that determine the values to be presented in the cell.
Cell-specific definitions allow you to define explicit formulas, along with implicit cell definition, and selection conditions for cells and in this way, to override
implicitly created cell values. This function allows you to design much more detailed queries.
In addition, you can define cells that have no direct relationship to the structural components. These cells are not displayed and serve as containers for help
selections or help formulas.
Prerequisites
The query contains two structures. You can define exception cells only for queries which have two structures. You can use the one structure for characteristic
values and key figures for the other. You can then define cells if these prerequisites have been met.
A cell is the intersection between two structural components. The term Cell for the function Defining Exception Cells should not be
confused with the term Cell in MS Excel. The formulas or selection conditions that you define for a cell always take effect at the intersection
between two structural components. If a drilldown characteristic has two different characteristic values, the cell definition always takes effect at the
intersection between the characteristic value and the key figure.
Procedure
In the Query Designer toolbar, choose Define Cells... to reach the cell definition functions.
New selection
1. Select a cell in the Cell Definition dialog box and, from the context menu, choose New Selection.
2. Define your selection by dragging a key figure and the characteristic values by which you want to restrict the key figure (using Drag&Drop) to the right-hand
area of the New Selection dialog box. See also Defining Selections
You can use characteristic value variables instead of fixed characteristic values.
- If you want to change an existing variable, select this variable and, from the context menu, choose Edit. The SAP BW Variables Editor appears. For more
information, see Changing Variables in the Variable Editor.
- If you want to define a new variable, select the characteristic value and, from the context menu, choose New Variable . The SAP BW Variables Wizard
appears. For more information, see Defining Variables with the Variable Wizard.
3. Enter a description for the selection.
You can use Text Variables in the description.
4. Choose OK . The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell.
New formula
1. Highlight a cell in the Cell Definition dialog box and, using the secondary mouse button, choose New Formula from the context menu .
2. Define your formula using the operands and functions available. See also Defining Formulas
3. Enter a description of the formula.
You can use Text Variables in the description.
4. Choose OK . The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell.
New cell reference
You can use any cell that you define in a formula. If you want to reuse the value from the implicit, generic cell definition that is automatically created at the
intersection of the two structural components of a query, select this cell in the Cell Definition dialog box and, using the secondary mouse button, choose New
Cell Reference. A description taken from the two structural components now automatically appears in the cell. The symbol shows you that a cell reference
exists for this exception cell. You can now reference to this cell. That is, you can reuse the implicit cell definition and do not have to create these values manually
in a new selection.
Functions of explicitly defined cells:
Select a defined cell and choose the required function from the context menu (secondary mouse button).
· Edit
· Delete
· Where-Used List
Before you delete a cell, you can check for the formulas in which the defined cell is used in the where-used list.
· Properties
Choose Properties if you:
- Want to change the description of the cell.
- Want to change the highlighting of the cell.
- Want to hide the cell. That is, if you do not want to see the values of the cell.
Help Cells
Choose Help Cells, if you require additional cells for help selections or help formulas. You can use the functions New Selection and New Formula in the
context menu to define help cells that are not displayed in the query to serve only as objects for help selections and help formulas.
For example, you can define an invoice in a help cell and use this in a “real” cell to calculate a duplicated invoice.
a. Right-click on the empty cell next to Help Cells to get to a context menu. From here, choose New Selection.
b. Use Drag & Drop to drag the Invoice key figure into the right-hand area of the New Selection dialog box.
c. Enter a description.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 18 of 62
d. Choose OK . The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell.
e. From the context menu for the required cell of the query, now choose New Formula.
f. Drag the cell you have just defined, which you can find in the Operands window, under Cells, into the Formula window using Drag & Drop. Click on
the button twice.
g. Enter a description.
h. Choose OK . The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell.
In the help cells that are already defined in the context menu, you can:
· Edit the cell definition
· Delete the cell definition
· Display the where-used list for the cell
· Change the description of the cell under Properties.
Result
You have defined one or more exception cells for a query. In the status bar of the Query Designer, the symbol shows you that the query contains exception
cells.
!--a11y-->
1.2.7 Save Queries
Save queries
You can save a query that you have changed under its current name using the function Save Query.
In the Query Designer toolbar, choose Save Query.
If the query does not yet have a technical name, the system offers the function Save Query As... automatically.
Save query as...
1. If you want to save the query under a new technical name, in the Query Designer toolbar, choose Save Query As...
2. Enter the new technical name.
This name must uniquely identify the query, meaning that the name is allowed to appear only once in the entire Business Information Warehouse.
The technical name can be up to 30 characters long and must begin with a letter.
3. Enter a Description for the query. You can save the query in your favorites or roles.
Result
The query has been saved and you can now:
· Display it in the Web browser with the Standard Web Template for Ad-hoc Analysis
· Use the query in the Web Application Designer as a data provider for Web items.
· Insert the query into a workbook in the BEx Analyzer
· Use the query in the Crystal Report Designer as a data source for a formatted report
!--a11y-->
Using Variables: The Variable Wizard and the Variable Editor
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.
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.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 19 of 62
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.
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 . 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 Change Variable appears next to the Entry of Variables checkbox. You can change the variable using . The Variable Editor dialog box
appears.
· The symbol New Variable appears next to the Entry of Variables checkbox. Choose if you want to create a new variable. The Variable Wizard
dialog box appears.
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.
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.
!--a11y-->
1.3.1 Variable Types
Definition
The type of variable being used. This determines the object that the variable represents as a placeholder for a concrete value.
Structure
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.
· Characteristic Value Variables
Characteristic value variables represent characteristic values and can be used wherever characteristic values are used.
If you restrict characteristics to specific characteristic values, you can also use characteristic value variables. See, Restricting Characteristics.
· Hierarchy Variables
Hierarchy variables represent hierarchies and can be used wherever hierarchies can be selected.
If you restrict characteristics to specific hierarchies or select presentation hierarchies, you can also use hierarchy variables. See Selecting
Hierarchies
· Hierarchy Node Variables
Hierarchy node variables represent a node in a hierarchy and can be used wherever hierarchy nodes are used.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 20 of 62
If you restrict characteristics to specific hierarchy nodes, you can also use hierarchy node variables. See Restricting Characteristics: Hierarchies
· Text Variables
Text variables represent a text and can be used in descriptions of queries, calculated key figures and structural components.
You can use text variables in the description of calculated key figures, restricted key figures, selections and formulas when you create them. See
Defining Calculated Key Figures, Defining Restricted Key Figures, Defining Selections, and Defining Formulas.
You can change the descriptions in the properties dialog box. See Query Properties Calculated Key Figure Properties Restricted Key Figure
Properties, and Selection/Formula Properties.
· Formula Variables
Formula variables represent numerical values and can be used in formulas. See Defining Formulas.
In addition, numerical values are used for selecting exceptions and conditions and you can also use formula variables here. See Defining Exceptions and
Defining Conditions
You can use a formula variable for the interest rate in order to process the current interest rate, after you have executed the query or Web
application.
!--a11y-->
1.3.1.1 Using Text Variables
Use
Text variables represent a text and can be used in descriptions of queries, calculated key figures and structural components.
When the system is replacing text variables, if it finds no values or multiple values for the reference characteristic and is thus unable to determine
a unique value, the technical name is output as the result: &<technical name of the text variable>&
Procedure
Selecting existing text variables
Choose to select an existing text variable.
Changing existing text variables
1. If want to change an existing text variable, select the text variable in the Description field and click with the left mouse button on the selected text variable.
2. From the context menu that appears below the field, choose Change Text Variable. The SAP BW Variables Editor appears.
For more information, see Changing Variables in the Variable Editor.
Creating new text variables
1. In the Description field, enter an ampersand & .
2. From the context menu that appears automatically, choose New Text Variable. The SAP BW Variables Wizard appears.
For more information, see Defining Variables with the Variable Wizard.
!--a11y-->
1.3.2 Variable Processing Types
Use
The processing type of a variable determines how a variable is filled with a value for the runtime of the query or Web application.
Features
The following processing types are available:
Manual Entry / Default Value
Replacement Path
Customer Exit
SAP Exit
Authorization
Depending on the type of variable used (context-sensitive), the possible processing types are offered in the variable wizard. For more
information about the possible combinations of variable types and processing types, see
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 21 of 62
Overview of Variable Types and Processing Types.
Activities
In the variable wizard, in the General Information dialog step, choose the required processing type .
!--a11y-->
1.3.2.1 Manual Entry / Default Value
Use
The processing type Manual Entry/Default Value enables you to enter a value manually or to use the default value when defining a variable. This value is then
used for the variable when you execute the query or Web application.
Integration
The processing type Manual Entry / Default Value is available for all variable types.
Features
If you choose the processing type Manual Entry/Default Value for a variable, when you execute the query, you can enter the required value for the variable
manually in a dialog box (the Variables Screen ) provided that the variable is ready-for-input. Otherwise, the default value of the variable is used.
When you create the variable, you can enter a default value if you wish. If you enter a default value, this is shown in the input field of the variables screen for
variables that are ready-for-input. For variables that are not ready-for-input, the default value is used as the variable value.
Activities
In the variable wizard, in the General Information dialog step, choose the processing type Manual Entry/Default Value. In the Default Value dialog step, enter
a value as required.
!--a11y-->
1.3.4.3 Replacement Path
Use
You use the Replacement Path to specify the value that automatically replaces the variable when you execute the query or Web application.
Integration
The processing type Replacement Path can be used with characteristic value variables, text variables and formula variables.
Features
Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value.
The variable wizard takes you automatically to the Characteristic dialog step, in which you select the reference characteristic for replacement. In the
Replacement Path dialog step that follows, you choose whether the variable is replaced by the From or the To Value and the Key or the Name of the
characteristic value. You can also specify the offset start and offset length for the output.
Characteristic value variables with the processing type Replacement Path, are replaced by the results of a query. In the Replacement Path dialog step, select
the query whose result you want to use as the variable. You can now use the data result of the selected query as a variable in a different query.
The processing type Replacement Path takes place automatically, meaning it is never ready-for-input when executing.
Activities
In the variable wizard in the General Information dialog step, choose the processing type Replacement Path.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 22 of 62
Example
If you specify a variable as a characteristic value, you do not have to give a text for the characteristic value right away. Instead, you can fill the text field
dynamically, according to the characteristic that you use for the variable when you execute the query. To do this, define a text variable with automatic
replacement.
!--a11y-->
1.3.2.3 Customer Exits
Use
If you need to use a processing type other than manual entry / default value, replacement path, SAP exit , or authorization, then a customer exit gives you the
option of setting up a processing type for variables, tailor-made to your specific needs.
The customer exit is designed as an enhancement that you can configure with customer-specific logic. You can find detailed information about customer exits and
their use in the Enhancements to the Standard section of the BC Changes to the SAP Standard documentation.
Integration
You can process all variable types (characteristic value variables, hierarchy node variables, hierarchy variables, formula variables and text variables) using
the Customer Exit processing type.
Prerequisites
You have created a project in the CMOD transaction. You have selected SAP enhancement RSR00001 and assigned it to the enhancement project. You have
activated the project.
In SAP Enhancement Help, you can get further information on working with the SAP enhancement for global variables in reporting. Call up the
transaction SMOD. Enter the name of the enhancement (RSR00001), choose Documentation and then Edit ® Display Sub-object.
You can find general information about working with customer exits under Help ® Application Help in transaction CMOD .
Features
The Customer Exit processing type for variables allows you to use a function module exit to set default values for variables. The function module
EXIT_SAPLRRS0_001 is used here .
You want to use one characteristic value to calculate a second characteristic value. The InfoProvider only contains the calendar day. However, you
now also want to see in a query the cumulated value for the relevant period (beginning with the first day of a quarter).
For the first day of the quarter, use a variable with customer exit processing. If you now enter the current calendar day (19.06.2000, for example),
a start date of 01.06.2000 appears in the customer exit, and the cumulated value of this period can be displayed.
Item Sales 19.06.2000 Sales – 01.06.2000 – 19.06.2000
A 5 263
B 7 157
C 2 67
Activities
In the variable wizard, in the General Information dialog step, choose the processing type Customer Exit.
See also:
Dependencies for Variables of the Customer-Exit Type
!--a11y-->
Dependencies for Variables of Type Customer Exit
Use
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 23 of 62
The variable exit may not executed or false data may be selected when executing a query that contains variables with the replacement path Customer Exit, filled
dependently of the entry-ready variables. As a preemptive measure, you can control the dependencies with the parameter I_STEP.
Features
The enhancement RSR00001 ( BW: Enhancements for Global Variables in Reporting ) is called up several times during execution of the report. Here, the
parameter I_STEP specifies when the enhancement is called up.
The following values are valid for I_STEP:
· I_STEP = 1
Call up takes place directly before variable entry
· I_STEP = 2
Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1.
· I_STEP = 3
In this call up, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards,
I_STEP=2 is also called up again.
· I_STEP = 0
The enhancement is not called from the variable screen. The call up can come from the authorization check or from the Monitor.
Values of other Variables
When calling up the enhancement RSR00001 ( BW: Enhancements for Global Variables in Reporting), the system transfers the currently available values of the
other variables in table I_T_VAR_RANGE. The table type is RRS0_T_VAR_RANGE and the row type RRS0_S_VAR_RANGE references to the structure
RRRANGEEXIT.
This structure has the following fields:
Field Description
VNAM Variable name
IOBJNM InfoObject name
SIGN (I)ncluding [ ] or (E)xcluding ] [
OPT Operators: EQ =, BT [ ], LE < =, LT <, GE > =, GT >, CP and so on.
LOW Characteristic value
HIGH Upper limit characteristic value for intervals/the node-InfoObject for hierarchy nodes.
Activities
A variable that is to be filled dependently of an entry-ready variable must never be filled in step I_STEP=1. Now you are at a position prior to the variable entry.
Values have not yet been entered for the entry-ready variables.
You can insert the following statements to force the variable to be executed with I_STEP=2 and not I_STEP=1.
CASE I_VNAM.
…
IF I_STEP <> 2.
RAISE no_processing.
ENDIF.
…
!--a11y-->
1.3.2.4 SAP Exit (delivered variables)
Use
The SAP Exit processing type is contained in variables delivered by SAP BW within the Business Content framework.
Integration
You can find the delivered variables in the Metadata Repository if you search for variables using the search function (see Searching for Metadata ).
The technical name of a delivered SAP object always begins with a number.
Prerequisites
Before you can use delivered variables you must first activate them. You can get further information on activating the query objects under Installing Business
Content.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 24 of 62
Features
SAP delivers a number of variables. There are variables that are processed via automatic replacement using a predefined replacement path ( SAP Exit
processing type).
If you want to define a query that only ever displays the data from the current month, drag the delivered variable “current month” (technical name
0CMONTH) for the characteristic value “current month” (technical name 0CMONTH) into the query filter.
Activities
In the variable wizard in the General Information dialog step, choose the processing type SAP Exit.
You can only create variables with the processing type SAP Exit in SAP Systems. Customers cannot create any variables with the processing
type SAP Exit. For customers, variables with SAP Exit are a part of the delivered Business Information Warehouse Business Content.
!--a11y-->
1.3.2.5 Authorization
Use
The processing type Authorization enables variables to be filled with values automatically from the user authorization.
Integration
The processing type Authorization can be used with characteristic value variables and hierarchy node variables.
Prerequisites
You have maintained the authorizations in transaction RSMM.
Features
When you create a variable, if you choose Process with Authorization , the variable is automatically filled with the values of the user's authorization. When the
user opens a query, the data is selected automatically according to his or her authorizations.
Note that when they are automatically filled, variables do not have to be ready-for-input, which means a variables screen does not necessarily
appear when you open the query or Web application. The user opens the query with the authorization variable, and can see only the data that
corresponds to his or her authorizations.
Activities
In the variable wizard in the General Information dialog step, choose the processing type Authorization.
!--a11y-->
1.3.3 Overview of Variable Types and Processing Types
Use
In the variable wizard, you choose a processing type that is dependent on the type of variable you are using. Depending on the variable type, only certain
processing types are useful. The variable wizard offers you automatically only the possible processing types and takes you to the relevant settings for the chosen
processing type using different dialog steps.
Features
The following table gives an overview of the possible combinations of variable types and processing types. The dialog steps that the variable wizard offers for
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 25 of 62
each combination are also listed.
Variable Type/Processing
Type
Manual entry / default value Replacement Path Customer Exit
or SAP Exit
Authorization
Characteristic Value
Variable
Details
Default Values
Replacement Path:
Replacement with Query
Details Details
Hierarchy Variable Details
Default Values
Details
Hierarchy Node Variable Details
Default Values
Details Details
Text Variable Details
Default Values
Characteristic
Replacement Path:
Replacement with a
Characteristic Value
Details
Formula Variable Details
Currencies and Units
Default Values
Characteristic
Replacement Path:
Replacement with a
Characteristic Value
Currencies and Units
Details
Currencies and Units
!--a11y-->
Defining Variables with the Variable Wizard
Use
The variable wizard takes you through the process of defining a variable step-by-step.
Procedure
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 Overview of Variable Types
and Processing Types.
Introduction
The first dialog step in the variable wizard explains that you can define variables as placeholders instead of using fixed values. These placeholders are then filled
during the query runtime.
If you do not want to see this step in the future, select Do not display this step in future.
General Information
The second dialog step shows the type of variable. You determine the type of variable by calling up the variable wizard in a specific context. If you have
chosen, for example, New Variable in the context menu of a characteristic value, then Characteristic Value is shown automatically in the variable wizard as the
variable type. For more information about context-sensitivity in the variable wizard, see Using Variables: The Variable Wizard and the Variable Editor.
1. Enter a variable name and a description for the variable.
The variable name is the technical name of the variable and has to be unique across all queries.
2. In the Processing by field, choose the processing type for the variable. Depending on the type of variable, only the processing types that are relevant for
this variable type appear for you to choose from in the dropdown box. For more information, see Variable Processing Types.
3. In the Characteristic field, select the InfoObject on which the variable is to be based.
As standard procedure, define variables on the basic InfoObject . You are also able to select the InfoObject that references the basic InfoObject, and define
the variable on that InfoObject, by using the dropdown box.
The ability to define variables both on the basic InfoObject and on derived InfoObjects permits a higher level of reusability for variables. Because
InfoSets contain many InfoObjects with the same basic InfoObject, it makes sense to define variables on the basic InfoObject particularly when
using InfoSets as the InfoProvider for the query.
In your BW system you have defined the characteristic CUSTOMER and have derived a further characteristic from this: MANUFACTURER. Both
characteristics have the same variables. When you create new variables you can choose whether the variables are to reference CUSTOMER or
MANUFACTURER.
Both the variables that were created for MANUFACTURER and the variables that were created for CUSTOMER are listed in the left-hand selection
box of the query designer InfoProvider object under the characteristic MANUFACTURER.
The following dialog steps are context-sensitive:
Depending on the variable type and processing type that you have chosen, the relevant dialog step appears. This is where you can make the necessary
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 26 of 62
settings.
· Details
· Default Values
· Replacement Path
· Characteristic
· Currencies and Units
Saving Variables
In the last dialog step, you get a summary of the settings for the variable.
Choose Exit . The system saves the variable and closes the variable wizard.
Result
You have defined a variable. The changed variable can now be used in all queries.
!--a11y-->
1.3.4.1 Details
Definition
Dialog step in the variable wizard that appears for almost all types of variable. Only those variables with the processing type Replacement Path do not require
this dialog step.
Structure
In the Details dialog step, you can set the following options:
The individual options for the settings here vary depending on the variable type and the processing type. The following section lists all of the
settings. The variable wizard automatically displays only those settings that are useful and available.
Variable Represents
This is where you choose the display area that the variable represents.
· Single Value
The variable represents one value only.
· Multiple Single Values
The variable represents a number of single values. This setting is useful in hierarchy nodes, for example, to allow you to enter several single nodes.
· Interval
The variable represents the interval between a specific ‘from’ value and a specific ‘to’ value.
· Selection Option
The variable represents any combination of single values and intervals. In the variables screen where you select values for variables, you can also work with
operators (>,<,=, and so on), search by specific criteria (for example, search for all values that begin with A) and exclude certain values (by specifying
which values not to search for).
For more information, see Default Values
· Precalculated Value Set
The variable represents a set of values that were precalculated with a query by the Reporting Agent. The available values are those values that were
precalculated to the characteristic of the variable (for example 0SOLD_TO Sold-to Party ) or its basic characteristic (for example 0CUSTOMER Customer ).
Such a variable can also be ready for input. During runtime you can select various value sets in the variable screen. For more information, see Defining
the Value Set Setting.
Please note that variables that represent a precalculated value cannot be used in restricted key figures or in selection structure elements for
technical reasons.
Variable Value Is
· Optional
This setting means that the variable does not have to be filled with a value during runtime.
Variables with the processing type Authorization have the standard setting Variable Value is Optional . Therefore, the variable wizard does not
offer you selection options, such as Optional , Obligatory , and Obligatory, Initial Value Not Permitted , for variables that are filled from the
authorization.
· Mandatory
This setting means that at least one value has to be specified for the variable during runtime. The initial value (#) is permitted explicitly. The initial value #
means “unassigned”, that is, you can use it to explicitly select all data records in which this characteristic has no characteristic values.
· Mandatory, Initial Value Not Allowed
This setting means that at least one value has to be specified for the variable during runtime. The initial value (#) is not permitted. This means that you have
to enter one or more values in the variable screen to be able to execute the query.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 27 of 62
Ready for Input
Here you determine whether or not the variable is set to “ready for input” when you execute the query or the Web application.
If, when you execute the query or the Web application, the Ready for Input option is active (this is the default setting), a dialog box appears (the variables
screen). You either specify the value or values that you want to use, confirm the default values, or change the default values.
You can deactivate the Ready for Input option if you want to fill the variable with a value beforehand. When you execute the query or the Web application, it is
filled automatically with a value.
If you set the variable as not ready for input, but have set the variable value as mandatory and have not specified a default value, the system
cannot execute the query and an error message is displayed.
The Ready for Input option is available for the following processing types; manual entry / default value, customer exit, SAP exit, and authorizations.
Can Be Changed with Query Navigation
If you choose the Can Be Changed with Query Navigation option, after you have run the query, not only are you able to select the values that you specified in the
variables screen, but you are also able to use other values as dynamic filters for the query (see also: Selecting Filter Values).
Note that this function is not possible if you are using the variable as part of a structure in the query definition. The system ignores the setting Can
Be Changed with Query Navigation in this case.
You can use this function for variables of characteristic values and hierarchy nodes.
For more information on this topic see Special Features of Variables that can be Changed Dynamically.
Copy Personalization Data from Variable
Each user can personalize the variable values for variables that are ready for input. The personalized values are saved for each variable and each user.
If you want to use the same personalization data in more than one variable, in the input field, specify the names of the variables under which the personalization
data is stored.
Note that you have to specify the variable without an ampersand &.
You have defined a “Customer 1” variable that is mandatory and ready for input. You now want to define a “Customer 2” variable that is
mandatory (blank value not allowed), ready for input and that can be changed in query navigation. By making the Copy Personalization Data
from Variable “Customer 1” setting in the “Customer 2” variable, you give both variables the same personalized value.
Length of Input Field
In the dialog step Details for text variables, there is a setting for Length of Input Field.
Specify a number here. This determines the number of characters of text that the user can specify to represent the variable.
!--a11y-->
Special Features with Dynamically Changeable Variables
Use
The Changeable with Query Navigation function allows you to override the variables entry by selecting the dynamic filter.
When using a dynamically changeable variable, that is, a variable with the activated function Changeable with Query Navigation in a query in connection with a
free characteristic, you can override the variable entry with the dynamic filter. In other words, you can also access values that are not found in the value area of
the variable entry. The values entered for the variables are only used to parameterize the dynamic filter for the start list.
This function is only available for characteristic value variables in the free characteristics. When using such a variable in the filter, it behaves like a “normal”
variable that cannot be changed.
When refreshing a workbook in the BEx Analyzer that contains a changeable variable, this variable does not appear in the variable screen, since
the values have already been set in the dynamic filter and also displayed.
For this reason, the value of such variables are also no longer displayed in the text elements for the variable values.
Constraints
When using a dynamically changeable variable for a compounded characteristic, the variable values cannot be dynamically changed when executing the query
and the variable behaves like a fixed variable. It some cases, it is not technically possible to make the variable technically changeable. The system then treats
the variable like a fixed variable.
In such cases, a system message appears, which explains to you that the variable is set to not changeable.
The following cases lead to the variable being set to not changeable:
· The superior characteristic is restricted by a dynamically changeable variable. The subordinate characteristic is either set using a fixed variable or a fixed
value.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 28 of 62
Example: The cost center is compounded to the controlling area. The cost center is set using a fixed variable or fixed value. The controlling area is
restricted by a dynamically changeable variable. This variable is converted into a fixed variable.
· Both the superordinate and the subordinate characteristic is restricted with a dynamically changeable variable. In this case, the variable for the superordinate
characteristic is converted.
Example: For dynamically changeable variables for the cost center and controlling area, the variable for controlling area is set to non-changeable.
· Both characteristics have been given a dynamically changeable variable. In addition, the subordinate characteristic is restricted to a fixed value. In this case,
both variables are set to non-changeable.
Example: The cost center is set to 1001001 and given a dynamically changeable variable. At the same time, the controlling area is also given a
dynamically changeable variable. Both variables are treated as non-changeable variables.
· You are using a dynamically changeable hierarchy node variable and choose not to set the presentation hierarchy uniquely. The node variable is also treated
as a non-changeable variable in this case.
Note: When refreshing variables that have been set as fixed, the system may display no data .
Activities
Note the following when using the Changeable with Query Navigation function :
· A variable can only be changed in the query definition when it is only used in a drilldown characteristic and when there are no other restrictions to this
characteristic aside from these variables.
· No additional characteristic is allowed to be compounded with a variable to the affected characteristic.
· For hierarchy node variables, the hierarchy must match the presentation hierarchy that has been set up.
· The characteristic value is not allowed to be moved, for example offset –1. In addition, the variable is no longer changeable with the query navigation.
!--a11y-->
1.3.4.2 Default Values
Definition
Dialog step in the variable wizard for variables with the processing type Manual Entry / Default Value
Use
You specify one or more default values when you define a variable. These then appear in the variables screen when you execute the query or Web application.
If the variable is ready-for-input, you can overwrite the default value in the variables screen and select a different value.
If the variable is not ready-for-input, the query is filled with the default value and you cannot change the value when you execute the query or Web
application.
Structure
Depending on which setting you have chosen in the Details dialog step, the variable wizard offers various fields in the Default Values dialog step.
· If the variable represents a single value, you can enter one default value here.
· If the variable represents several single values, you can enter or select a default value here.
a. Choose . The selection dialog box appears.
b. In the left window Fixed Values , highlight the value and select it by clicking on the arrow pointing to the right.
· If the variable represents an interval, you can enter a default value manually for the From Value and a default value for the To Value, or select the default
values using .
· If the variable represents a selection option, you have the following options for settings:
a. In the +/- Sign field, choose either Include Value or Exclude Value
b. In the Option field, select one of the following settings:
- Is equal to
- Is not equal to
- Is between (is in the interval)
- Is not between (is not in the interval)
- Is less than or equal to
- Is greater than
- Is greater than or equal to
- Is less than
- Contains the pattern
- Does not contain the pattern
Depending on the setting that you selected in the Option field, context-specific options are given for the default value.
c. Enter a default value manually or select it using .
If you have chosen the option Contains the pattern or Does not contain the pattern , do not enter a purely numerical value as the default value, but enter
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 29 of 62
characters such as ABC or *.
If you choose Include Value and Contains the pattern *. * appears as the default value.
If you choose Exclude Value and Contains the pattern *. Everything but * appears as the default value.
· If the variable represents a precalculated value set, you have to enter the technical name of the value set created in the Reporting Agent as the default value.
This value set contains the required precalculated values from the Reporting Agent background reporting. For more information about pre-calculating value
sets, see Defining the Value Set Setting.
You can enter only one default value.
!--a11y-->
1.3.4.3 Replacement Path
Definition
A step in the variable wizard that appears for characteristic value, formula and text variables with the processing type Replacement Path .
Structure
According to the type of variable, you can make different settings for the replacement path.
· Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value. See Replacement Path:
Replacement with a Characteristic Value.
· Characteristic value variables with the processing type Replacement Path, are replaced by the results of a query. See Replacement Path: Replacement
with a Query.
!--a11y-->
Replacement Path: Replacement with a Characteristic Value
Definition
A step in the variable wizard that appears for formula and text variables with the processing type Replacement Path .
Use
Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value.
The value of a formula variable has to be a number. The value of a text variable has to be a text.
Structure
Here you choose the characteristic or attribute value with which the variable is replaced.
Replace Variable with
· Key
The variable value is replaced with the characteristic key.
· External Characteristic Value Key
The variable value is replaced with an external value of the characteristic (external/internal conversion).
· Name (Text)
The variable value is replaced with the name of the characteristic.
Note that formula variables have to contain numbers in their names so that the formula variable represents a value after replacement.
· Attribute Value
The variable value is replaced with the value of an attribute. An additional field appears for entering the attribute.
When replacing the variable with an attribute value, you can create a reference to the characteristic for which the variable is defined. Choose the attribute
Reference to Characteristic (Constant 1). By choosing this attribute, you can influence the aggregation behavior of calculated key figures and obtain
improved performance during calculation. You can find additional information under Properties of the Calculated Key Figure under Aggregational Behavior
and under Calculating with Variables for Processing Type “Replacement Path”.
This setting is only available for formula variables.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 30 of 62
· Hierarchy Attribute
The variable value is replaced with a value of a hierarchy attribute. An additional field appears for entering the hierarchy attribute.
You need this setting for sign reversal with hierarchy nodes. For more information, see Sign Reversal
This setting is only available for formula variables.
For Intervals Use
· From-value
· To-value
· Difference
If the replacement value called is an interval, you use this setting to specify whether the lower interval limit (from value) or the upper interval limit (to value) is
used as the replacement value.
For formula variable, you can also choose the interval difference as the replacement value. Using this setting, you can easily calculate the difference of period
boundaries. The interval difference is the from value minus the to value plus 1. For example, the period January to March gives a result of 3 (the to value 3, minus
the from value 1, plus 1)
Offset Start and Offset Length
You use this setting to specify the start and length of the text output.
You want to create a text variable for the fiscal year.
In the replacement path Dialog Box, choose the option Replace Variable with Key and enter the offset start at value 2 and the offset length as 2.
The fiscal year is four digits; the output of the value begins after the second digit and shows 2 digits. Therefore, in the executed query, the text
variable for fiscal year 1997 is replaced by the value “97”.
For more examples of the offset start and the offset length, see Variable Replacement Example.
Evaluate as Boolean (Value 0 or 1)
This function is only available for formula variables.
If you select this setting, the formula variable is not replaced by a value (for example, the key value) but gives the existence of a value.
· The value of the variable is 0 when the value to be replaced is a string with only blank spaces or a zero.
· The value of the variable is 1 when the value to be replaced is a string with characters that are not blank spaces or a number does not equal 0.
You want to calculate paid amounts only.
a. In the Replacement Path dialog step, choose the option Replace Variable with an Attribute Value.
b. Enter the attribute Paid. (The master data attribute Paid shows open invoices with a blank space “ “ and paid invoices with the value “X”.)
c. Select Evaluate as Boolean (Value 0 or 1)
For empty spaces you get the a 0 and for the value “X” you get a 1. Multiplication by such a formula variable means that all unpaid amounts are
omitted from the query and you are only calculated paid amounts.
!--a11y-->
Calculating Variables for Processing Type “Replacement Path”
Use
In formulas it is possible to calculate with the properties or values for a characteristic (such as a key, an external attribute of the key, an attribute value, or a
hierarchy attribute). In doing so, the formula is replaced, depending on the cell context.
Features
For example, the basic characteristic Sales Quantity multiplies with the current value for the attribute Price for the characteristic Material . You can reach this
with the corresponding, defined formula variable: Processing type Replacement Path , replacement from characteristic Material , replace variable with Attribute
Value : Attribute Price .
The replacement of formula variables with the processing type Replacement Path acts differently in calculated key figures and formulas:
· If you use a formula variable with “ Replacement from the Value of an Attribute ” in a calculated key figure, then the system automatically adds the drilldown
according to the reference characteristic for the attribute. The system then evaluates the variables for each characteristic value for the reference characteristic.
Afterwards, the calculated key figure is calculated and, subsequently, all of the other operations are executed, meaning all additional, calculated key figures,
aggregations, and formulas. The system only calculates the operators, which are assembled in the calculated key figure itself, before the aggregation using
the reference characteristic.
Note that the calculation before the aggregation can impair performance.
· If you use a formula variable with Replacement from the Value of an Attribute in a formula element, then the variable is only calculated if the reference
characteristic is uniquely specified in the respective row, column, or in the filter.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 31 of 62
Integration
Replacement from the Value of an Attribute
With formula variables you can set the processing type Replacement from the Value of an Attribute and create a reference to the reference characteristic for the
variable. The attribute Reference to Characteristic (Constant 1) is a dummy attribute that is available with each characteristic. It serves to create a reference to the
characteristic, by which it does not need to be aggregated. By choosing this attribute, you can influence the aggregation behavior of calculated key figures in a
targeted way and can improve performance during calculation.
Example
Example for calculating with variables for process type Replacement from the Value of an Attribute :
Master data table for material
InfoCube
In the example query there are the following objects:
Material Price (V1) is a variable that is replaced by the material price.
K1 = Material Price (V1) is a calculated key figure.
F1 = Material Price (V1) is a formula.
K2 = Material Price (V1) * Sales Quantity is a calculated key figure.
F2 = Material Price (V1) * Sales Quantity is a formula.
K3 = K1 * Sales Quantity is a calculated key figure in which the calculated key figure K1 is further processed.
Query View 1
Query View 2
In the results rows the columns F1 and F2 are not specified, because the material value is not unique. Also, the system cannot calculate F1 and F2 in the overall
Query View 2. K1 only aggregates the prices and K3 multiplies these aggregated prices with the aggregated sales quantities. Usually the results from K1 and K3
have no meaning. The calculated key figure K2 delivers the desired results.
!--a11y-->
1.3.4.3.1.2 Variable Replacement Example
The following example shows the replacement options you have for the characteristic value with regard to the setting Key / External Characteristic Value of the
Key in connection with the offset start and offset length:
Fiscal Year Variant K4
Fiscal Year / Period 2002/008
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 32 of 62
Fiscal Year 0FISCYEAR Fiscal Year / Period 0FISCPER
Internal display (key) K42002 K42002008
External display (external characteristic value of the key) K4/2002 K4/008.2002
Internal Display (Key)
Fiscal Year 0FISCYEAR
For the Key setting for the Fiscal Year 0FISCYEAR characteristic, you have to set the offset start at 2 and the length as 4. In the query, K42002 is replaced by
the value 2002.
Fiscal Year / Period 0FISCPER
For the Key setting for the Fiscal Year / Period 0FISCPER characteristic, you have to set the offset start at 2.
If you want to display on the year in the text output, choose the offset length 4. K42002008 is replaced by 2002 in the query.
If you want to display the year and the period in the text output, choose the offset length 7. 2002008 in the query replace K42002008.
Overview
0FISCYEAR Offset start 2 Offset length 4
0FISCPER Offset start 2 Offset length 4 for year
Offset length 7 for year and period
External Display (External Characteristic Value of the Key)
Fiscal Year 0FISCYEAR
For the External Characteristic Value of the Key setting for the Fiscal Year 0FISCYEAR characteristic, you have to set the offset start at 3 and the length as 4. In
the query, K4/2002 is replaced by the value 2002.
Fiscal Year / Period 0FISCPER
For the External Characteristic Value of the Key for the Fiscal Year / Period 0FISCPER, you have to make the following settings for the offset start and the offset
length:
If you want to display only the year in the text output, choose the offset start 7 and the offset length 4. K4/008.2002 is replaced by 2002 in the query.
If you want to display only the period in the text output, choose the offset start 3 and the offset length 3. 008 in the query replace K4/008.2002.
If you want to display the year and the period in the text output, choose the offset start 3 and the offset length 8. 008.2002 in the query replace K4/008.2002.
Overview
0FISCYEAR Offset Start 3 Offset Length 4
0FISCPER Offset length 7 for year
Offset start 3 for period
Offset start 3 for year and period
Offset length 4 for year
Offset length 3 for period
Offset length 8 for year and period
!--a11y-->
Replacement Path: Replacement with Query
Definition
A step in the variable wizard that appears for characteristic value variables with the processing type Replacement Path .
Use
Characteristic value variables with the processing type Replacement Path are replaced by the results of a query.
Select the query whose result you want to use as the variable. You can now use the data result of the selected query as a variable in a different query.
Please note that, for technical reasons, variables with processing type Replacing from a Query cannot be used in restricted key figures or in
selection structure elements.
Example
You want to insert the result for the query Top 5 products as a variable in the query Sales – Calendar year / month .
1. Select the characteristic Product and from the context menu, choose New Variable. The Variable Wizard appears.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 33 of 62
2. Enter a variable name and a description.
3. Choose the processing type Replacement Path .
4. Choose Next . You reach the Replacement Path dialog step.
5. Enter the query Top 5 Products .
6. Choose Next . You reach the Save Variable dialog step.
7. Choose Exit .
You are now able to insert the variable into the query Sales – Calendar year / month. This allows you to determine how the sales for these five, top-selling
products has developed month for month.
Every time you execute the query Sales – Calendar year / month , the query Top 5 Products is executed beforehand (= pre-query). This can
lead to long run times. If you do not need to execute the pre-query (that is, if you do not have to determine the top 5 products every time because
change monthly, for example), we recommend that you use a variable that represents a pre-calculated value set.
For more information, see Details Defining the Value Set Setting.
!--a11y-->
1.3.4.4 Characteristic
Definition
A step in the variable wizard for text and formula variables with the processing type Replacement Path .
Use
Some variables require a characteristic reference as a reference to the context in which they are used. The characteristic is usually determined from the context
(for example, with characteristic value variables).
The characteristic reference is not shown for text and formula variables with the processing type Replacement Path.
Therefore, you have to choose a characteristic here to which the variable relates.
!--a11y-->
1.3.4.5 Currencies and Units
Definition
A dialog step in the variable wizard for use with formula variables.
Use
Formula variables usually represent numbers without dimensions. You can select a dimension indicator so that the formula variable represents a dimension such
as amount, quantity or price. Depending on the dimension, you can determine a currency or a unit.
Structure
You can choose from the following dimensions:
Amount
If you choose Amount as the dimension, you can select a currency.
Quantity
If you choose Quantity as the dimension, you can select a unit.
Price
If you choose Price as the dimension, you can select a currency and a unit. (Price = Currency/Unit)
Number (=default setting)
If you choose Number as the dimension, you do not need to make any further entries.
Date
If you choose Date as the dimension, you do not need to make any further entries.
!--a11y-->
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 34 of 62
1.3.5 Changing Variables in the Variable Editor
Use
The variable editor dialog box offers all of the selection options for changing an existing variable.
Procedure
The individual fields of the dialog box reflect the steps in the variable wizard and show the current settings in the variable. Depending on the type of variable and
the processing type (context-sensitive), only the relevant fields and settings are shown.
Make the required changes and choose OK .
If you want to make the changes using a step-by-step process with explanatory texts, you can jump to the variable wizard using . For
more information, see
Defining Variables with the Variable Wizard.
Result
You have changed the variable. The changed variable can now be used in all queries.
!--a11y-->
1.3.6 Examples for Using Variables
In this section you can find examples for using variables.
Examples for Offset Variables
You want to use a query to carry out a comparison of two years.
Year Comparison
You want to compare the costs of a year of your choice with the costs of the previous year.
1. In the Query Designer, create a new structure and add a new Selection for each year that you require.
2. Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection.
3. Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR):
Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard
appears.
If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic).
4. Move the defined characteristic value variable into the selection.
5. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
a. Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
b. Enter –1 as the offset and choose OK.
6. Choose OK .
7. Enter a description.
Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See
Using Text Variables.
When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic
with display as key.
8. Create a second selection with the same characteristic value variable and do not set an offset here.
Also use a text variable in the description in this case.
9. Move the required characteristic into the rows.
10. Save the query.
After execution, the query should appear as follows:
Variable screen entry: 2002 (or no entry when using the SAP Exit Variable).
Year Comparison
A characteristic Revenue 2001 Revenue 2002
Value 1 100.000 90.000
Value 2 200.000 180.000
Value 3 300.000 400.000
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 35 of 62
… … …
Comparison with Cumulative Previous Year Period
For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year.
1. Create a new structure in the Query Designer and add a new Selection.
2. Move a key figure, for example, Revenue, into the selection.
3. Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER):
Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears.
Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year. If you set the variable as entry-ready in
the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary.
4. Move the characteristic value variable, such as OFPER, into the selection.
5. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
6. Under Selection, choose Value Area and choose the tab page Variables.
7. Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval.
8. Select the characteristic value variable and from the context menu, choose Enter Variable Offsets.
a. As an offset, enter -3 as the from value and 0 as the to value. Choose OK.
b. Choose OK .
9. Enter a description, such as Revenue for current year.
10. Choose OK .
11. Select the selection and from the context menu, choose Copy and then Paste.
12. Now select the second selection and from the context menu, choose Edit.
13. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict.
14. Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets.
a. As an offset, enter -15 as the from value and -12 as the to value. Choose OK.
b. Choose OK .
15. Enter a description, for example Revenue for previous year.
Also use a text variable in the description in this case.
16. Choose OK .
17. Move the required characteristic into the rows.
18. Save the query.
After execution, the query should appear as follows:
Variable screen entry: 01. 2002 to 08. 2002
Comparison with Cumulative Previous Year Period
A characteristic Revenue 01. – 08. 2001 Revenue 01. – 08. 2002
Value 1 100.000 90.000
Value 2 200.000 180.000
Value 3 300.000 400.000
... ... ...
Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an
offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example
for Variable Replacement.
Comparison of Cumulated Values for Two Years
You may want to compare the cumulated values up to the current period of the current year with those of the previous year.
For this example, use the variable 0FPER ( current fiscal year period) and the variable 0P_FPER ( your chosen fiscal year period). You use these two
variables to set the interval limits.
1. In the Query Designer, create a structure with two selections:
¡ 1. selection: Cumulative Amount for current year
¡ 2. selection: Cumulative amount for previous year
2. With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it.
3. Choose Restrict from the context menu (right mouse click) .
4. Choose Value Area between as the selection and go to the tab page Variables.
5. Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the
current period.
6. Define the second selection (cumulative amount for previous year) and proceed as for the first selection.
¡ Add the variable 0P_FPER as the from value and variable 0FPER as the to value here.
¡ Set an offset of –12 for both the from and the to values:
Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each.
The result is an interval that has been moved 12 periods ahead.
7. Add the key figures and additional characteristics for the query.
After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year.
You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default
value (for example, 001.2001 for 2001). You only have to change this value once per year.
You have now defined a query that compares the cumulative values for two years.
The variables with SAP Exit delivered by SAP have the following behaviors:
Variable 0FPER ( current fiscal year period): Displays the values of the current fiscal year period.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 36 of 62
Variable 0P_FPER ( any fiscal year period ): Displays the values of any fiscal year period. You can set the fiscal year period in the variable
screen when executing the query in any way you require.
Variable 0FYTCFP ( fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current
fiscal year.
Variable 0FYTLFP ( fiscal year up to previous fiscal year period ): Displays the values of the first period up to the previous period (current period
–1).
You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years. When using
the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12.
!--a11y-->
1.4 Query Properties
Use
You can make various settings for your query in the Query Properties dialog box.
Features
The Query Properties dialog box is divided into three tab pages, each covering different settings.
Tab Page: General
Technical Name
The technical name of the query is displayed.
InfoProvider
This is where the technical name of the InfoProvider, on which the query is based, is displayed.
Description
You can enter or change the query description here.
You can use Text Variables in the description.
You can also enter the query description when you save the query.
Key Date
Each query has a key date. For time-dependent data, the key date determines the time for which the data is selected. The default key date value is the date on
which the query is executed, that is < Today>.
1. Choose . The Date Selection dialog box appears.
2. Choose a date from the calendar and use the arrow button to add it to the selection window on the right. If you select 01.01.1999 for example, time-dependent
data is read up to 01.01.1999.
3. Choose OK .
You can also select a variable key date:
1. In the Date Selection dialog box, choose the Variables tab page.
2. Choose a variable and use the arrow button to add it to the selection window on the right.
In the selection, you may need to know the technical names of the queries as well as their descriptions. In the Description window on the left
hand side, choose Technical Names from the context menu (secondary mouse click) .
If you want to create a new variable, in the Description window on the left-hand side, choose New Variables from the context menu (secondary mouse
click). The Variable Wizard dialog box appears, where you can create new variables .
If you want to change a variable, in the Description window on the left-hand side, select the variable and choose Change Variable from the context menu
(secondary mouse click). The Variable Editor dialog box appears, where you can change variables .
3. Choose OK .
The key date only applies to time-dependent master data.
Sequence of Entry Variables
Any entry variables the query contains are listed here. You can use the two arrow buttons to the right of the field to determine the sequence in which the variables
appear in the variable screen when executing the query.
Last Changed
This is where you can see details of the owner of the structure, the person who last changed the structure, and the corresponding date and time that the query was
changed.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 37 of 62
Tab Page: Display
Display Options
The following settings are possible:
· Adjust format after refresh
The setting is useful in the BEx Analyzer and is the default setting.
Formatting for the query underlines the type of data contained in a cell, highlighting the structure of the delivered results. As a rule, the position and size of the
cell area in the results area of the query changes when the query is refreshed. The function Adjust Format After Refresh guarantees that the format is
adjusted after the updated query data is refreshed.
You can deactivate the function for adjusting the format, for example, if you want to display the data more quickly, or if you use a workbook with your own
format template.
For more information, see Formatting
· Suppress repeated key values
Here you can determine whether or not identical key figures are to be displayed in duplicate in the query. The setting Suppress Identical Key Values is
active by default, so that only the first key value is displayed for each characteristic and additional, identical key values are suppressed.
The key value is the value with which the characteristic is presented. This can be the characteristic description or the characteristic key. You can
determine how the characteristic is to presented in the Characteristic Properties.
In the following example, the Suppress Identical Key Values is activated:
Region Order Sales
DE A 14,900 EUR
B 15,800 EUR
C 17,600 EUR
USA A 12,800 EUR
C 32,800 EUR
In the following example, the Suppress Identical Key Values is deactivated:
Region Order Sales
DE A 14,900 EUR
DE B 15,800 EUR
DE C 17,600 EUR
USA A 12,800 EUR
USA C 32,800 EUR
· Display Scaling Factors for Key Figures
Key figures can have scaling factors and units/currencies. Normally, units/currencies are displayed for every key figure, but not the scaling factors. If you
activate the Display Scaling Factors for Key Figures, an additional header row is added to the row or column header. Information about the scaling factor and
currency/unit appears in this additional header row, as long as it is consistent (for example, 1,000 EURO).
This setting is deactivated by default.
In the following example, the Suppress Identical Key Values and Display Scaling Factors for Key Figures is activated:
Region Order Sales
1,000 EUR
DE A 14
B 15
C 17
F D 12
E 32
· Display document links
For metadata, master data, and InfoProvider data for a query, you can display links to Documents that you have created for these objects. If documents
exist for these objects, the symbol appears next to these objects. If you click on this symbol, you jump to where the document is displayed on the Web.
Highlight the appropriate setting so that the document links for the desired document class are displayed. The document classes are oriented to the various
categories of BW objects. InfoProvider data, metadata and master data. See Document Classes.
For more information, see Using Documents in Web Applications.
· Display Drag&Relate links
When activating this setting, the symbol appears alongside the Drag&Relate-enabled InfoObjects in a Web application that serve as DataProviders for
this query. This setting is necessary for you to be able to recognize Drag&Relate-enabled InfoObjects in an Enterprise Portal and to use the Drag&Relate
function. For more information about the Drag&Relate function, see Drag&Relate with BW Content in the Enterprise Portal.
Number Display
The following settings are possible:
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 38 of 62
· Results position
This is where you determine where the result is displayed.
- Bottom (for rows) right (for columns) (=default setting)
- Bottom (for rows) left (for columns)
- Top (for rows) right (for columns)
- Top (for rows) left (for columns)
· +/- sign display
Here you determine how the minus sign is displayed. The following display options are available for negative values:
- -X = the minus sign is positioned before the value (=default setting)
- X- = the minus sign is positioned after the value
- (X) = negative values are displayed in parentheses
· Display zeroes
The following display options are available for displaying zeroes:
- Display Zeroes: Zeroes are displayed with the currency/unit, for example 0,00EUR. This is the default setting.
- Zeroes without Currency/Unit: Zeroes are displayed without a currency or unit entry, that is, 0,00.
- Do Not Display Zeroes: Cells containing a zero value remain empty.
- Display Zeroes As...: Choosing this setting activates the Display Zeroes As field. You are now able to enter the required value (character, number or
letter), for example *. The cells containing a zero value are filled with this value.
Suppressing zeroes
You can use this setting to determine whether columns or rows containing zeros are to be displayed.
The following options are available to you under Suppression :
· No : Rows or columns with zeroes are displayed.
· Active : If characteristics are in the rows and columns, every row or column that has a result of zero is not displayed. The rows or columns include, for
example, the values 1, -1, 1, -1 and thus the result is 0. If you select this setting, the whole row or column is not displayed.
· Active (all values = 0): Columns or rows containing zero values in all cells are not displayed.
Under Effect on , define whether suppression of zero values should be applied to rows and columns, only to rows or only to columns.
Tab Page: Specific
Release for OLE DB for OLAP
External reporting tools that communicate using the OLE DB for OLAP interface use queries as data sources. If you want to release this query as a data source for
external Reporting tools, select Allow External Access to this Query.
Note: Queries containing formulas with the operators %RT, %CT, %GT, SUMRT, SUMCT, SUMGT, and LEAF cannot be released for OLE DB for
OLAP. These operators are dependent on how the list is displayed in the BEx Analyzer and the formulas return unexpected values when using
OLE DB for OLAP or MDX. You may be able to obtain the required result by selecting constants. For more information, see Selecting
Constants.
For more information about using formula operators, see Defining Formulas.
For more information about OLE DB for OLAP, see Mapping Metadata.
Document Pushbutton
You can use the Documents button to get to the available documents that relate to the query in the Administrator Workbench. You can also create new
documents for the query here.
For more information, see Documents and Creating Documents .
Activities
You call up the properties dialog box for a query by clicking on Query Properties in the Query Designer toolbar.
!--a11y-->
1.5 Properties of Query Components
Use
The various components of a query have specific properties that depict important functions.
Features
The following dialogs are available to set properties of query components:
· Characteristic Properties
· Attribute Properties
· Structure Properties
· Selection/Formula Properties
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 39 of 62
· Restricted Key Figure Properties
· Calculated Key Figure Properties
Activities
You call up the properties dialog box in the Query Designer from the context menu of a component of the query. Place the cursor over a query component, click
the secondary mouse button and choose Properties.
!--a11y-->
1.5.1 Characteristic Properties
Use
You can set a range of functions in the Characteristic Properties dialog box for a specific characteristic, such as order type. These settings then affect all key
figures for this characteristic in a query drilldown.
Features
Description
The name of the characteristic appears automatically here. You can overwrite this text. The new text is different to the text provided in the InfoObject maintenance
and is used in the query display.
Technical name
The technical name of the characteristic is displayed here.
Display as
You can determine here whether and in which format you want to present the individual characteristic values of the characteristic.
· (Standard) : The standard display type for characteristic values corresponds to the setting in InfoObject maintenance under Tab Page: Business Explorer.
· No Display : The characteristic display is hidden. This function is useful, for example, with the Currency/Unit characteristic since the currencies are also
shown in the key figures.
· Key and Text : The characteristic values are shown by their technical key and by their text.
· Text : The characteristic values are shown by their text.
· Key : The characteristic values are shown by their technical key.
· Text and Key : The characteristic values are shown by their text and by their technical key.
Once you have made a setting in display type that contains text, you can select which text type you want to set in the dropdown box below. The following options
are available:
· Standard: The shortest available text for the characteristic values is used as the text .
· Short text: The short text for the characteristic values is used as the text .
· Long text: The long text for the characteristic values is used as the text.
· Medium Text: The medium text for the characteristic values is used as the text.
In the dropdown box for display type, the system offers the setting options as follows:
§ (Standard), No Display and Key are always offered.
§ Key and Text, Text, Text and Key are offered additionally if any text (short, medium or long) was created for this characteristic.
In the dropdown box for text type, the system offers only those texts for selection that were created in the InfoObject Maintenance for the
Characteristic. See Tab Page: Master Data/Texts.
Results Display
Suppress Results Rows
Here you can choose whether to suppress the results rows Never, Always or Only for One Value. Only for One Value means that only those results rows are
suppressed that aggregate only one value, that is, the value and the result are identical and the results row repeats the same value.
Normalize to
You can set the normalization for a specific characteristic here. The display affects the key figures displayed in the drilldown by displaying the query data as
normalized for the relevant result that you chose for the normalization. That is, the percentage display in relation to the result is displayed. The normalization
process refers to a particular characteristic each time, and has various independent settings for each characteristic.
Normalization for the characteristic only has an effect when the characteristic is in the drilldown.
You can choose from the following settings:
You can choose whether and for which result you want to normalize the values for this characteristic.
· No Normalization
· Result
All values are normalized to the result. The result equals the total result if there is only one characteristic in the drilldown.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 40 of 62
· Overall Result
All values are normalized to the overall result. If there are several characteristics in the drilldown, there are different results that are combined to form an
overall result.
· Query Result
All values are normalized to the query result. Each key figure for a query has a query result. This is the result of the key figure that results from the
aggregation of all characteristics for the query.
The overall result and the query result are identical, providing that none of the characteristics are in the filter.
The values of the results row and the overall results row are not displayed as percentages, but as absolute values.
Since the function Normalize to affects all key figures here, unwanted results are often delivered. To avoid this, we recommend that you set the
Normalize to function for each key figure. For more information, see Calculate Single Values As....
Cumulated
If you choose this function, the system sorts the list in ascending order according to key. All the structure elements (key figures) are subsequently aggregated to
the n+1 characteristic value, one after the other, for each of the n th characteristic values. With time characteristics, the missing characteristic values are
included wherever necessary.
The following example illustrates the concept of Cumulated function:
Values Cumulated Values
1 1
2 3
3 6
4 10
If you subsequently choose a different sorting method for this function, the numbers become difficult to make sense of.
Do not use the cumulated display function with more than one characteristic.
Since the function Cumulated affects all key figures here, unwanted results are often delivered. To avoid this, we recommend that you set the
function Cumulative for each key figure. For more information, see Calculate Single Values As....
Sorting
Here you can set the sorting within the characteristic according to the Key or Name in Ascending or Descending order.
If a characteristic has attributes, you can sort the characteristic by attribute. The attribute involved does not have to be chosen for the display.
You want to sort your articles according to specific criteria. To do this, you create an attribute for the Article characteristic that contains these
criteria and you can now sort the articles by this attribute.
By default, the values are sorted as they are defined in the query definition. If you have not specified a filter value in the query definition, the system sorts the
values according to the key.
Presentation hierarchy
You can present the characteristic hierarchically. Choose to select a hierarchy. The hierarchy is flagged automatically as an active presentation hierarchy.
When you deactivate the Active selection box, the characteristic is displayed in the query not as a hierarchy but as a basic list.
If you restrict the characteristic to a hierarchy node, the node hierarchy is adopted automatically as the presentation hierarchy. You can deactivate
the presentation hierarchy here if necessary.
You can set the sorting within the hierarchy according to the Key or Name in Ascending or Descending order. If you do not make any entries, the values are
sorted as determined in the hierarchy.
Each hierarchy has certain properties that you specify in the hierarchy definition. You can override the following hierarchy properties for the current hierarchy:
· Expand to level
In the column B (user settings), select the checkbox and enter a numerical value for the hierarchy level that you want to expand the hierarchy to.
· Position of lower-level nodes
In column B (user settings), select the checkbox and choose whether you want to position lower-level nodes Down or Up . Choose Up if, for example, you
want to see the overall result at the bottom.
· Values of posted nodes
In column B (user settings), select the checkbox and choose whether you want to Display or Suppress the values of posted nodes.
In hierarchies, nodes always display the aggregated values of the subordinate nodes and leaves. If a node has a posted value, you cannot see this. To
display this posted value, an additional leaf is inserted that has the same name as the node. This leaf displays the value posted to the node.
In the following example, you can see that for cost center A1, an additional leaf has been inserted and that the value of cost center A1 itself,
namely 10, is displayed. This additional leaf does not exist in the hierarchy. You can display or suppress this leaf (with the value of the posted
node).
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 41 of 62
· Nodes with only one lower-level node
In column B (user settings), select the checkbox and choose whether you want to Display or Suppress the values of nodes with only one lower-level node.
Suppressing nodes with only one lower-level node helps you to reach the more detailed information quickly.
In the following example, Cost Center A and Cost Center A.1. contain the same information since Cost Center A has only one lower-level node
in the hierarchy. If you are interested in the detailed data for the individual cost centers, you can suppress the uppermost node with only one lower-
level node as this does not contain any additional information.
Activities
Drag a characteristic into a directory in the Query Designer (rows, columns, free characteristics or filter), select it and, from the context menu, choose Properties.
You get to the Characteristic Properties dialog box.
!--a11y-->
1.5.2 Attribute Properties
Use
You can set display functions in the Attribute Properties dialog box for a specific attribute for a characteristic.
Features
Description
The name of the attribute appears automatically here. You can overwrite this text. The new text is different to the text provided in the InfoObject maintenance and is
used in the query display.
Display As
You can determine here whether and in which format you want to present the individual attribute values of the attribute.
· (Standard) : The standard display type for attribute values corresponds to the setting in InfoObject maintenance under Tab Page: Business Explorer.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 42 of 62
· No Display : The attribute display is hidden.
· Key and Text : The attribute values are shown by their technical key and by their text.
· Text : The attribute values are shown by their text.
· Key : The attribute values are shown by their technical key.
· Text and Key : The attribute values are shown by their text and by their technical key.
Once you have made a setting in display type that contains text, you can select which text type you want to set in the dropdown box below. The following options
are available:
· Standard: The shortest available text for the attribute values is used as the text.
· Short text: The short text for the attribute values is used as the text.
· Long text: The longest text for the attribute values is used as the text.
· Medium Text: The medium text for the attribute values is used as the text.
In the dropdown box for display type, the system offers the setting options as follows:
§ (Standard), No Display and Key are always offered.
§ Key and Text, Text, Text and Key are offered additionally if any text (short, medium or long) was created for this attribute.
In the text type dropdown box, the system offers only those texts for selection that were created for this attribute in the InfoObject maintenance.
See Tab Page: Master Data/Texts.
Technical name
The technical name of the attribute is displayed here.
Activities
Select an attribute for a characteristic and choose Properties from t he context menu (secondary mouse click). You get to the Attribute Properties dialog box.
!--a11y-->
1.5.3 Structure Properties
Use
In the Structure Properties dialog, you can change the description of a structure and get information on the technical name and the last changes made to the
structure.
Features
Technical name
If the structure has been saved as a reusable structure, the technical name of the structure is displayed here and you can no longer change it.
You can enter a technical name for local structures. However, this is optional.
Note that the technical name must be unique across all queries.
For access from external interfaces (such as Crystal Reports, from URLs or using OLE DB for OLAP), a technical name is necessary for
structures, since the structure is considered a table field and has to be uniquely accessible. If you do not enter a technical name, the unique ID
(UID) is used for access from external interfaces for uniquely identifying the structure. However, the UID has 25 characters, which can lead to
problems when you change queries.
You can change the technical name. When you do so, a warning appears that tells you that when you use the structure in external interfaces, the references can
be destroyed.
Description
The name of the structure appears automatically here. You can overwrite this text.
Applying zero row/column suppression to this structure also
If you made a setting for zero row/column suppression in the query properties, this setting is not transferred automatically to the structures that you use in the
query. If you do not want to suppress rows or columns that contain zeros for this structure, select Also Apply Zero Row/Column Suppression to This Structure.
For more information about the setting options for Suppressing Zero Rows/Columns , see Query Properties.
Last changed
This is where you can see details of the owner and person who last changed the structure, as well as the corresponding data and time that the structure was
changed. This information can be useful since structures deal with reusable objects.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 43 of 62
Activities
Select the structure and choose Properties from t he context menu (secondary mouse click). The Structure Properties dialog box appears.
!--a11y-->
1.5.4 Selection/Formula Properties
Use
In the dialog box Selection/Formula Properties for a structural component, you can set a range of functions. This setting is valid for the structural component,
irrespective of whether the structural component is in the rows or columns.
Features
Technical Name
You can enter a technical name for the structural component. However, this is optional.
Note that the technical name must be unique across all queries.
Access from external interfaces (such as Crystal Reports, from URLs or using OLE DB for OLAP), a technical name is necessary for structural
components, since the structural component is considered a table field and has to be uniquely accessible. If you do not enter a technical name,
the unique ID (UID) is used for access from external interfaces for uniquely identifying the structural component. However, the UID has 25
characters, which can lead to problems when you change queries.
You can change the technical name. When you do so, a warning appears that tells you that when you use the structural component in external interfaces, the
references can be destroyed.
Description
The name of the key figure, the restricted key figure (selection) or the formula appears here automatically. You can change the description here.
In contrast to characteristics and attributes, structural components can contain several rows as the description.
The total number of all characters in all rows, including the line-end character is restricted to 60 characters.
You can use Text Variables in the description.
Layout
Highlighting
Here you can choose whether you want to highlight the selection or formula. The type of highlighting depends on the style used in the BEx Analyzer or in the Web
application.
Hiding
Here you can adopt the following settings to hide the selection or formula:
· If you choose Always Show then the selection or formula is always visible.
· If you chose Hide (can be shown) then the selection or formula is hidden in the report executed, but can be shown there again in future.
This setting is useful for displaying only the necessary information in the start view of the report. You can show additional details if required.
You can show the selection or formula in the report executed in the following ways:
¡ in Web applications under Select Filter Value
¡ in the BEx Analyzer under Selecting Filter Values and Changing Queries (local view)
· If you choose Always Hide , the selection or formula is not displayed.
You can use this setting for help columns that are not visible in the report executed and can also not be shown.
Selecting constants
Moreover, you can mark a selection as constant here. This means that the selection cannot be changed by navigation or filtering for the runtime and can therefore
be used as a reference size. For more information, see Selecting Constants.
Number Display
You can set a scaling factor of 1 to a billion. If, for example, you set 1,000, the value 3,000 is shown in the report as 3.
You can set the number of decimal places. The number can have either no decimal places or up to nine decimal places (0, 0.0, 0.00... to 0.000000000).
The standard settings for the scaling factor and the number of decimal places correspond to settings that you have made in the InfoObject
maintenance under Tab Page: Additional Properties Also see Priority Rule with Formatting Settings
Select Reverse +/- Signs if you want to display the numbers as negative values. A positive number receives a minus as a sign (for example, 85 becomes –
85) or a negative number receives a plus (for example, -38 becomes +38).
The reversal of plus and minus signs is purely a display function. If, for example, the key figure is added to a formula, it is calculated with its
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 44 of 62
correct values.
See also:
Priority Rule with Formatting Settings
Calculations
You use this function to recalculate the results rows and single values that are displayed in the query according to particular criteria.
Calculate Results As...
Calculate Single Values As...
Cumulated
You use this function to cumulate the individual cells in an area. The first value is added to the second value, the result is added to the third value, and so on. In
the columns, the cells are cumulated from top to bottom, and in the rows, the cells are cumulated from left to right. With blocks of single values, that is, a drilldown
in both the rows and the columns, the values are cumulated from top to bottom and from left to right.
Be careful that cumulation only operates with characteristic values and not with the structural elements of a characteristic structure. The
Cumulated function is only effective if you have a characteristic instead of a characteristic structure in the drilldown. However if you have two
structures – the key figure structure and a characteristic structure – then you cumulate using cell-specific definitions. See Defining Exception
Cells
Calculation direction
Default calculation directions are not always as expected. You can change the calculation direction as required:
· Use the default direction (from top to bottom and from left to right)
· Calculate along the rows (from top to bottom)
· Calculate along the columns (from left to right)
The Calculate along the columns setting is useful, for instance, for all queries for which a time dimension is drilled down in the columns, and a
cumulated output is to be created. This is shown in the following example query:
Also apply to results
You can also use the chosen recalculation on the results rows under Calculate Results as... or Calculate Single Values as...
Note that you cannot use the following functions for hierarchy lists (for active display hierarchies), and they do not work for the characteristic with
the hierarchy.
- Calculate ® Result as
- Calculate ® Single Value as ® Ranked list / Ranked list (Olympic)
- Calculate ® Cumulated
Currency Translation
The Currency Translation function is not offered in the formula properties dialog box.
You create translation keys for Currency Translation under SAP Menu ® Administration ® Settings ® Translation Keys. For more information, see
Creating Currency Translation Keys.
You can set a target currency for a structural component in the Query Designer.
Select a translation key in the Translation Key dropdown box. According to how the currency translation key has been created, you have the following options:
· Select the target currency when translating
The target currency is not fixed in the translation key but can be determined when translating. Select the required translation key and enter the Target
Currency in the dropdown box. You can also select a currency from the dropdown box.
Moreover, you can also select, create or change a variable target currency.
a. Select Variables Entry. The variable target currencies appear in a dropdown box.
b. Select a variable.
§ You can change the variable using . The Variable Editor dialog box appears. For more information, see Changing Variables in the Variable
Editor.
§ Choose if you want to create a new variable target currency. The Variables Wizard dialog box appears. For more information, see Defining
Variables with the Variable Wizard.
When you execute the query, the variable dialog box appears, in which you can choose the target currency.
· Fixed target currency
The target currency was determined the translation key. Select the required translation key with the fixed target currency. In the Target Currency dropdown
box, the fixed target currency for this translation key appears.
· InfoObject determines target currency
The target currency is determined in the translation key so that it is determined from an InfoObject. Select the required translation key with the target currency
from the InfoObject.
· Target currency from variable
A variable for 0CURRENCY was specified in the translation type. In the Target Currency field, when this translation type is selected, the text from variable
appears.
You can find additional information on currency translation under Currency Translation in the Business Explorer.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 45 of 62
Formula Collision
The Formula Collision function is offered ONLY in the formulas property window.
When you define two structures, which both contain formulas, it is unclear to the system how to calculate the formulas at the point where both formulas intersect.
The following example clarifies the concept of formula collision:
Column 1 Column 2 Column 1 x Column 2
Row 1 Value A Value B A x B
Row 2 Value C Value D C x D
Row 1 + Row 2 A + C B + D ? Formula Collision?
In this example, there are two rows and two columns with simple values, the third row is a simple summation formula and the third column is a
simple multiplication. In the cell in which the row and column formulas meet, it is not clear which calculation should be made.
If you calculate according to the column formula in this cell, the cell contains (A+C)x(B+D). If you calculate according to the rows formula in this
cell, the cell contains (AxB)+(CxD). The result gives a different value.
If a formula collision occurs, as described in the example above, you can determine which formula is used in the calculation. You can make the following settings
in the Formula Collision field:
· Nothing defined
If you do not make a definition, the formula that was set last takes priority in a formula collision. Setting means that you defined and saved the formula.
· Result of this formula
The result of this formula has priority in a collision
· Result of competing formula
The result of a competing formula has priority in a collision
Collisions always occur when point and dash calculations or functions are mixed in competing formulas. If there is only dash calculation or point
calculation in both formulas, both calculation directions give the same result. Therefore, no settings are required for formula collision.
Activities
Select the structural component and choose Properties from t he context menu (secondary mouse click). The Selection/Formula Properties dialog box appears.
!--a11y-->
1.5.5 Restricted Key Figure Properties
Use
In the Properties of the Restricted Key Figure dialog box, you can set a range of functions.
Features
Technical name
The technical name of the restricted key figure is displayed.
Description
The name of the restricted key figure appears automatically here. You can change the description here.
The total number of all characters in all rows, including the line-end character is restricted to 60 characters.
You can use Text Variables in the description.
Number display
You can set a scaling factor of 1 to a billion. If, for example, you set 1,000, the value 3,000 is shown in the report as 3.
You can set the number of decimal places. The number can have either no decimal places or up to nine decimal places (0, 0.0, 0.00... to 0.000000000).
Currency translation
You create the translation types for currency translation in the Administrator Workbench. For more information, see Creating Currency Translation Keys.
You can set a target currency for a restricted key figure in the Query Designer.
Select a translation key in the Translation Key dropdown box. According to how the currency translation key has been created in the Administrator Workbench,
you have the following options:
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 46 of 62
· Select the target currency when translating
The target currency is not fixed in the translation key in the Administrator Workbench but can be determined when translating. Select the required translation
key and enter the Target Currency in the dropdown box. You can also select a currency from the dropdown box.
Moreover, you can also select, create or change a variable target currency.
a. Select Variables Entry. The variable target currencies appear in a dropdown box.
b. If you want to use an existing variable, select a variable. You can change the variable using . The Variables Editor dialog box appears. For more
information, see Changing Variables in the Variable Editor.
c. If you are want to create a new target currency variant, choose Create. The Variables Wizard dialog box appears. For more information, see Defining
Variables with the Variable Wizard.
When you execute the query, the variable dialog box appears, in which you can choose the target currency.
· Fixed target currency
The target currency is determined in the translation key in the Administrator Workbench. Select the required translation key with the fixed target currency. In
the Target Currency dropdown box, the fixed target currency for this translation key appears.
· InfoObject determines target currency
The target currency is determined in the translation key in the Administrator Workbench so that it is determined from an InfoObject. Select the required
translation key with the target currency from the InfoObject.
Last changed
This is where you can see details of the owner and person who last changed the restricted key figure, as well as the corresponding date and time that the
restricted key figure was changed. This information can be useful since restricted key figures are reusable.
Activities
Select the restricted key figure and choose Properties from the context menu (secondary mouse click). You reach the Properties of the Restricted Key Figure
dialog box.
!--a11y-->
1.5.6 Calculated Key Figure Properties
Use
In the Key Figure Properties dialog box, you can make settings for a range of functions for a calculated key figure.
Features
You can select the following functions in the Selection/Formula Properties dialog box:
· Description
· Layout
· Number Display
· Calculations
· Currency Translation
For more information about these functions, see Selection/Formula Properties.
In addition, you can select the following functions in the Key Figure Properties dialog box.
Last Changed
This is where you can see details of the owner and person who last changed the structure, as well as the corresponding data and time that the key figure was
changed. This information can be useful since calculated key figures deal with reusable objects.
Aggregation Behavior
In the Key Figure Properties dialog box, choose Enhance >>. The Aggregation Behavior field is added to the dialog box.
You can make settings for the aggregation of the calculated key figure and the time that the calculated key figure is calculated here. Depending on the complexity
of the formula, you can select various settings in the enhanced properties of the calculated key figure. The following types of calculated key figures with the
corresponding formula complexity are available:
· Assignment
A formula has the complexity Assignment if it has the form = operand (for example, =invoicedquantity), where the operand consists of a basic key figure.
Formulas with the complexity Assignment are used to change the aggregation behavior of the key figure (for example, the key figure is aggregated to the
total, but you want to have the average).
The Aggregation field is visible but not ready-for-input. The Exception Aggregation field is visible and ready-for-input. The standard value for both of these
fields is made up of the values from the corresponding fields in the source key figure. You can change the exception aggregation.
You can select the following settings in the Exception Aggregation field.
- Summation
- Maximum
- Minimum
- Exception, if more than one record occurs
- Exception, if more than one value occurs
- Exception, if more than one value <> 0 occurs
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 47 of 62
- Average of all values
- Average of all values <> 0
- Average for calendar days
- Average for working days
- Count all values
- Count all values <> 0
- First value
- Last value
- Standard deviation
- Variance
You can find additional information about the setting options for exception aggregation in the documentation for InfoObject maintenance under Tab Page:
Aggregation.
If the fields Aggregation and Exception Aggregation have the same setting, the field Reference Characteristic for Exception Aggregation is empty and not
ready-for-input.
If the fields Aggregation and Exception Aggregation have different settings, you have to specify the reference characteristic for the exception aggregation.
· Simple
A formula has the complexity Simple if it is made up exclusively of operands with the same aggregation, where the operands basic key figures, constants
or calculated key figures can have the complexity Simple (for example, profit=sales minus revenue).
In the Time of Calculation field, you can choose whether the formula is calculated After Aggregation or Before Aggregation.
If you choose to calculate the formula before aggregation, this usually leads to bad performance as a large amount of data (single records) has to
be calculated. Often in formula calculations, the single record information for only one or two specific characteristics is required and the rest of the
InfoProvider data can be aggregated
Therefore, we recommend that you use a formula variable that is replaced with the attribute Reference to Characteristic (Constant 1). Using this
attribute, the reference to such a characteristic, which is not to be aggregated, can be created. The attribute Reference to Characteristic (Constant
1) is available for each characteristic.
If you use such a variable in a formula (instead of in a calculated key figure), it is replaced with a 1 but this has no effect on the aggregation
behavior since formulas are always calculated after aggregation.
For more information about formula variables and replacing them with attribute values, see Replacement Path: Replacement with a Characteristic
Value and Calculating with Variables for Processing Type “Replacemnt Path”.
Example of replacement with a constant attribute:
There are purchase orders in the InfoCube on a document line level with the key figures Quantity and Price (for each document line). You want
to see the sales order value of a purchase order. To do this you have to calculate the quantity x price for each document line.
If you define a calculated key figure Quantity x Price x &REFVAR& , where &REFVAR& represents the reference to the characteristic Purchase
Order , the OLAP processor can aggregate all other dimensions first of all (for example, customer, period) and then make the calculation for each
purchase order. This means that performance is considerably improved than when single records are calculated first and then aggregated.
· Complex
All other types of formula have the complexity Complex and are always calculated after aggregation.
The different options for aggregation settings are not ready-for-input and the time of calculation is set at After Aggregation .
Most formulas are complex and are therefore calculated after aggregation.
Activities
In the InfoProvider objects dialog box, select a calculated key figure and from the context menu, choose Properties. You reach the Calculated Key Figure
Properties dialog box.
!--a11y-->
1.6 Defining Conditions
Use
You can formulate conditions in the query designer to make data analysis more efficient. In the results area of the query, the data is filtered according to the
conditions so that only the part of the results area that you are interested in is displayed.
You can find additional information about the scope of functions for conditions under Conditions.
Procedure
¡ Choose New Condition . (You can find this menu entry in the Query Designer toolbar under to the right of Condition ). The Define Condition dialog
box appears.
¡ Specify a name for the condition in the Description field.
If you only want to define the condition and not execute it actively in the query, remove the check from the active , which was set by default.
¡ You now have the following options:
- If the condition lines below are to be evaluated independent of one another for all of the characteristics in the drilldown and you want to use the same
condition for multiple characteristics of the query, select Evaluate Conditions Below for All Characteristics in the Drilldown Independently .
This setting allows you to apply a condition in a very general way. Depending on which characteristics you use in the drilldown, you will obtain varying
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 48 of 62
This setting allows you to apply a condition in a very general way. Depending on which characteristics you use in the drilldown, you will obtain varying
results.
Characteristics that are already used in an active condition for characteristic combinations are excluded from these.
You can find more information under Ranked List Condition: Top 5 Products and Ranked List Condition for All Characteristics in Drilldown Independent:
Top 3 Products and Top 3 Sales Channels.
¡ If you want to evaluate the condition for certain drilldowns of defined characteristics or characteristic combinations, in the field Evaluate the Conditions
Below for Single characteristics or Combinations of Characteristics . You can then make entries in the list of characteristics used in the
queries in rows, columns, or free characteristics.
i. If you only want to evaluate the condition when a certain characteristic is present in the drilldown, select this characteristic.
ii. If you want to evaluate the condition for characteristic combinations, select multiple characteristics. You can find more information under Ranked List
Condition for Characteristic Combination: Top 3 Combinations of Product and Sales Channel.
¡ In the field Display all values for which at least one of the following conditions applies , enter one or more condition rows into the list. See
Conditions/Exceptions: Add, Change, Delete Rows
A condition row is always derived from the determination of an element for every structure used in the query (usually one or two structures), an operator, and a
value that matches the operator.
You can choose from the following operators for threshold conditions:
- Is equal to
- Is not equal to
- Is less than
- Is greater than
- Is less than or equal to
- Is greater than or equal to
- Is between (is in the interval)
- Is not between (is not in the interval)
These operators demand a floating point number as a value. For the operators is in interval and is not in interval , you must enter a value area, that is, a
lower and an upper threshold value.
You can choose from the following operators for ranked list functions:
¡ Top N
¡ Bottom N
¡ Top percent
¡ Bottom percent
¡ Top sum
¡ Bottom sum
You can find additional information about using operators for range lists under Conditions.
For Top/Bottom N you must enter a whole, positive number as the value. For Top/Bottom percent enter a number between 0 and 100. For Top/Bottom
sum you can also enter a floating point number (for example, 15.7).
The format depends on the country setting in the operative system.
The following convention makes it easier to handle numbers with many zeros:
An apostrophe after the number means multiplied by one thousand, a quotation mark means multiplied by one million, and three apostrophe
marks means multiplied by one billion, for example 1.5” = 1.5 mil = 1,500,000.
You can also use formula variables as the reference value of the condition:
b. Select the variable entry. The formula variables that are available appear in the dropdown box.
c. Select a variable.
§ You can change the variable using Change Variable . The Variable Editor dialog box appears. You can find more information under Changing
Variables in the Variable Editor.
§ If you want to create a new formula variable, select New Variable . The Variables Wizard dialog box appears. You can find more information
under Defining Variables with the Variables Wizard.
When you execute the query, a Variables dialog box appears, in which you can choose the value limit of the condition.
A group of condition rows is logically linked with OR. This means that at least one of the condition rows has to be fulfilled for the entire condition to
be true. See Ranked List Condition with Two Condition Rows: Top 2 Products and Bottom 2 Products.
¡ Choose OK . This takes you back to the query definition.
¡ Choose Save.
Changing a Condition
1. Choose Change condition. (You can find this menu entry in the Query Designer toolbar under to the right of Condition ). The dialog box for conditions that
have already been defined appears.
2. Choose the condition you want to use, and then choose OK . You get to the dialog box Defining conditions , where you make any changes.
3. In the Query Designer, choose Save.
Deleting a Condition
1. Choose Condition . You get to the selection window for the conditions that have already been defined.
2. Choose the condition you want, and then choose Delete .
3. In the Query Designer, choose Save.
Result
You have defined or changed a condition for a query. In the status bar of the Query Designer, the symbol in the lower right-hand corner shows you that one or
more conditions have been defined for this query.
Execute the query. Only those objects are displayed which fulfill the defined conditions.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 49 of 62
You can display the condition descriptions in the query view and activate or deactivate them there. See Using Conditions.
See also:
Background Information on Conditions
!--a11y-->
1.7 Defining Exceptions
Use
You can define threshold values (exceptions) for a query. Data that varies from these thresholds are marked in different colors. You can use these exceptions to
spot extraordinary variations from expected results straight away.
You can find additional information under Exception Reporting.
Procedure
1. Choose New Exception . (You can find this menu entry in the Query Designer toolbar under to the right of Exception. ) You get to the Defining
Exceptions dialog box.
2. Give a name for the exception in the Description field.
If you only want to define the exception, and do not want to execute it actively in the query, remove the check from the Active field that is set
there by default.
3. In the Evaluation for field, choose the structure elements, for which you want to evaluate the exception. Choose a structure element individually for every
structure used, or use the (Everything) setting to apply the exception to all the structure elements.
You want to evaluate the exception for the key figure Sales . Choose the value Sales from the selection field for the Key Figures structure .
4. Choose the Exception Values tab page.
Add one or more alert level rows to the list. See Conditions/Exceptions: Inserting, Changing, Deleting Rows
An alert level row consists of:
- From-value
- To-value
- Alert Level
From and To Values
Specify floating point numbers for the from and to values. If you want to, you can leave either the from- or the to- value blank.
The format depends on the country setting in the operative system.
The following convention makes it easier to handle numbers with many zeros:
An apostrophe after the number means multiplied by one thousand, a quotation mark means multiplied by one million, and three apostrophe
marks means multiplied by one billion, for example 1.5” = 1.5 mil = 1,500,000.
You can use formula variables for the from and to values of the exception.
Select Variables Entry.
The available formula variables appear in a dropdown box. Select a variable. You can change the variable using . The Variables Editor dialog box
appears. For more information, see Changing Variables in the Variable Editor.
Choose if you want to create a new formula variable. The Variables Wizard dialog box appears. For more information, see Defining Variables with the
Variable Wizard.
When you execute the query, the variable dialog box appears, in which you can choose the from and to values.
Alert Level
Assign the exception priority you want to use as an Alert level.
In the Excel formatting templates used as standard in the BEx Analyzer, a color ramp is used to display the priority given to an exception (dark green = good
1,...yellow = medium 5,...dark red = bad 9). There are a total of nine color shades, corresponding to nine different levels of priority. If you want to assign your
own colors, choose Formatting ® Pattern from the BEx toolbar (see also Formatting.
The formatting for Web applications is defined in the BW stylesheet. You can change the colors for the exceptions in the stylesheet.
All sales below 1,000 are bad, all sales above 100,000 are good, and all sales between these two values are medium. Define three Alert level
rows to correspond to these three categories:
From To Alert Level
1,000 9 (bad)
1,000 100,000 5 (medium)
100,000 1 (good)
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 50 of 62
For report data, the system processes alert level rows in sequence.
If you have defined several alert level rows for one value, the row with the worst alert level is displayed in the row.
5. Choose the Cell Restrictions tab page if you want to define more precisely the data cells of the report for which the exception is evaluated.
Add one or more cell restriction rows to the list. See Conditions/Exceptions: Inserting, Changing, Deleting Rows
A restriction row consists of:
- A characteristic
- An operator
- A value (only with the operator Fixed Value as a characteristic value, and the operator Level as a number)
Choose from any of the free characteristics, or any of the characteristics from the rows and columns that are used in a query. You cannot use characteristics
that have already been used in another restriction row in the list.
Choose from the following operators:
Operators Meaning
everything The validity area is not restricted. The exception is valid for every drilldown status of the
characteristic.
totals only The exception is valid only for aggregated values of the characteristic.
everything except totals The exception applies to all values of the characteristic apart from aggregated values.
fixed values The exception is valid for only one particular value of the characteristic (“spare parts”
under “product group”, for example). Specify the characteristic value you want to use in
external non-compounded display format or call the value help with to choose a
characteristic value.
You can also use characteristic value variables.
Select Variables Entry.
The characteristic value variables appear in a dropdown box. Select a variable. You can
change the variable using . The Variables Editor dialog box appears. For more
information, see Changing Variables in the Variable Editor.
Choose if you want to create a new characteristic value variable. The Variables
Wizard dialog box appears. For more information, see Defining Variables with the
Variable Wizard.
When you execute the query, the variable dialog box appears, in which you can choose
the characteristic value.
Level The exception is valid only for a particular hierarchy level of the characteristic. Specify the
hierarchy level you want to use as a number in the Value field.
In the hierarchy for the characteristic Location , Country is the second hierarchy level
( continent – country – state – location ). If you want the exception to be valid only for the
hierarchy level Country , put the number 2 in the Value field. If you want the exception
to be valid only for the hierarchy level State , put the number 3 in the Value field, since
State is the third hierarchy level.
Validity Area for All Characteristics Not Listed:
· For all characteristics for which you have not restricted the validity area, the preset value Only Results (Recommended for Relative Values) from the Validity
Area for All Characteristics Not Listed goes into effect. This setting means that the exception is valid only for the aggregated values of this characteristic.
· You can also use the default restriction Everything (Recommended for Relative Values) in the field Validity Area for All Characteristics Not Listed . This
setting means that the exception is valid independent of the drilldown status of a characteristic, the validity area of which has not been restricted. This does
not qualify as a restriction.
We recommend that you use the Everything setting only with relative values, such as percentage deviations.
6. Choose OK . You return to the query definition.
7. Choose Save.
Changing Exceptions
1. Choose Change Exception. (You can find this menu entry in the Query Designer toolbar under to the right of Exception. ) The dialog box for the
exceptions that have already been defined appears.
2. Select the exception you want to use, and choose OK . The Defining exceptions dialog box appears . Make your changes here.
3. In the Query Designer, choose Save.
Deleting Exceptions
1. Choose Exception . The dialog box for the exceptions that have already been defined appears.
2. Select the exception you want to remove, and choose Delete.
3. In the Query Designer, choose Save.
Result
You have defined or changed an exception for a query. In the status bar of the Query Designer, the symbol in the lower right-hand corner shows you that one or
more exceptions have been defined for this query.
Execute the query. The exception is evaluated online. The cells that are affected by the exception are displayed with the appropriate color shading in the result
area of the query.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 51 of 62
You can display the exception descriptions and activate or deactivate the exceptions you want.
BEx Web applications:
In the Web item List of Exceptions, choose the symbol for activating and deactivating exceptions.
Under the Data Analysis tab page in the Standard Web Template for Ad-hoc Analysis or in the BEx Web Analyzer, choose the Exceptions and
Conditions button to get to the display of existing exceptions and to execute the functions associated with them.
BEx Analyzer:
In the BEx Analyzer, choose Layout ® Display Exceptions . The descriptions for the exceptions are inserted into the cell area below the filter
cells. You can activate/deactivate the exceptions with a double-click or over the context menu (secondary mouse-click).
Exceptions are evaluated in the background, if they involve a large number of queries, for example. You schedule the exceptions for background processing in
the Administrator Workbench Reporting Agent.
See Reporting Agent, Defining the Exceptions Setting.
!--a11y-->
1.7.1 Conditions/Exceptions: Inserting, Changing, Deleting
Rows
Use
When you define conditions, you must set up condition rows. When you define exceptions, you can create alert level rows and restriction rows.
Procedure
Inserting a new row
Choose New .
Select the settings you want in the entry field under the list.
Choose Copy . A new entry appears in the list with the new settings. You can now immediately create a new row in the entry field.
Changing rows
Select the required row in the list.
Make the required changes in the entry field under the list.
Choose Copy . The row has now been changed accordingly.
Deleting rows
Select the required row in the list.
Choose Delete .
The procedure applies when you are creating
Condition rows (see
Defining Conditions)
Alert level and restriction rows (see
Defining Exceptions)
!--a11y-->
1.8 Tabular Query Display
Use
You can use all queries defined in the BEx query designer for OLAP reporting and also for
Tabular Reporting.
Features
By (de)selecting the Tabular Display mode when defining a query, you can create a query for OLAP reporting or for tabular reporting. The OLAP reporting mode
is the default mode. When you save the query, both display types are automatically saved in a query object in the database.
If you define the query in one mode, the system automatically generates a standard presentation for the other mode. In addition, all existing queries automatically
have a default tabular display. Therefore, you can use all defined queries for OLAP reporting in the BEx Analyzer and in BEx Web applications and also for
formatted reporting within the scope of Crystal Reports integration.
Queries that have two structures are available only in the multidimensional display and are suitable only for OLAP reporting.
Characteristics and key figures are displayed in the columns in the tabular display. Unlike with OLAP reporting, there are no free characteristics and no rows. You
can use filters in the tabular display and assign characteristics, key figures and attributes freely in the columns. For example, you can put a key figure column
between two characteristic columns. The column display is determined when the query is designed and cannot be altered. In tabular reporting, the interaction
options are limited to filters, filtering and drilling down according to, sorting according to, and navigation in hierarchies. Navigation functions that would change the
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 52 of 62
geometry of the tabular list (that is the number and position of the columns), such as swapping or adding drilldowns, are not permitted in tabular reporting.
Displaying queries in tabular format is particularly useful for formatted and form-based reporting (for example, for displaying a materials list). It is important in
formatted reports that you can specify the layout design to one pixel and also have convenient print options.
Switching between the two display types:
When you switch a query defined for OLAP reporting to the tabular display, all InfoObjects are moved automatically from the rows into the columns. Similarly,
when you switch a query that was defined in the tabular display to a multi-dimensional display, all characteristics are displayed in the rows and all key figures are
displayed in the columns. The filter settings remain the same in both cases. Free characteristics from the multi-dimensional display change to filters when you
switch to tabular display.
If you remove an InfoObject from the query definition in one mode, the change is also made in the other mode. The InfoObject is also removed from the query there.
In other words, changes to the definition of objects effect both display types. If you change the position of the InfoObject in the columns in the tabular
display, this does not effect the multi-dimensional display for OLAP reporting. In other words, changes to the position of objects effect only the selected
display type.
Activities
Choose in the Query Designer symbol list to switch between the two modes.
For more information about the integration of formatted reporting, see
Formatted Reporting: Crystal Reports Integration
!--a11y-->
1.9 Defining Calculated Key Figures
Use
You can recalculate the key figures of an InfoProvider for reuse in the Query Designer using formulas. Calculated key figures consist of formula definitions
containing basic key figures, restricted key figures or precalculated key figures.
Procedure
Defining a New Calculated Key Figure
In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Calculated Key Figure.
If a calculated key figure has already been defined for this InfoProvider, you can also select the Calculated Key Figures entry and, from the context
menu, choose New Calculated Key Figure.
The New Calculated Key Figure dialog box appears.
The upper part of the screen contains a text field in which you enter a description of the calculated key figure.
You can
use text variables in the description.
Beneath this is the input field for the formula that you want to use to calculated the key figure. The bottom left screen area contains all of the operands
available for the formula definition. These are:
The basic key figures, calculated key figures and restricted key figures from the relevant InfoProvider.
All form variables
On the right-hand side of the screen, you see the functions that are available as operators:
Basic functions
Percentage functions
Data functions
Mathematical functions
Trigonometric functions
Boolean operators
Between the operands and the functions, the symbols for the basic arithmetic operations are displayed. To the right of the functions, there is a
number block.
Proceed as follows to define a formula:
Choose the operands you want to use, and insert them in the entry field for the formula by double-clicking or by using Drag&Drop.
Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the
functions, or using Drag&Drop.
Select the numerical values for the formula by clicking on the number block.
You can also enter digits, parentheses and basic arithmetical operations using the keyboard.
2. Define your formula using the available operands and operators.
If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight
the Formula Variable entry and using the right mouse button on the context menu, choose New Formula . You reach the variable wizard
that takes you through a step-by-step process for defining a new variable.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 53 of 62
If you want to change a formula variable, select the variable and, from the context menu, choose Edit. The variable editor appears.
Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect
if, for example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless
of the unit, use the function Value Without Dimension (Without Units). See Data Functions.
3. Check the formula definition and choose Formula Syntax Check .
The Formula Syntax Check function checks only the correctness of the syntax in the formula. It does not check whether the formula makes sense
semantically, for example, if it contains the same units. You make semantic checks using the function Check Query (see Functions of the BEx Query
Designer).
4. Enter a description for the calculated key figure..
5. Choose OK . The new calculated key figure is defined for the InfoProvider.
Editing Calculated Key Figures
Note that when you change a calculated key figure, these changes are effective in all queries that use this calculated key figure.
You can see where the calculated key figure is used. Choose Where-used List from the context menu (right mouse click) .
1. In the InfoProvider objects display frame, select the calculated key figure and, from the context menu (right-mouse click), choose Edit.
2. Make the required changes.
3. Choose OK .
Determining Properties for the Calculated Key Figure
In the left display frame for InfoProvider objects, select the calculated key figure and, from the context menu, choose Properties.
Make the required settings for the description, display, number format, currency translation, local calculations and the aggregation behavior of the calculated
key figure. See
Calculated key figure properties
Result
You have defined a calculated key figure for reuse.You can now use this calculated key figure in all queries based on this InfoProvider by moving the key figure
into the rows or columns of the query using Drag&Drop. The calculated key figure is not an actual element in this query, but a placeholder referenced to the
calculated key figure in the InfoProvider.
!--a11y-->
1.10 Defining Restricted Key Figures
Use
You can restrict the key figures of an InfoProvider for reuse by selecting one of more characteristics. The key figures that are restricted by one or more
characteristic selections can be basic key figures, calculated key figures or key figures that are already restricted.
Procedure
Defining a New Restricted Key Figure
1. In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Restricted Key Figure.
If a restricted key figure has already been defined for this InfoProvider, you can also select the Restricted Key Figures entry and, from the context menu,
choose New Restricted Key Figure using the right mouse button .
The New Restricted Key Figure dialog box appears.
The text field, in which you can enter a description of the restricted key figure, is found in the upper part of the screen.
You can use Text Variables in the description.
Underneath the text field, on the left, is the directory of all the objects available in the InfoProvider. The empty field for defining the restricted key figure is on
the right-hand side of the screen.
2. Using Drag&Drop, choose a key figure from the InfoProvider, and restrict it by selecting one or more characteristic values. See, Restricting Characteristics.
You can also use variables in place of the characteristic values. However, note that you cannot use the following variable types in restricted key
figures for technical reasons.
¡ Variables with Replacement with Query process type (see also Replacement Path: Replacement with Query
¡ Variables that represent a precalculated value set (see also Details)
You can use these variable types to restrict characteristics in the rows, columns or in the filter.
3. Choose OK .
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 54 of 62
Editing restricted key figures
Note that when you change a restricted key figure, these changes are effective in all queries that use this restricted key figure.
You can see where the restricted key figure is used. Choose Where-used List from the context menu of the restricted key figure (secondary
mouse click) .
1. In the InfoProvider objects display frame, select the restricted key figure and, from the context menu (right-mouse click), choose Edit.
2. Make the required changes.
3. Choose OK .
Determining properties for the restricted key figure
1. In the left display frame for InfoProvider objects, select the restricted key figure and, from the context menu, choose Properties.
2. Make the required settings for the description, number format and currency translation for the restricted key figure. See Restricted key figure properties
Result
You have defined a restricted key figure for reuse. You can now use this restricted key figure in all queries based on this InfoProvider by moving the key figure into
the rows or columns of the query using Drag&Drop. The restricted key figure is not an actual element in this query, but a placeholder referenced to the restricted
key figure in the InfoProvider.
!--a11y-->
1.11 Structures
Definition
Objects that appear in the Query Designer and can be defined freely.
A structure forms the basic framework of the axes in a table (rows or columns). It consists of structural components. We differentiate between key figure structures
and characteristic structures.
Structural components of key figure structures are always based on the key figure selections (basic key figures, restricted key figures, and calculated key
figures). Characteristic structural components cannot contain key figure selections.
The set up of the structure determines the sequence and number of key figures or characteristic values in the columns and rows of the query. You can navigate
through the structure in the executed query and set filters for it.
If you are using two structures (for example, a key figure structure in the columns and a characteristic structure in the rows), a table with fixed cell definitions is
created.
You have to use two structures as a prerequisite for defining exception cells. You can override the value of cell values created implicitly at the
intersection of two structural components. See Defining Exception Cells
Use
Structures and their structural components are complex objects. Structural components can be formulas or selections.
In key figure structures, each selection structural component has to consist of one key figure selection along with possible characteristic
selections.
Within a query definition you can use either no structures or a maximum of two structures. Of these, only one can be a key figure structure.
You can combine structures freely with other characteristics on the axes.
Key figure structure
A structure appears in the Query Designer automatically if you move a key figure from the left selection window for InfoProvider objects into the rows or columns of
the query definition. The structure that the system creates automatically is identified by the symbol and contains the default name Key Figures as a proposal.
You can change this default name.
1. Select the structure and choose Properties from the context menu (secondary mouse click). This brings you to the structure properties dialog box.
2. Change the name if necessary, and choose OK.
For more information, see Structure Element Texts and their Language-Dependency.
Note the following when using key figures in a query:
§ Key figures in the Rows or Columns are always a component of a structure.
If you place a key figure in the Filter area of the query definition, the key figure is not a structural component. In this case, you can still use up to
two characteristic structures in the rows or columns.
§ You can use key figures in a query in only one structure.
§ Each structural component of a key figure structure must contain a key figure.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 55 of 62
Characteristic structure
If you want to use a structure in the query with several characteristic values, you first have to create a structure and then insert the required characteristic values.
1. Use the right mouse button to open the context menu in the columns or rows and choose New Structure. The default name for the structure is Structure. You
can change this default name. See above under Key Figure Structure.
2. Use Drag&Drop to move the required characteristic values from the left selection window for the InfoProvider objects into the structure.
Although a key figure has to be available in the form of a structure for the query, the use of a characteristic structure is optional. The difference between a
characteristic structure and the use of characteristics on an axis is that with the characteristic structure, you have already specified the number and sequence of
the characteristic values in the query definition. If you use a characteristic on an axis, all posted characteristic values for the characteristic are displayed in the
query. You can restrict the selection of specific characteristic values by setting a filter.
Special features when using two structures
Note that when you use two structures, you can include a characteristic in only one of the two structural components of a selection structural component.
If you have made a selection in a structure element for one structure on the characteristic fiscal year , you cannot use the fiscal year
characteristic as a selection in the other structure.
Hierarchical display of structures
You can arrange the structural components in a structure hierarchically.
Use the right mouse button to call the context menu and choose Level Down or Level Up. The hierarchical relationship of the structural components is displayed
in the executed query like a presentation hierarchy. You can expand and collapse the nodes.
Arranging the structural components
You determine the sequence of the structural components when you add a key figure or characteristic to the structure below another. You can change the
sequence later by selecting the structural component and using Drag&Drop to move it to the required position further up or down.
Copying structural components
The components of key figure structures often contain very complex objects that are made up of formulas or selections. If you want to reuse the definition of a
structural component within a structure, you can copy the structural component, paste it into the structure and continue to work with it. This enables you to create
similarly structured structural components quickly and easily.
For example, if you want to use the formula for a calculated key figure (K1) in another calculated key figure (K2), you can copy K1 and continue to
build the formula in K2.
From the context menu of the structural component, choose Copy and from the context menu of the structure, choose Insert. You can also copy structural
components using temporary storage locations (Ctrl-C, Ctrl-V).
Saving structures for reuse
You can use structures in several different queries. You have to save them in the InfoProvider to reuse them. These structures are then called reusable
structures. For more information, see Creating Reusable Structures.
Integration
Considered abstractly, you can think of a structure as a characteristic. However, the following differences exist between a characteristic and a structure:
· Structural components can be complex objects (selections, formulas…) while characteristic values are atomic values.
· You cannot aggregate structures. For a characteristic, you can determine whether it can be aggregated or not. If a characteristic can be aggregated, the sum of
the characteristic values is created automatically. Structural components cannot create sums.
· If a characteristic is in the drilldown, all posted characteristic values are displayed. Characteristic values that do not include posted values are not displayed. If
a structural component does not include posted values, then the structural component is always displayed, and the respective cells for this structural
component are empty and have no numbers.
Constraints
The number of structural components in a structure is restricted to 999.
Examples
Plan/Actual Comparison (= Key Figure Structure)
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 56 of 62
Time Structure (= Characteristic Structure)
Creating a query with two structures
Key figure structure in the rows and characteristic structure in the columns:
See also:
Displaying Changes for Queries in Workbooks
!--a11y-->
1.11.1 Creating Reusable Structures
Use
You can use structures in several different queries. You have to save them in the InfoProvider to reuse them. These structures are then called reusable
structures.
When you use a reusable structure in a query, the structure is not copied, but rather the reference to it is.
Changes made to reusable structures affect all queries in which reusable structures are used.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 57 of 62
To better distinguish between the two kinds of structures, structures that are not saved as reusable structures are called local structures. Local
structures are used in only one query.
You can change local structures into reusable structures in any existing query by selecting the structure and, choosing Save as... from the
context menu and then entering a technical name and a description in the Save Structure as... dialog box.
You can change reusable structures that you are using in a query into local structures by selecting the structure and choosing Remove
Reference from the context menu.
Prerequisites
At least one InfoProvider that is filled with data must be available in the Business Information Warehouse.
Procedure
1. Start the Query Designer.
You open the Query Designer from Start/Programs/Business Explorer/Query Designer.
You can also call up the BEx Query Designer from the following components:
· BEx Analyzer
· BEx Web Application Designer
· Crystal Reports
Business Explorer Analyzer:
In the BEx toolbar, choose Open ® Queries . In the BEx Open Dialog, you have access to the selection screen displaying all available queries in your
history, favorites and roles or assigned to the InfoAreas. Choose New
Web Application Designer:
In the menu toolbar in the Web Application Designer, choose Tools ® Query Designer. Choose New Query .
2. You get to the selection screen for all InfoProviders for which you can define a new query. From the list of all available InfoProviders, select the InfoProvider for
which you want to create the reusable structure. The available objects in the InfoProvider you selected are displayed as a directory tree in the left side of
the Query Designer.
3. In the Rows or Columns directory of the Query Designer, choose New Structure from the context menu (right mouse button).
4. Create a new structure. Select the characteristics and key figures of the InfoProvider that you want to use in the new structure and drag them into the
structure directory. Where necessary, restrict a characteristic or a key figure, or define a new calculated key figure.
You can copy individual structural components within a structure. This enables you to create similarly structured structural components quickly
and easily. For example, if you want to use the formula for a calculated key figure (K1) in another calculated key figure (K2), you can copy K1 and
continue to build the formula in K2.
From the context menu of the structural component, choose Copy and from the context menu of the structure, choose Insert. You can also copy
structural components using temporary storage locations (Ctrl-C, Ctrl-V).
5. Highlight the new structure. From the context menu (right mouse-click), choose Save as ... and enter a Technical name and a Description .
Result
The reusable structure is in the structure list of the InfoProvider tree and you can use it again when you create new queries.
See also:
Defining New Queries
!--a11y-->
Structure Element Texts and Their Language-Dependency
Use
When you define a query, in the left selection window you see the InfoProvider objects that you can move into the query directories using Drag&Drop for the
definition. For example:
· InfoObjects
· Reusable calculated key figures
· Reusable restricted key figures
· Reusable structures
You can maintain the texts for these objects in several languages.
Examples
Creating Structures and Changing or Accepting the Default Text
1. If you create a query in a logon language (for example, German) and include a basic key figure, a restricted key figure, or a calculated key figure in the
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 58 of 62
columns or row, this key figure automatically becomes part of a structure, that is, a selection structural component. (You see the Selection type in the Edit
Selection dialog box that appears when you double-click on a structural component.)
The structure that the system creates automatically is identified by the symbol and contains the default name Key Figures as a proposal.
A key figure in the rows or columns has to be part of a structure. You can have a maximum of two structures in a query, only one of which can be
a key figure structure.
You can also create a structure manually. Use the secondary mouse button to open the context menu in the Columns or Rows and choose New Structure.
This structure automatically receives Structure as a suggested name .
2. You can change this suggested name. Select the structure and choose Properties from the context menu (secondary mouse click). This brings you to the
structure properties dialog box.
3. Change the name if necessary, and choose OK.
Structural Components and Their Texts
· If you move a key figure from the InfoProvider object selection window on the left into the key figure structure, the default name for this structural component is
given as the name from the left selection window (dependent on the logon language).
· You can make additional restrictions on the structural component (by double-clicking on it) or change the properties of it (from the context menu under
Properties ), and, therefore, can change the name given by default.
You can transfer a key figure as often as you want and make changes to the structure locally (different settings, restrictions). Therefore, the name
has to be individually changeable.
· The structure does not contain the original element from the left selection window of the InfoProvider objects, but rather a structural component that links to the
original key figure in the left window.
· The names of the structural components are language-dependent. That is, when you define and save a query with the logon language as German, only the
relevant German texts are saved in the corresponding tables (for example, RSZELTTXT). This is not the original key figure, but rather a structural component,
a new object that links to the original key figure but is not the original key figure.
· If you then execute the query in a different logon language to the one that you used to define the query, the relevant texts for all structural components are
missing and displayed as empty.
The system behaves differently with characteristics, since you do not create these objects in the Query Designer but rather in the InfoObject
maintenance. For characteristics, the relevant text is displayed in the logon language when you execute the query.
However, if you have manually changed a characteristic description in the Query Designer (for example, Region in a Favorite Region ), then the
respective, translated text for the manual change (for example, Favorite Region ) is not displayed, but rather the original text is (for example,
Region ), as long as this is maintained in the InfoObject maintenance. So that you also keep a respective translation in another language, you
have to manually change the characteristic description in the Query Designer when logging on in another language and save the query. See
Properties for a Characteristic .
· When you logon in a different language (for example, English) and you want to see the English texts for the structural components when you execute the query,
you have to open the Query Designer after you have logged on in English and save the query definition. If available, the English texts are then used as the
default texts and you can change these individually. If no English texts have been maintained, the technical name is used instead.
If you have not yet saved the query definition in a different logon language (for example, English), there are no English texts. When you logon in
English and execute the query, the relevant fields are empty.
· Structures and structural components (selections, formulas) are completely independent objects that appear in the BEx Query Designer and that you can
store in the relevant tables when you save them. Since texts are fundamentally language-dependent, the texts in the query definition appear in the logon
language only when you save the query.
· Therefore, in queries that you have already defined, the system cannot adjust translated key figures within a structure automatically at a later date. You can
only adjust the texts manually for each structural component, by, for example, removing them and inserting them back into the structure.
!--a11y-->
1.12 Displaying and Changing Existing Queries in the Query
Designer
Prerequisites
You must have created at least one query.
Displaying Queries
You open the Query Designer from Start Programs Business Explorer Query Designer.
You can also call up the BEx Query Designer from the following components:
BEx Analyzer
BEx Web Application Designer
Crystal Reports
From the BEx Web Application Designer:
1. Choose Tools ® Query Designer .
2. In the Query Designer symbol toolbar, choose Open Query. The BEx Open Dialog appears.
3. From here, select a query from the queries in your history, favorites or roles, or from queries assigned to the InfoAreas.
You can display them in the Query Designer:
By double-clicking on them
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 59 of 62
By selecting them and choosing Change
From the BEx Analyzer:
1. Choose Open ® Queries in the BEx toolbar. The BEx Open Dialog appears.
2. From here, choose a query from the queries in your history, favorites or roles, or from queries assigned to the InfoAreas. Then select it.
3. Choose Change .
Changing Queries
Display the query in the Query Designer.
You can now make changes in the query definition. The procedure for changing the query is the same as for creating a new query (
see also: Defining New Queries).
You have two options for saving the query:
You can save the changed query. From the toolbar, choose Save Query .
You can save the changed query as a new query. From the toolbar, choose Save Query As . Enter a new technical name, a new short text and a
new description.
4. You can also delete the query. From the toolbar, choose Delete Query . You can delete the query only if it is no longer being used (that is, if it is not
being used in any workbooks, Web templates, Crystal Reports or Reporting Agent settings).
Using the function Display <-> Change , you can toggle between the display and change modes.
See also:
Saving Queries
Functions of the BEx Query Designer
!--a11y-->
1.13 Functions on the BW Server
Use
There are certain functions that you can use with queries that you do not use in the Frontend but rather on the BW server. You cannot call up these functions in the
Business Explorer tools. You call them up from the SAP Easy Access Menu of your BW system.
Features
You call up the following functions from the SAP Easy Access Menu of the BW system under SAP Menu ® Business Explorer ® Query :
Copying Queries between InfoCubes
Deleting Query Objects
Editing Sender/Receiver Assignments to the R/RI in BW
!--a11y-->
1.13.1 Copying Queries Between InfoCubes
Use
With this function you can copy queries and their sub-objects (structures, calculated key figures and restricted key figures) between different InfoCubes.
The target InfoCube, that is, the InfoCube of the query copies, must contain all the InfoObjects of the source InfoCube (InfoCube of the original
queries).
Procedure
In the SAP Easy Access Menu of the BW system, choose SAP Menu ® Business Explorer ® Query ® Copy. Double-clicking on Copy Queries
brings you to the popup Copying Queries Between InfoCubes .
2. Select the required source and target InfoCube.
3. Choose Next . This brings you to a selection box with all the queries of the source InfoCube.
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 60 of 62
4. Select a query from those available.
You have the following options for selecting multiple queries.
To make several selections from the list, select the required queries with a mouse click and the Ctrl key.
If you want to select several queries that follow each other in the list, you can select whole blocks by holding down the Shift key.
5. Choose Transfer Selections.
Note the following if you are working with reusable sub-objects such as variables, structures, calculated key figures and restricted key
figures:
Variables are not dependent on InfoCubes, so variables are not copied.
If you have selected several queries to be copied and they refer to sub-objects that follow each other in the list, only one copy is made for each of the
sub-objects. The references of the copied queries remain.
New sub-objects are created when queries are copied again. This means the references to queries that have already been copied are lost.
Result
The copied queries and the copied sub-objects have their own names. The new names are derived from the name of the original object and the added elements
_<number>.
This does not affect variables, since they are not copied.
Example
The queries w eekly report, monthly report and annual report use company code as a variable and the calculated key figure contribution margin . If you now
copy the queries w eekly report and monthly report into another InfoCube, the queries w eekly report_1 and monthly report _ 1 as well as the calculated key
figure contribution margin _ 1 are created. The new queries now refer to the new key figure contribution margin _ 1 and the variable company code .
If you then copy the queries quarterly report and annual report , a new calculated key figure, contribution margin _ 2, has to be created as a copy of
contribution margin . Quarterly report_1 and annual report_1 then refer to contribution margin _ 2 and not contribution margin _1 . Company code is still used
as a variable.
!--a11y-->
1.13.2 Deleting Query Objects
Prerequisites
You have already defined at least one query, or a structure, or a restricted or calculated key figure.
Procedure
In the SAP Easy Access Menu of the BW system, choose SAP Menu ® Business Explorer ® Query ® Delete Objects. This brings you to a selection
screen.
Choose the type of object to be deleted (query, structure, restricted key figure or calculated key figure).
Where necessary, restrict your search further, for example, to a certain InfoProvider, to certain technical names or to the last person to make a change..
Choose Execute . You get a list of all query objects that match the selection criteria. The list contains the technical names of the query objects, the name,
and the long description of the InfoProvider, for which the objects are defined.
Select the objects that you want to delete.
Choose to select all of the objects.
Choose Transfer.
Option of Deleting Workbooks after Deleting Queries
After you have deleted a query, you can decide whether you also want to delete all the workbooks that contained a query which has now been deleted. All users
can delete workbooks from any of their favorites and roles. This means there is no risk of accessing workbooks with deleted queries in.
Result
The query objects you specified are deleted.
See also:
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 61 of 62
Removing Queries from Workbooks
PUBLIC
© 2014 SAP SE or an SAP affiliate company. All rights reserved.
Page 62 of 62

More Related Content

PPT
Unit 2 b_ex_query_designer
DOC
How to broadcast a b ex report through e
PPT
Rational Publishing Engine with Rational DOORS
DOC
Oracle report from ppt
PPTX
PDF
Variant material
PPTX
Oracle Config Pres_Shashank
PPTX
Using adobe® framemaker® 10 part 2
Unit 2 b_ex_query_designer
How to broadcast a b ex report through e
Rational Publishing Engine with Rational DOORS
Oracle report from ppt
Variant material
Oracle Config Pres_Shashank
Using adobe® framemaker® 10 part 2

What's hot (18)

PDF
Example User Stories Specification for ReqView
PPT
Metamorphosis from Forms to Java: A technical lead's perspective, part II
PDF
Guidelines data cite_denmark_ver3
PPTX
Framemaker 1
PPT
Rational Publishing Engine and Rational RequisitePro
PDF
Excel Certification
PPT
People soft workflow by surya
PDF
Oracle Payables R12 ivas
PPT
Oracle Forms Tutorial (www.aboutoracleapps.com)
PPT
Bw training 7 bw reporting b ex 1
PPT
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...
DOC
E mpower doc_functional_specification_v1
DOC
Step by step exercise for bw 365
PPT
People soft basics
PPT
RPE - Template formating, style and stylesheet usage
PPT
The ABAP Query
PDF
Oracle SQL Part 3
PPT
Design patterns
Example User Stories Specification for ReqView
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Guidelines data cite_denmark_ver3
Framemaker 1
Rational Publishing Engine and Rational RequisitePro
Excel Certification
People soft workflow by surya
Oracle Payables R12 ivas
Oracle Forms Tutorial (www.aboutoracleapps.com)
Bw training 7 bw reporting b ex 1
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...
E mpower doc_functional_specification_v1
Step by step exercise for bw 365
People soft basics
RPE - Template formating, style and stylesheet usage
The ABAP Query
Oracle SQL Part 3
Design patterns
Ad

Similar to Saphelp erp2004 en_9d_76563cc368b60fe10000000a114084_content (20)

PDF
New dimensions for_reporting
PDF
Day 9 __10_introduction_to_bi_enterprise_reporting_1___2
PPTX
Agile Methodology Approach to SSRS Reporting
PPTX
BEX.pptx
PDF
Sap standard Enhancement UserExits tutorials
PDF
ServiceNow Utah Release Highlights
PPT
Rational Requisite Pro - Advanced (http://www.geektester.blogspot.com)
PPT
Cognos framework manager
PDF
Ps training mannual ( configuration )
DOCX
PURPOSE of the project is Williams Specialty Company (WSC) reque.docx
PPTX
Waterfall methodology life Process.pptx
PDF
Power bi slide share pdf it is a very important
DOC
Document defect tracking for improving product quality and productivity
PPT
Actuate BIRT best practices v1 0
PPTX
Improving Business Agility through IBM Business Insight Advanced
PDF
B ex query designer
PDF
Super applied in a sitecore migration project
PDF
Web Surveys Builder Quick Reference manual
PDF
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
DOC
New dimensions for_reporting
Day 9 __10_introduction_to_bi_enterprise_reporting_1___2
Agile Methodology Approach to SSRS Reporting
BEX.pptx
Sap standard Enhancement UserExits tutorials
ServiceNow Utah Release Highlights
Rational Requisite Pro - Advanced (http://www.geektester.blogspot.com)
Cognos framework manager
Ps training mannual ( configuration )
PURPOSE of the project is Williams Specialty Company (WSC) reque.docx
Waterfall methodology life Process.pptx
Power bi slide share pdf it is a very important
Document defect tracking for improving product quality and productivity
Actuate BIRT best practices v1 0
Improving Business Agility through IBM Business Insight Advanced
B ex query designer
Super applied in a sitecore migration project
Web Surveys Builder Quick Reference manual
IBM Cognos 10 Framework Manager Metadata Modeling: Tips and Tricks
Ad

Recently uploaded (20)

PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
L1 - Introduction to python Backend.pptx
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Understanding Forklifts - TECH EHS Solution
PDF
System and Network Administraation Chapter 3
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
top salesforce developer skills in 2025.pdf
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Digital Strategies for Manufacturing Companies
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Nekopoi APK 2025 free lastest update
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Introduction to Artificial Intelligence
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
medical staffing services at VALiNTRY
How Creative Agencies Leverage Project Management Software.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
L1 - Introduction to python Backend.pptx
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Understanding Forklifts - TECH EHS Solution
System and Network Administraation Chapter 3
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
top salesforce developer skills in 2025.pdf
Online Work Permit System for Fast Permit Processing
Design an Analysis of Algorithms II-SECS-1021-03
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Design an Analysis of Algorithms I-SECS-1021-03
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Digital Strategies for Manufacturing Companies
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Nekopoi APK 2025 free lastest update
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Introduction to Artificial Intelligence
ManageIQ - Sprint 268 Review - Slide Deck
medical staffing services at VALiNTRY

Saphelp erp2004 en_9d_76563cc368b60fe10000000a114084_content

  • 1. Query Design: BEx Query Designer PDF download from SAP Help Portal: http://help.sap.com/saphelp_erp2004/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm Created on December 15, 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 62
  • 2. Table of content 1 Query Design: BEx Query Designer 1.1 Functions of the BEx Query Designer 1.2 Defining New Queries 1.2.1 Restricting Characteristics 1.2.2 Restricting Characteristics: Hierarchies 1.2.3 Selecting Hierarchies 1.2.4 Defining Selections 1.2.5 Defining Formulas 1.2.5.1 Percentage Functions 1.2.5.2 Data Functions 1.2.5.3 Boolean Operators 1.2.5.4 Technical Notes about the Formula Operators 1.2.6 Defining Exception Cells 1.2.7 Save Queries 1.3 Using Variables: The Variable Wizard and the Variable Editor 1.3.1 Variable Types 1.3.1.1 Using Text Variables 1.3.2 Variable Processing Types 1.3.2.1 Manual Entry / Default Value 1.3.2.2 Replacement Path 1.3.2.3 Customer Exits 1.3.2.3.1 Dependencies for Variables of Type Customer Exit 1.3.2.4 SAP Exit (delivered variables) 1.3.2.5 Authorization 1.3.3 Overview of Variable Types and Processing Types 1.3.4 Defining Variables with the Variable Wizard 1.3.4.1 Details 1.3.4.1.1 Special Features with Dynamically Changeable Variables 1.3.4.2 Default Values 1.3.4.3 Replacement Path 1.3.4.3.1 Replacement Path: Replacement with a Characteristic Value 1.3.4.3.1.1 Calculating Variables for Processing Type “Replacement Path” 1.3.4.3.1.2 Variable Replacement Example 1.3.4.3.2 Replacement Path: Replacement with Query 1.3.4.4 Characteristic 1.3.4.5 Currencies and Units 1.3.5 Changing Variables in the Variable Editor 1.3.6 Examples for Using Variables 1.4 Query Properties 1.5 Properties of Query Components 1.5.1 Characteristic Properties 1.5.2 Attribute Properties 1.5.3 Structure Properties 1.5.4 Selection/Formula Properties 1.5.5 Restricted Key Figure Properties 1.5.6 Calculated Key Figure Properties 1.6 Defining Conditions 1.7 Defining Exceptions 1.7.1 Conditions/Exceptions: Inserting, Changing, Deleting Rows 1.8 Tabular Query Display 1.9 Defining Calculated Key Figures 1.10 Defining Restricted Key Figures 1.11 Structures 1.11.1 Creating Reusable Structures 1.11.2 Structure Element Texts and Their Language-Dependency 1.12 Displaying and Changing Existing Queries in the Query Designer 1.13 Functions on the BW Server 1.13.1 Copying Queries Between InfoCubes 1.13.2 Deleting Query Objects PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 2 of 62
  • 3. !--a11y--> 1 Query Design: BEx Query Designer Definition Independent desktop application for defining queries. Use You analyze the dataset of the Business Information Warehouse by defining queries for InfoProviders using the BEx Query Designer . By selecting and combining InfoObjects (characteristics and key figures) or reusable structures in a query, you determine the way in which you navigate through and evaluate the data in the selected InfoProvider. Integration You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: · BEx Analyzer · BEx Web Application Designer · Crystal Reports (Crystal Reports ³ 8.5 incl. CR add-ons for SAP) Features The BEx Query Designer contains the following functions: · You can use the queries that you define in the query designer for OLAP reporting and also for tabular reporting. For further information, see Tabular Query Display · You can parameterize the queries by using variables for characteristic values, hierarchies, hierarchy nodes, texts, or formulas. For more information, see Using Variables: The Variable Wizard and the Variable Editor. · You can select InfoObjects more precisely by: · Restricting characteristics to characteristic values, characteristic intervals and hierarchy nodes (see Restricting Characteristics). · Defining formulas · Defining selections · Defining reusable calculated and restricted key figures (see Defining Calculated Key Figures, Defining Restricted Key Figures). · Using local or reusable structures (see Structures, Defining Structures for Reuse). · Defining exceptions · Defining conditions · Defining exception cells The most significant components of the query definition are the filter and navigation: · The selections in the filter have a limiting effect on the whole query. When defining the filter, you select characteristic values from one or more characteristics or from a key figure. All of the InfoProvider data is aggregated using the filter selection of the query. The filter selection cannot be changed by navigation. · For the navigation you select user-defined characteristics and determine the content of the rows and columns of the query. You use this selection to determine the data areas of the InfoProvider over which you want to navigate. The arrangement of the contents of the rows and columns also determines the default view of the query and the rows and columns axes in the results area. After it is inserted into the Web browser, a query is displayed in the default initial view. By navigating through the query, you can generate different views of the InfoProvider data, by dragging one of the user-defined characteristics into the rows or columns of the query, for example, or by filtering a characteristic according to a single characteristic value. With the definition of a query, the InfoProvider data can be evaluated specifically and quickly. The more detail in which the query is defined, the quicker its execution and navigation. See also: Defining New Queries !--a11y--> Functions of the BEx Query Designer Use This section contains an overview of the functions available in the BEx Query Designer. Features Proceed As Follows to Create A Query: PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 3 of 62
  • 4. · By clicking on the plus or minus symbol of the directories you can expand or compress the directories. You can, for example, display the list of all of the key figures in the InfoProvider by expanding the key figure node in the InfoProvider tree. · Using drag and drop or the temporary storage location (Ctrl C – Ctrl V), you can take characteristics and key figures from the InfoProvider into the directories of the Query Designer ( filter, rows, columns, free characteristics ). · Use the secondary mouse button to call up all the functions that are available in the respective context menu. First, select the query component you want to work with (for example, a characteristic) and then, using the secondary mouse button, select a menu entry (for example, Properties ) from the context menu. · By double-clicking on an item of the Query Designer, you call up a dialog box containing a function that is executed by default on this item. If, for example, you double-click on a characteristic, the dialog box for restricting the characteristic appears. If you double-click on a calculated key figure, for example, then the Calculated Key Figure dialog box, in which you can make changes, appears. The standard functions for an element in the Query Designer are shown in the context menu in bold type. Toolbar Functions Quit and Use Query Click on this symbol to leave the Query Designer and use the query that you have defined. The format in which the query is used depends on which tool you called the Query Designer from. If you have not yet saved your query, the system calls the Check Query function automatically to check the query for errors. Once the system has checked the query successfully, it asks whether you want to save the query. BEx Web Application Designer: You called the Query Designer from the Web Application Designer using the path Tools ® Query Designer and from there you defined a new query or changed an existing query and saved it. If you now choose Quit and Use Query, the Query Designer session ends and you are able to use the defined query as a data provider. See also: Creating Web Applications with the BEx Web Application Designer BEx Analyzer: If you have created or changed the query, you can insert it into a workbook to enable you to navigate in and analyze the query data. The query definition is saved but is not available universally. If you want the query to be universally (publicly) accessible in the Business Information Warehouse you must save it using the function Save or Save as .. . .and give it a unique technical name. See also: Evaluating Query Data Crystal Reports: You called the Query Designer from Crystal Reports and defined or changed a query (in table display) and saved it. You can now use the query as a data source for a formatted report in the Crystal Reports Designer Exit Query Choose Exit Query if you want to leave the Query Designer. Your entries will not be saved. Display Query on the Web When you have defined and saved your query, you can display it directly on the Web in a standard view. The query is embedded automatically into a standard Web template. You define the standard Web template in the SAP Reference IMG ® Business Information Warehouse ® Reporting-Relevant Settings ® Web-based Settings ® Determine Standard Web Template . PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 4 of 62
  • 5. New Query If you want to create a query, select the symbol for New Query . You reach the BEx Open dialog where you choose the InfoProvider whose data you want to use as the basis for your query. You can select the InfoProvider either from the InfoProviders in your history or from the list of all available InfoProviders under InfoAreas. See also: Defining New Queries Open Query Choose Open Query to get to the BEx Open dialog. Here, all existing queries are available in your history, favorites, roles or listed according to InfoArea. Under InfoAreas you get a list of all existing queries in the Business Information Warehouse for which you have display authorization. Save Query You can save a query that you have changed under its current name using the function Save Query. If the query does not yet have a technical name, the system offers the function Save Query As... automatically. See also: Saving Queries Save Query As... If you want to save the query under a new technical name, choose Save Query As... Enter the new technical name. You can save the query in your favorites or roles. See also: Saving Queries Delete Query Select Delete Query , if you want to delete a query. You are only able to delete the query if it is no longer being used (that is, if it is not being used in any workbooks, Web templates, Crystal Reports or Reporting Agent settings). Publish You are able to publish queries that you have edited and saved in the Query Designer so that they are available to other users. Under the small arrow , next to the publish symbol , you can select from the following options: · Publish in roles The save dialog appears and you can select a role in which you want to publish the query. The system saves a link to the current query in the selected role. · Publish to the portal The save dialog appears and you can publish the query to the Enterprise Portal. Here you can select from several options: for example you can publish the query to your portfolio or you can put in a collaboration room. For more information, see Publishing BEX Web Applications and Queries. · BEx Broadcaster The BEx Broadcaster, which is a Web application for precalculating and distributing queries, Web templates and workbooks, appears. You are able to precalculate the query that you edited in the Query Designer or you can generate it as an online link. You can distribute the generated document or the link by e-mail or you can export it to the Enterprise Portal. Furthermore, you can also precalculate and distribute other queries, Web templates or workbooks. You can find additional information under Functions of the BEx Broadcaster . Exception You can define exceptions for a query. Exceptions are variations in key figure values that you define yourself. They are displayed in a different color in the query view. This allows you to see, at a glance, any unusual deviations from the results you expect to get. Under the small arrow next to the exception symbol , you can: · change exceptions · define new exceptions If one or more exceptions have been defined for a query, this is shown by the symbol on the status bar of the Query Designer. See also: Exception Reporting Condition Choose Condition , if you want to define conditions for a query. You can specify threshold value conditions for the key figure values in every characteristic. For example, you can specify all sales figures under or above a certain threshold value. In the query, the selected characteristics are displayed with the restricted key figures. Under the small arrow next to the condition symbol , you can: · change conditions · define new conditions If one or more conditions have been defined for a query, this is shown by the symbol on the status bar of the Query Designer. See also: PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 5 of 62
  • 6. Conditions Define Cells... You can define formulas and selection conditions explicitly for cells in queries with two structures. In this way you can override the cell values that are created implicitly from the intersection of the structure components. This function allows you to design much more detailed queries. Define Cells... is only available for queries with two structures. For queries with only one structure, the symbol is deactivated. If one or more exception cells have been defined for a query, this is shown by the symbol on the status bar of the Query Designer. See also: Defining Exception Cells Query Properties Choose Query properties if you want to change the description of the query or if you want to make settings for the Results Position , Display Options, Number Display and S uppression of Zeroes for the query. In the query properties, you can also set Release for OLE DB for OLAP . You can also reach any available documents about the objects used in the query from here. See also: Query Properties Check Query Before you save a new or changed query, you can check the query definition for errors using the Check Query function. When you use the function Quit and Use Query , the system calls up the Check Query function automatically for queries that have not yet been saved. Once the system has checked the query successfully, it asks whether you want to save the query. Query Where-Used List With the Query Where-Used List , you can see the objects (workbooks, Web templates, Crystal Reports or Reporting Agent settings) in which the query is used. Display <-> Change Query Using this function you can toggle between the display and change mode. You can view the query definition in the display mode but you cannot change it. See also: Displaying and Changing Existing Queries in the Query Designer Change Query (Global Definition) Choose the function Change Query (Global Definition) , if you are currently in the local query definition, and want to change to the global definition. Table Display You can design a query for OLAP reporting and also for tabular reporting by activating or deactivating the Table Display mode when you define a query. This function is available only for queries with one structure. Queries that have two structures are only available in the multidimensional display and are suitable only for OLAP reporting. See also: Tabular Query Display Technical Name You can show or hide the technical names of the query components (InfoObjects, structures, variables, and so on) using this function. Context Menu The Context Menu function allows you to display the context menu without using the secondary mouse button (for example, using a touch screen). Select a directory from the InfoProvider tree or the query definition, and choose the Context Menu function. The context menu for the item you highlighted appears. Help Choose Help to go to the Business Information Warehouse online documentation. The Query Design: BEx Query Designer section in the documentation for the Business Explorer is displayed automatically there. Using the small arrow next to the help symbol under the entry About..., you can see the version of the Query Designer with the number of the support package and the revision. You can quote this information to SAP if you need to send any error messages. !--a11y--> PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 6 of 62
  • 7. 1.2 Defining New Queries Prerequisites The Business Information Warehouse must contain at least one InfoProvider. You have called up the BEx Query Designer from: · The menu path Start/Programs/Business Explorer/Query Designer In the Query Designer symbol toolbar, choose Open Query. · BEx Web Application Designer: In the Web Application Designer, choose Tools ® Query Designer and chose New Query from the Query Designer toolbar. · BEx Analyzer: In the BEx toolbar, choose Open ® Queries and then, in the BEx Open dialog, choose New . · Crystal Reports: Call the Query Designer and choose New Query from the Query Designer toolbar. You get to the InfoProvider selection in the Query Designer automatically in the table display. The procedure for defining a query is aligned with the procedure for defining a query in OLAP reporting. Therefore, note the differences for the table display when you are defining a query for use in formatted reporting with Crystal Reports. Process Flow You define queries by: · Selecting an InfoProvider for which the query is defined · Selecting reusable structures that already contain characteristic or key figure combinations (for example, contribution margin schema) · Selecting characteristics from the InfoProvider · Restricting selected characteristics to characteristic values, characteristic value intervals, or hierarchy nodes · Using variables for characteristic values, hierarchies, hierarchy nodes, formulas and texts or defining new variables where necessary. · Selecting key figures from the InfoProvider · Formulating calculated key figures · Restricting key figures by combining them with characteristics · Defining exception cells · Arranging the characteristics and key figures in rows or columns and thereby establishing an initial view for the query analysis. The steps that are not printed in bold are optional. You do not necessarily have to use these functions. Procedure You get to the selection screen for all InfoProviders for which you can define a new query. 1. From your history, or from all available InfoProviders under InfoAreas, select the InfoProvider that you want to base your query on. If you want to show the technical name of the InfoProvider, choose the symbol Technical Name On/Off . 2. The objects available in the InfoProvider you selected are displayed as a directory tree in the left part of the Query Designer. The right screen area contains empty directories for the filter selection, the rows, the columns and the free characteristics of the query. The preview of the results area for the query can be found at the bottom right. This area is also still empty. For more information about the process of creating a query, see Functions of the BEx Query Designer in the section Proceed as follows to create a query. 3. Make the selections for the filter of the query. Note that the filter selection has a restricting effect on the entire query, meaning that all of the InfoProvider data is aggregated with the filter selection. Select the characteristics or the key figure on which the query is based from the directory tree of the InfoProvider. ¡ Characteristics Expand the required dimension directory and first select one or more characteristics that you wish to restrict to one or more values, a variable, a value interval or a hierarchy node from the InfoProvider. Expand this characteristic and, using drag-and-drop, place a single value in the filter of the Query Designer. Alternatively, using drag-and-drop, drag the characteristic into the Filter area of the Query Designer. Using the right mouse button select Restrict from the context menu. Now select a characteristic value interval or a hierarchy node (See also: Restricting Characteristics). ¡ Key figure Decide whether all of the query data is to refer to the numerical values of a key figure or whether the query should be based on several key figures. If the query refers to the numerical values of one key figure, select the corresponding key figure of the InfoProvider tree and drag it to the Filter area of the query definition using Drag&Drop. You can also use a restricted or calculated key figure (see also: Defining Restricted Key Figures and Defining Calculated Key Figures ). 4. Now determine which characteristics, key figures or structures you want to use for navigating through the query data. Using Drag&Drop, move the corresponding directories of the characteristics of the InfoProvider tree to the directories Rows, Columns or Free Characteristics in the right-hand screen area of the Query Designer or drag the structure directories into the rows or columns. If you have not selected any key figures for the filter, define one or more key figures either in the rows or columns of the query. From the Key Figures directory of the InfoProvider tree drag a key figure into a directory of the Query Designer using Drag&Drop (either Row or Column ). The key figure is stored in the new directory Key Figure . You can also define a new calculated key figure and use it for the query. For example, instead of “Sales revenue”, define the key figure “Price” that is calculated using “Sales revenue” divided by “Quantity”. Highlight the directory Key Figures in the InfoProvider tree and choose New Calculated Key Figure from the context menu (right mouse click). You can restrict key figures to characteristic values, characteristic value intervals or hierarchy nodes by highlighting the key figure and choosing Edit from the context menu (right mouse click). A restricted key figure would be “Sales revenue in 1st quarter”, for example. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 7 of 62
  • 8. By placing the characteristics, key figures or structures either in the rows or columns directory of the Query Designer, you configure the first navigational state of the query (start view). In the lower right area you can see a preview of the results area of the query in the start view that you selected. You can change the arrangement of the key figures and characteristics in the rows and columns using Drag&Drop until the preview shows the results area you want. 5. When you have created the query, you can check the query definition by choosing Check Query from the toolbar. 6. Select the symbol for Query Properties from the toolbar if you want to change the Description, settings for Result Position , Display Options and Number Display , or Key Date for the query. See also Query Properties. 7. Save the query. Enter a Technical Name and a Description for naming the query. The Technical Name must uniquely identify the query, meaning that the name is allowed to appear only once across all InfoProviders of the Business Information Warehouse. The technical name can be up to 30 characters long and must begin with a letter. Result The query has been saved and you can now: · Add the query to a workbook in the BEx Analyzer: Choose Quit and Use Query · Display the query in the Web browser in a standard view: Choose Display Query on the Web. · Use the query in the Web Application Designer as a data provider for Web items. · Use the query in the table display in Crystal Reports as a data source for formatted reports You can analyze the query data in the Business Explorer. See also: Creating Reusable Structures Query Properties Properties of the Query Components Functions of the BEx Query Designer Displaying and Changing Existing Queries in the Query Designer Authorizations for the Query Definition !--a11y--> 1.2.1 Restricting Characteristics Use When defining a query, you can restrict characteristics to single characteristic values, value ranges, hierarchy nodes or characteristic value variables. Prerequisites You want to restrict a characteristic to one or more values in the query or restricted key figure definition. You have selected the characteristic and chosen Restrict from the context menu (secondary mouse click). Procedure When you select characteristics in the query definition, you can use the same functions as the F4 Help in the executed query. For the following functions, see the descriptions under Selecting Filter Values. · Selecting single values · Selecting value ranges · Selecting hierarchy nodes · Searching for values · Deleting values from the selection window · Excluding characteristic values · Displaying value keys You can choose from the following additional functions in the query definition: Selecting variables When you select characteristic values in the query definition, you can also select variables instead of fixed values. These act as benchmarks and are only filled with fixed values when the query is executed. Selecting single value variables 1. Choose Single Value in the top left area of the selection field and flat list in the top right. 2. Select the Variables tab page. 3. Select one (or, in exceptional cases, more than one) variable from the list of available variables displayed in the left-hand window, and drag the variable(s) PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 8 of 62
  • 9. into the Selection box on the right (alternatively, use the pushbutton with the arrow pointing to the right to move the values). Selecting value range limits 1. Choose Value Range from the top left of the selection field, and the operator that you want to use (top right). 2. Select the Variables tab page. 3. If you have chosen the operator Between , first select both the upper and lower interval limits from the list of available variables displayed in the left-hand window and drag them using Drag&Drop (or using the arrow pointing to the right) in the Selection window on the right-hand side of the screen. If you choose one of the operators Is greater than or equal to , Is less than or equal to , Is greater than, or Is less than , select a value from the list of available variables in the left-hand window, drag it across, and drop it into the Selection window on the right (alternatively use the button with the arrow pointing to the right to move the variable across into the Selection window). Selecting intervals with variables and a fixed limit 1. In the top left corner of the selection field, choose value range and between as operator. 2. Select the fixed limit on the Fixed Values tab. 3. Select the variable limit on the Variables tab. 4. Finally, choose the arrow button pointing to the right. Selecting intervals whose upper and lower limits refer to the same variable 1. In the top left corner of the selection field, choose value range and between as operator. 2. Select the required variable from the Variables tab page and drag it into the Selection box on the right (or use the arrow icon pointing to the right). 3. Now specify offsets for the upper and lower limits. (See below: Selecting variable offsets) Please note that you cannot combine other values, hierarchy nodes or variables with a variable of the type Selection option or Query variable . Selecting variable offsets You can only use this function for characteristic value variables of the type single value . 1. Select the required variable in the right-hand window. 2. Choose variable offsets from the context menu (secondary mouse click) . This brings you to the dialog window Entering Variable Offsets . 3. Enter the required offset. 4. Choose OK . You want to select the period of the last 5 years for evaluating your data. - In the top left corner of the selection field, choose value range and between as operator. - Select the variable current calendar year from the Variables tab page and drag it into the Selection box on the right (or use the arrow icon pointing to the right). - Choose variable offsets from the context menu (secondary mouse click) . The Variables – Offsets popup appears for both the upper and lower interval limits. - For the lower limit, enter the offset 5. - Do not enter an offset for the upper limit. - Choose OK . Swapping interval limits If you are using variables in the interval limits, you can swap the limits. 1. Select the required variable in the right-hand window. 2. Choose Swap Interval Limits from the context menu (secondary mouse click) . Selecting fixed/variable hierarchies/hierarchy nodes You can also restrict characteristics by hierarchy or hierarchy node, on a fixed or variable basis. See Restricting Characteristics: Hierarchies Excluding variable values You use this function to select the values that you do not need for your report. This function is only valid for single value variables and not for variable quantities. 1. Select the desired value in the right Selection window. 2. Choose Exclude from Selection from the context menu (secondary mouse click) . If you want to include the value in the selection again, choose Include in Selection from the context menu (secondary mouse click). Direct entry You cannot use this function if you want to restrict the characteristic. You cannot make a direct entry when you are selecting structure elements (for example, key figures) or values from a hierarchy. 1. In the entry field (bottom left) specify a characteristic value in external format. Instead of characteristic values in external format, you can also enter variables in the form of &<variable name>& (ampersand (&) at the beginning and at the end of the entry, and without blank spaces). 2. Choose the button with the arrow pointing to the right. The system checks whether this value exists. If the value does not exist, you get a warning. However, you can still use the value in the variable. Note the following conventions for making entries for value ranges and intervals: Value range: <operator><value>, for example, >= 1995 Intervals: <lower limit>;<upper limit>, e.g. A01; B99 PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 9 of 62
  • 10. Interval with a variable limit, for example, &VAR&;2000 Empty characters are not allowed in these fields. Result You have now restricted a characteristic by certain characteristic values. Choose OK .You return to the query definition. Save your entries and execute the query. If you have restricted a characteristic to a variable value, before the query is executed, a dialog box appears for you to enter variable values manually (provided that the variable is flagged as ready for input ). For more information, see Using Variables: The Variable Wizard and the Variable Editor. Enter the required values and choose OK . The query is now executed with the chosen values. The query is created according to your selection conditions. The selected characteristic values are displayed in the filter cells, on the right, next to the corresponding characteristic. Only the characteristic values you selected are included in the results area. !--a11y--> Restricting Characteristics: Hierarchies Use In the Query Designer, you can restrict characteristics by hierarchy or hierarchy node, on a fixed or variable basis. Choose from the following options: · Fixed hierarchy node – fixed hierarchy Report on department A (fixed hierarchy node) for the hierarchy valid for 1999 (fixed hierarchy) · Variable hierarchy node – fixed hierarchy Report on chosen department (variable hierarchy node) for the hierarchy valid for 1999 (fixed hierarchy) · Fixed hierarchy node – variable hierarchy Report on department A (fixed hierarchy node) for the hierarchy valid for the current calendar year (variable hierarchy). · Variable hierarchy node – variable hierarchy Report on a chosen department (variable hierarchy node) for the hierarchy valid for the current calendar year (variable hierarchy). Prerequisites You use this function if hierarchies exist for the characteristic that you want to restrict. For more information on hierarchies, see the Hierarchies section of the Administrator Workbench documentation. Procedure Fixed hierarchy – fixed hierarchy node 1. In the top left of the selection field, choose Single values and the required hierarchy from the top right corner. 2. Select the Fixed Values tab page. 3. In the list of available hierarchy nodes in the left-hand window, navigate to the hierarchy node you want to use. 4. Select the required hierarchy node and drag it into the Selection box on the right (or use the arrow icon pointing to the right). Next to the name of the hierarchy node you see the name of the hierarchy in brackets. Fixed hierarchy – variable hierarchy node 1. In the top left of the selection field, choose Single values and the required hierarchy from the top right corner. 2. Select the Variables tab page. 3. Select the required variable from the list of available variables on the left-hand side. 4. Select the required variable and drag it into the Selection box on the right (or use the arrow icon pointing to the right). Variable hierarchy – fixed hierarchy node 1. In the top left of the selection field, choose Single values and a hierarchy that contains the required hierarchy node, from the top right corner. 2. Select the Fixed Values tab page. 3. In the list of available hierarchy nodes in the left-hand window, navigate to the hierarchy node you want to use. 4. Select the required hierarchy node and drag it into the Selection box on the right (or use the arrow icon pointing to the right). 5. Highlight a hierarchy node in the right-hand box and choose Select variable hierarchy from the context menu (right mouse button). You reach the Select PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 10 of 62
  • 11. Variable for Hierarchy dialog box. 6. Select a variable hierarchy. See also: Selecting Hierarchies 7. Choose OK . Variable hierarchy – variable hierarchy nodes 1. In the top left of the selection field, choose Single values and a hierarchy that contains the required hierarchy node, from the top right corner. 2. Select the Variables tab page. 3. Select the required variable from the list of available variables on the left-hand side. 4. Select the required variable and drag it into the Selection box on the right (or use the arrow icon pointing to the right). 5. Highlight a hierarchy node in the right-hand box and choose Select variable hierarchy from the context menu (right mouse button). You reach the Select Variable for Hierarchy dialog box. 6. Select a variable hierarchy. See also: Selecting Hierarchies 7. Choose OK . Result You have restricted a characteristic according to a node within a hierarchy. Choose OK . This takes you back to the Query Designer. Save your entries and execute the query. If you have restricted a characteristic to a variable hierarchy and/or a hierarchy node, before the query is executed, a dialog box appears for you to enter variable values manually (provided that the variable is flagged as Ready for Input ). For more information, see Defining Variables with the Variable Wizard. Enter the required values and choose OK . The query can now be executed, with the values you have selected to fill the variable. !--a11y--> 1.2.3 Selecting Hierarchies Use You select hierarchies at the following stages in the query definition: · When you select a variable hierarchy for a hierarchy node (see also: Restricting Characteristics: Hierarchies). · When you select a display hierarchy for a characteristic (see also: Characteristic Properties). Prerequisites You use this function if hierarchies exist for the characteristic that you want to restrict. For more information on hierarchies, see the Hierarchies section of the Administrator Workbench documentation. If you have activated virtual time characteristics in the SAP Reference IMG for time characteristics, you can select virtual hierarchies when selecting hierarchies. For more information, see Activating Virtual Time Hierarchy. Procedure Selecting fixed hierarchies 1. Select the required fixed hierarchy from the list of available hierarchies. 2. Choose OK . You need this function only when you are selecting a fixed display hierarchy for a characteristic. Selecting variable hierarchies A hierarchy becomes variable if at least one of its elements (name, version, key date) is variable. 1. Select a hierarchy from the list of available hierarchies. 2. Choose the Variables radio button from the field on the right (name, version, key date) according to which you want to select for the hierarchy. The selection list now displays the available variables. 3. Select the variable you want to use. 4. Choose OK . Note that it is possible to fill the fields for version and key date, only if the characteristic has version-dependent or time-dependent hierarchies. You can also define new variables by choosing New Variables . The Variable Wizard appears. For more information, see Defining Variables with the Variable Wizard. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 11 of 62
  • 12. !--a11y--> 1.2.4 Defining Selections Use You can define a query by using Drag&Drop to drag the key figure of the InfoProvider into the Query Designer directories. If you move a key figure into the rows or columns, this key figure automatically becomes part of a structure. You can restrict (filter) the key figure in the structure using one or more characteristic selections. The key figure itself that is restricted by one or more characteristic selections can be a basic key figure, a calculated key figure or a key figure that is already restricted. Procedure Defining a new selection 1. If the query does not yet have any key figure structures, drag a key figure using Drag&Drop into a directory of the Query Designer. Alternatively, select the header of the directories for Rows or Columns and, using the secondary mouse button, select New Structure from the context menu. 2. Select the structure directory, and, using the secondary mouse button, choose New Selection from the context menu. The New Selection screen appears. There is a text field, in which you enter a description of the selection in the upper part of the screen. You can use Text Variables in the description. Underneath the text field, on the left, is the directory of all the objects available in the InfoProvider. The empty field for the definition of the new selection is on the right-hand side of the screen. 3. Using Drag&Drop, choose a key figure from the InfoProvider, and restrict it by selecting one or more characteristic values. See, Restricting Characteristics. You can also use variables in place of the characteristic values. However, note that you cannot use the following variable types in selection structure elements for technical reasons. ¡ Variables with the replacement with query processing type (see also Replacement Path: Replacement with Query) ¡ Variables that represent a precalculated value set (see also Detail Statements) You can use these variable types to restrict characteristics in the rows, columns or in the filter. 4. Choose OK . The new selection is defined in the structure. Editing selections 1. If you want to change the restriction on a key figure, select the key figure in the structure and from the context menu (secondary mouse click), choose Edit . The Edit Selection dialog box appears. 2. Make the required changes. 3. Choose OK . Marking selections as constant You can mark a selection in the Query Designer as constant. This means that navigation and filtering have no effect on the selection for the runtime. In this way, you can easily select reference sizes that you cannot change for the rest of the runtime. For more information, see Selecting Constants. Defining properties for the selection 1. Highlight the selection in the structure and, from the context menu, choose Properties . 2. Make the required settings for the technical name, description, display, number format, and calculations in the selection. See Selection/Formula Properties !--a11y--> 1.2.5 Defining Formulas Use You can recalculate the key figures in a structure using a formula. You can include basic key figures, restricted key figures, and calculated key figure in the formula definition. Procedure Defining a Formula 1. If the query does not yet have a key figure structure, create a New Structure in the Rows or Columns of the Query Designer by highlighting the row or column directory using the right mouse button and selecting New Structure from the context menu . PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 12 of 62
  • 13. 2. If the structure does not yet contain any key figures, use Drag&Drop to transfer a (basic) key figure of the InfoProvider into the directory of the new structure. 3. Select the structure directory, and choose New Formula . The formula definition screen appears. There is a text field, in which you enter a description of the formula in the upper part of the screen. You can use text variables in the description. The formula entry field is below the text fields. The bottom left screen area contains all of the operands available for defining the formula. These are: - The structure elements that you have already defined for the structure - The cells that you have defined as exception cells - All form variables On the right side of the screen, you see the functions that are available as operators: - Basic functions - Percentage functions - Data functions - Mathematical functions - Trigonometric functions - Boolean operators The symbols for the basic arithmetic operations are displayed between the operands and the functions. There is a number block to the right of the functions. Proceed as follows to define a formula: ¡ Choose the operands you want to use, and insert them in the entry field for the formula by double-clicking or by using Drag&Drop. ¡ Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the functions, or using Drag&Drop. ¡ Select the numerical values for the formula by clicking on the number block. You can also enter digits, parentheses and basic arithmetical operations using the keyboard. 4. Define your formula using the available operands and operators. If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight the Formula Variable entry and, from the context menu, choose New Formula . You reach the variable wizard. This takes you through a step-by- step process for defining a new variable. If you want to change a formula variable, select the variable and, from the context menu, choose Edit. The variable editor appears. Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect if, for example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless of the unit, use the function Value Without Dimension (Without Units). See Data Functions. 5. Check the formula definition and choose Formula Syntax Check . The Formula Syntax Check function checks only the correctness of the syntax in the formula. It does not check whether the formula makes sense semantically, for example, if it contains the same units. You make semantic checks using the function Check Query (see Functions of the BEx Query Designer). 6. Enter a description for the formula column. 7. Choose OK . The new formula is defined in the structure. Editing a Formula 1. Highlight the formula in the structure and, from the context menu, choose E dit . 2. Make the required changes. 3. Choose OK . Defining Properties for the Formula 1. Highlight the formula in the structure and, from the context menu, choose Properties . 2. Make the required settings for the technical name, description, display, number format, calculations, and formula collision in the formula. See Selection/Formula Properties See also: Technical Notes about the Formula Operators !--a11y--> 1.2.5.1 Percentage Functions Use These are functions that you can use as operators for defining a formula or a calculated key figure. Features PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 13 of 62
  • 14. Percentage Deviation (%) <Operand1> % <Operand2> This gives the percentage deviation between operand 1 and operand 2. It is identical to the formula 100 * (<Operand1> - <Operand2>) / abs(<Operand2>) , if <Operand2> does not equal 0 and the character for “Division by 0” if <Operand2> equals 0. Plan Sales % Actual Sales, expresses the difference between the plan sales and the actual sales as a percentage. Percentage Share (%A) <Operand1> %A <Operand2> This gives the percentage share of operand 1 and operand 2. It is identical to the formula 100 * <Operand1> / abs(<Operand2>) , if <Operand2> does not equal 0 and the character for “Division by 0” if <Operand2> equals 0. Character for “Division by 0”: See SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting Settings ® Display of Numerical Values in the Business Explorer. Fixed Costs %A Costs expresses the proportion of the total cost of a product that is the fixed cost. Percentage Share of the Result (%CT) %CT <Operand> This shows how high the percentage share is, with regard to the result. The result is the outcome of aggregating the second highest results level (interim result). If a characteristic has been drilled down upon in both the rows and the columns, this relationship is not unique, causing the system to display the warning, and relevant symbol for Data does not exis t. See SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting Settings ® Display of Numerical Values in the Business Explorer. Year Region Sales %CT ‘Sales’ 1999 North 30 50 South 30 50 Result for 1999 60 33.3333 2000 North 60 50 South 60 50 Result for 2000 120 66.6667 Overall Result 180 100 Percentage Share of the Overall Result (%GT) %GT <Operand> This shows how high the percentage share is, with regard to the overall result. The overall result is the outcome of aggregating the highest results level. Dynamic filters (filters that have not been determined already in the query definition) also play a role in calculating the overall result. Year Region Sales %GT ‘Sales’ 1999 North 30 16.6667 South 30 16.6667 Result for 1999 60 33.3333 2000 North 60 33.3333 South 60 33.3333 Result for 2000 120 66.6667 Overall Result 180 100 Percentage Share of the Query Result (%CT) This is much the same as %GT. Unlike the process of calculating the overall result, dynamic filters are not used in the calculation of the query result. This means that, independently of the filter status and the navigational state, the same value is always normalized. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 14 of 62
  • 15. !--a11y--> 1.2.5.2 Data Functions Use These are functions that you can use as operators for defining a formula or a calculated key figure. Features Value = 1 if operand <> 0, otherwise 0 (numerator) COUNT(<Expression>) Delivers the value 1 if the <Expression> is <> 0, otherwise 0. Processing a Value as a Date DATE The value is seen as the number of days from 00.01.0000 onwards and output as a date. The value can be between 0 and a million, which gives a date between 01.01.0000 and 27.11.2738. Value = 1 if operand = 0, otherwise 0 DELTA(<Expression>) Delivers the value 1 if the <Expression> is 0, otherwise 1. The function is identical to the NOT operator and should no longer be used. NDIV0 (x): Equals 0 when divided by 0, otherwise x NDIV(<Expression>) Is 0 if the calculation of <Expression> causes a division by 0. Otherwise, the result is the value of the expression. It is used to avoid error messages or so that you can continue to calculate a defined result. Values without Dimensions (without Units) NODIM(<Expression>) Delivers purely numerical values of <Expression> and suppresses units and currencies. Using this function, you can avoid the “mixed currency” character. See SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting Settings ® Display of Numerical Values in the Business Explorer. NOERR (x): Equals 0 for undefined calculations, otherwise x NOERR(<Expression>) Is 0 if the calculation of <Expression> leads to an arithmetical error. Otherwise, the result is the value of the expression. It is used to avoid error messages or so that you can continue to calculate a defined result. NOERR(SQRT(-1)) = 0 Result SUMCT <Operand> Delivers the result of the operands to all rows or columns (see also Percentage Functions % CT). Year Region Sales SUMCT “Sales” 1999 North 30 60 South 30 60 Result for 1999 60 180 2000 North 60 120 South 60 120 PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 15 of 62
  • 16. Result for 2000 120 180 Overall Result 180 180 Overall Result SUMGT <Operand> Delivers the overall results for the operands (see also Percentage Functions %GT). Year Region Sales SUMGT “Sales” 1999 North 30 180 South 30 180 Result for 1999 60 180 2000 North 60 180 South 60 180 Result for 2000 120 180 Overall Result 180 180 Query Result SUMRT <Operand> Delivers the query result of the operand. For more information about the difference between the overall result and the query result, see Percentage Functions ® %GT and %RT. Processing a Value as a Time TIME The TIME operator takes any key figure or (partial) formula in general and makes a TIME type key figure. Go to the formula editor and, for the operator, double-click the data function Process Value as Time and, for the operand, double-click the key figure you want. For example, the formula is then Time (Sales). The system cuts off the decimal places, interprets the value as seconds, and displays the value in the form +-hh:mm:ss. For example, -4812 is displayed as – 1:20:12. Any time is seen as seconds from 00:00:00 and output in hours, minutes and seconds. A TIME type key figure with value 0 is displayed as 00:00:00. Negative times are permitted: With a negative time the system calculates from 00:00:00 backwards. The number of hours can be any amount. After 24 hours the system restarts at 0. This function is designed for offset calculations, among other things. For example, if you need to deduct four hours with time key figures, then you can set the TIME operator. !--a11y--> 1.2.5.3 Boolean Operators Use These are functions that you can use as operators for defining a formula or a calculated key figure. Features Relational Operators (<, <=, <>, ==, >, >=) <Expression1> <Operator> <Expression2> The result is 1 if the relationship denoted by <Operator> between expression <Expression1> and <Expression2> holds (that is <Expression> <Operator> <Expression2> is true), otherwise the result is 0. Only numerical values of <Expression1> and <Expression2> are compared without taking units into account. Example: Costs < Sales delivers 1 if sales are greater than costs and 0 if costs are greater than or equal to sales. Logical AND (AND) <Expression1> AND <Expression2> The result is 1 if both <Expression1> and <Expression2> do not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1> and PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 16 of 62
  • 17. <Expression2> are considered, without taking units into account. Logical OR (OR) <Expression1> OR <Expression2> The result is 1 if <Expression1> or <Expression2> does not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1> and <Expression2> are considered, without taking units into account. Logical Exclusive OR (XOR) <Expression1> XOR <Expression2> The result is 1 if either <Expression1> or <Expression2> (but not both) does not equal 0. Otherwise the result is 0. Only the numerical values of <Expression1> and <Expression2> are considered, without taking units into account. Logical NOT (NOT) NOT <Expression> The result is 1 if <Expression> is 0, otherwise the result is 0. Only the numerical value of <Expression> is considered without taking units into account. LEAF The result is 0 for results rows or real (inner) nodes of a hierarchy, and the value 1 for elementary rows or the leaves of a hierarchy. This operator allows you to carry out various calculations on results rows and elementary rows. Conditional Calculations (IF-THEN-ELSE) You can make conditional calculations using Boolean operators An expression in the form IF<Logic Expression> THEN <Expression1> ELSE <Expression2> can also be made using a formula in the form <Logic Expression> * <Expression1> + NOT <Logic Expression> * <Expression2> Example: IF Actual Costs > Plan Costs THEN Plan Costs + Plan Deviation ELSE Actual Costs can be written as the following formula: (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (NOT (Actual Costs > Plan Costs) ) * Actual Costs or (Actual Costs > Plan Costs)* (Plan Costs + Plan Deviation) + (Actual Costs <= Plan Costs) * Actual Costs !--a11y--> 1.2.5.4 Technical Notes about the Formula Operators Test of <Expression> = 0 The test for whether a mathematical expression is 0 is used to avoid problems based on rounding operations through the inquiry abs (<Expression>) < 10**-6. In other words, all values in the interval [-10**-6, 10**-6] = [-0,000001; 0,000001] are taken as 0. Result for Non-Defined Mathematical Operations If an operation which is not allowed or not defined mathematically (for example, division by 0, square roots of negative values) is executed, the character for "division by 0" or "data does not exist" (see SAP Reference IMG ® Business Information Warehouse ® Reporting-relevant Settings ® General Reporting Settings ® Display of Numerical Values in the Business Explorer ) is given and is not calculated further. This means that all formulas in which the incorrect formula appears are not calculated. You can suppress this reaction that causes the expression to lead to errors by compounding the operators NDIV0() or NOERR() (see Data Function). When you use these operators, check that the result can be interpreted meaningfully by the user, even in the case of errors. ABAP Coding for Calculating Operators In problematic cases, take a look at the functions of the operators in the ABAP coding (include LRRK0F10, form LOC_RECHNEN). !--a11y--> 1.2.6 Defining Exception Cells Use When you define selection criteria and formulas for structural components and there are two structural components of a query, generic cell definitions are created at PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 17 of 62
  • 18. the intersection of the structural components that determine the values to be presented in the cell. Cell-specific definitions allow you to define explicit formulas, along with implicit cell definition, and selection conditions for cells and in this way, to override implicitly created cell values. This function allows you to design much more detailed queries. In addition, you can define cells that have no direct relationship to the structural components. These cells are not displayed and serve as containers for help selections or help formulas. Prerequisites The query contains two structures. You can define exception cells only for queries which have two structures. You can use the one structure for characteristic values and key figures for the other. You can then define cells if these prerequisites have been met. A cell is the intersection between two structural components. The term Cell for the function Defining Exception Cells should not be confused with the term Cell in MS Excel. The formulas or selection conditions that you define for a cell always take effect at the intersection between two structural components. If a drilldown characteristic has two different characteristic values, the cell definition always takes effect at the intersection between the characteristic value and the key figure. Procedure In the Query Designer toolbar, choose Define Cells... to reach the cell definition functions. New selection 1. Select a cell in the Cell Definition dialog box and, from the context menu, choose New Selection. 2. Define your selection by dragging a key figure and the characteristic values by which you want to restrict the key figure (using Drag&Drop) to the right-hand area of the New Selection dialog box. See also Defining Selections You can use characteristic value variables instead of fixed characteristic values. - If you want to change an existing variable, select this variable and, from the context menu, choose Edit. The SAP BW Variables Editor appears. For more information, see Changing Variables in the Variable Editor. - If you want to define a new variable, select the characteristic value and, from the context menu, choose New Variable . The SAP BW Variables Wizard appears. For more information, see Defining Variables with the Variable Wizard. 3. Enter a description for the selection. You can use Text Variables in the description. 4. Choose OK . The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell. New formula 1. Highlight a cell in the Cell Definition dialog box and, using the secondary mouse button, choose New Formula from the context menu . 2. Define your formula using the operands and functions available. See also Defining Formulas 3. Enter a description of the formula. You can use Text Variables in the description. 4. Choose OK . The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell. New cell reference You can use any cell that you define in a formula. If you want to reuse the value from the implicit, generic cell definition that is automatically created at the intersection of the two structural components of a query, select this cell in the Cell Definition dialog box and, using the secondary mouse button, choose New Cell Reference. A description taken from the two structural components now automatically appears in the cell. The symbol shows you that a cell reference exists for this exception cell. You can now reference to this cell. That is, you can reuse the implicit cell definition and do not have to create these values manually in a new selection. Functions of explicitly defined cells: Select a defined cell and choose the required function from the context menu (secondary mouse button). · Edit · Delete · Where-Used List Before you delete a cell, you can check for the formulas in which the defined cell is used in the where-used list. · Properties Choose Properties if you: - Want to change the description of the cell. - Want to change the highlighting of the cell. - Want to hide the cell. That is, if you do not want to see the values of the cell. Help Cells Choose Help Cells, if you require additional cells for help selections or help formulas. You can use the functions New Selection and New Formula in the context menu to define help cells that are not displayed in the query to serve only as objects for help selections and help formulas. For example, you can define an invoice in a help cell and use this in a “real” cell to calculate a duplicated invoice. a. Right-click on the empty cell next to Help Cells to get to a context menu. From here, choose New Selection. b. Use Drag & Drop to drag the Invoice key figure into the right-hand area of the New Selection dialog box. c. Enter a description. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 18 of 62
  • 19. d. Choose OK . The cell contains the description of the selection. The symbol shows you that a selection exists for this exception cell. e. From the context menu for the required cell of the query, now choose New Formula. f. Drag the cell you have just defined, which you can find in the Operands window, under Cells, into the Formula window using Drag & Drop. Click on the button twice. g. Enter a description. h. Choose OK . The cell contains the description of the formula. The symbol shows you that a formula exists for this exception cell. In the help cells that are already defined in the context menu, you can: · Edit the cell definition · Delete the cell definition · Display the where-used list for the cell · Change the description of the cell under Properties. Result You have defined one or more exception cells for a query. In the status bar of the Query Designer, the symbol shows you that the query contains exception cells. !--a11y--> 1.2.7 Save Queries Save queries You can save a query that you have changed under its current name using the function Save Query. In the Query Designer toolbar, choose Save Query. If the query does not yet have a technical name, the system offers the function Save Query As... automatically. Save query as... 1. If you want to save the query under a new technical name, in the Query Designer toolbar, choose Save Query As... 2. Enter the new technical name. This name must uniquely identify the query, meaning that the name is allowed to appear only once in the entire Business Information Warehouse. The technical name can be up to 30 characters long and must begin with a letter. 3. Enter a Description for the query. You can save the query in your favorites or roles. Result The query has been saved and you can now: · Display it in the Web browser with the Standard Web Template for Ad-hoc Analysis · Use the query in the Web Application Designer as a data provider for Web items. · Insert the query into a workbook in the BEx Analyzer · Use the query in the Crystal Report Designer as a data source for a formatted report !--a11y--> Using Variables: The Variable Wizard and the Variable Editor 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. 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. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 19 of 62
  • 20. 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. 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 . 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 Change Variable appears next to the Entry of Variables checkbox. You can change the variable using . The Variable Editor dialog box appears. · The symbol New Variable appears next to the Entry of Variables checkbox. Choose if you want to create a new variable. The Variable Wizard dialog box appears. 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. 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. !--a11y--> 1.3.1 Variable Types Definition The type of variable being used. This determines the object that the variable represents as a placeholder for a concrete value. Structure 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. · Characteristic Value Variables Characteristic value variables represent characteristic values and can be used wherever characteristic values are used. If you restrict characteristics to specific characteristic values, you can also use characteristic value variables. See, Restricting Characteristics. · Hierarchy Variables Hierarchy variables represent hierarchies and can be used wherever hierarchies can be selected. If you restrict characteristics to specific hierarchies or select presentation hierarchies, you can also use hierarchy variables. See Selecting Hierarchies · Hierarchy Node Variables Hierarchy node variables represent a node in a hierarchy and can be used wherever hierarchy nodes are used. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 20 of 62
  • 21. If you restrict characteristics to specific hierarchy nodes, you can also use hierarchy node variables. See Restricting Characteristics: Hierarchies · Text Variables Text variables represent a text and can be used in descriptions of queries, calculated key figures and structural components. You can use text variables in the description of calculated key figures, restricted key figures, selections and formulas when you create them. See Defining Calculated Key Figures, Defining Restricted Key Figures, Defining Selections, and Defining Formulas. You can change the descriptions in the properties dialog box. See Query Properties Calculated Key Figure Properties Restricted Key Figure Properties, and Selection/Formula Properties. · Formula Variables Formula variables represent numerical values and can be used in formulas. See Defining Formulas. In addition, numerical values are used for selecting exceptions and conditions and you can also use formula variables here. See Defining Exceptions and Defining Conditions You can use a formula variable for the interest rate in order to process the current interest rate, after you have executed the query or Web application. !--a11y--> 1.3.1.1 Using Text Variables Use Text variables represent a text and can be used in descriptions of queries, calculated key figures and structural components. When the system is replacing text variables, if it finds no values or multiple values for the reference characteristic and is thus unable to determine a unique value, the technical name is output as the result: &<technical name of the text variable>& Procedure Selecting existing text variables Choose to select an existing text variable. Changing existing text variables 1. If want to change an existing text variable, select the text variable in the Description field and click with the left mouse button on the selected text variable. 2. From the context menu that appears below the field, choose Change Text Variable. The SAP BW Variables Editor appears. For more information, see Changing Variables in the Variable Editor. Creating new text variables 1. In the Description field, enter an ampersand & . 2. From the context menu that appears automatically, choose New Text Variable. The SAP BW Variables Wizard appears. For more information, see Defining Variables with the Variable Wizard. !--a11y--> 1.3.2 Variable Processing Types Use The processing type of a variable determines how a variable is filled with a value for the runtime of the query or Web application. Features The following processing types are available: Manual Entry / Default Value Replacement Path Customer Exit SAP Exit Authorization Depending on the type of variable used (context-sensitive), the possible processing types are offered in the variable wizard. For more information about the possible combinations of variable types and processing types, see PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 21 of 62
  • 22. Overview of Variable Types and Processing Types. Activities In the variable wizard, in the General Information dialog step, choose the required processing type . !--a11y--> 1.3.2.1 Manual Entry / Default Value Use The processing type Manual Entry/Default Value enables you to enter a value manually or to use the default value when defining a variable. This value is then used for the variable when you execute the query or Web application. Integration The processing type Manual Entry / Default Value is available for all variable types. Features If you choose the processing type Manual Entry/Default Value for a variable, when you execute the query, you can enter the required value for the variable manually in a dialog box (the Variables Screen ) provided that the variable is ready-for-input. Otherwise, the default value of the variable is used. When you create the variable, you can enter a default value if you wish. If you enter a default value, this is shown in the input field of the variables screen for variables that are ready-for-input. For variables that are not ready-for-input, the default value is used as the variable value. Activities In the variable wizard, in the General Information dialog step, choose the processing type Manual Entry/Default Value. In the Default Value dialog step, enter a value as required. !--a11y--> 1.3.4.3 Replacement Path Use You use the Replacement Path to specify the value that automatically replaces the variable when you execute the query or Web application. Integration The processing type Replacement Path can be used with characteristic value variables, text variables and formula variables. Features Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value. The variable wizard takes you automatically to the Characteristic dialog step, in which you select the reference characteristic for replacement. In the Replacement Path dialog step that follows, you choose whether the variable is replaced by the From or the To Value and the Key or the Name of the characteristic value. You can also specify the offset start and offset length for the output. Characteristic value variables with the processing type Replacement Path, are replaced by the results of a query. In the Replacement Path dialog step, select the query whose result you want to use as the variable. You can now use the data result of the selected query as a variable in a different query. The processing type Replacement Path takes place automatically, meaning it is never ready-for-input when executing. Activities In the variable wizard in the General Information dialog step, choose the processing type Replacement Path. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 22 of 62
  • 23. Example If you specify a variable as a characteristic value, you do not have to give a text for the characteristic value right away. Instead, you can fill the text field dynamically, according to the characteristic that you use for the variable when you execute the query. To do this, define a text variable with automatic replacement. !--a11y--> 1.3.2.3 Customer Exits Use If you need to use a processing type other than manual entry / default value, replacement path, SAP exit , or authorization, then a customer exit gives you the option of setting up a processing type for variables, tailor-made to your specific needs. The customer exit is designed as an enhancement that you can configure with customer-specific logic. You can find detailed information about customer exits and their use in the Enhancements to the Standard section of the BC Changes to the SAP Standard documentation. Integration You can process all variable types (characteristic value variables, hierarchy node variables, hierarchy variables, formula variables and text variables) using the Customer Exit processing type. Prerequisites You have created a project in the CMOD transaction. You have selected SAP enhancement RSR00001 and assigned it to the enhancement project. You have activated the project. In SAP Enhancement Help, you can get further information on working with the SAP enhancement for global variables in reporting. Call up the transaction SMOD. Enter the name of the enhancement (RSR00001), choose Documentation and then Edit ® Display Sub-object. You can find general information about working with customer exits under Help ® Application Help in transaction CMOD . Features The Customer Exit processing type for variables allows you to use a function module exit to set default values for variables. The function module EXIT_SAPLRRS0_001 is used here . You want to use one characteristic value to calculate a second characteristic value. The InfoProvider only contains the calendar day. However, you now also want to see in a query the cumulated value for the relevant period (beginning with the first day of a quarter). For the first day of the quarter, use a variable with customer exit processing. If you now enter the current calendar day (19.06.2000, for example), a start date of 01.06.2000 appears in the customer exit, and the cumulated value of this period can be displayed. Item Sales 19.06.2000 Sales – 01.06.2000 – 19.06.2000 A 5 263 B 7 157 C 2 67 Activities In the variable wizard, in the General Information dialog step, choose the processing type Customer Exit. See also: Dependencies for Variables of the Customer-Exit Type !--a11y--> Dependencies for Variables of Type Customer Exit Use PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 23 of 62
  • 24. The variable exit may not executed or false data may be selected when executing a query that contains variables with the replacement path Customer Exit, filled dependently of the entry-ready variables. As a preemptive measure, you can control the dependencies with the parameter I_STEP. Features The enhancement RSR00001 ( BW: Enhancements for Global Variables in Reporting ) is called up several times during execution of the report. Here, the parameter I_STEP specifies when the enhancement is called up. The following values are valid for I_STEP: · I_STEP = 1 Call up takes place directly before variable entry · I_STEP = 2 Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1. · I_STEP = 3 In this call up, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called up again. · I_STEP = 0 The enhancement is not called from the variable screen. The call up can come from the authorization check or from the Monitor. Values of other Variables When calling up the enhancement RSR00001 ( BW: Enhancements for Global Variables in Reporting), the system transfers the currently available values of the other variables in table I_T_VAR_RANGE. The table type is RRS0_T_VAR_RANGE and the row type RRS0_S_VAR_RANGE references to the structure RRRANGEEXIT. This structure has the following fields: Field Description VNAM Variable name IOBJNM InfoObject name SIGN (I)ncluding [ ] or (E)xcluding ] [ OPT Operators: EQ =, BT [ ], LE < =, LT <, GE > =, GT >, CP and so on. LOW Characteristic value HIGH Upper limit characteristic value for intervals/the node-InfoObject for hierarchy nodes. Activities A variable that is to be filled dependently of an entry-ready variable must never be filled in step I_STEP=1. Now you are at a position prior to the variable entry. Values have not yet been entered for the entry-ready variables. You can insert the following statements to force the variable to be executed with I_STEP=2 and not I_STEP=1. CASE I_VNAM. … IF I_STEP <> 2. RAISE no_processing. ENDIF. … !--a11y--> 1.3.2.4 SAP Exit (delivered variables) Use The SAP Exit processing type is contained in variables delivered by SAP BW within the Business Content framework. Integration You can find the delivered variables in the Metadata Repository if you search for variables using the search function (see Searching for Metadata ). The technical name of a delivered SAP object always begins with a number. Prerequisites Before you can use delivered variables you must first activate them. You can get further information on activating the query objects under Installing Business Content. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 24 of 62
  • 25. Features SAP delivers a number of variables. There are variables that are processed via automatic replacement using a predefined replacement path ( SAP Exit processing type). If you want to define a query that only ever displays the data from the current month, drag the delivered variable “current month” (technical name 0CMONTH) for the characteristic value “current month” (technical name 0CMONTH) into the query filter. Activities In the variable wizard in the General Information dialog step, choose the processing type SAP Exit. You can only create variables with the processing type SAP Exit in SAP Systems. Customers cannot create any variables with the processing type SAP Exit. For customers, variables with SAP Exit are a part of the delivered Business Information Warehouse Business Content. !--a11y--> 1.3.2.5 Authorization Use The processing type Authorization enables variables to be filled with values automatically from the user authorization. Integration The processing type Authorization can be used with characteristic value variables and hierarchy node variables. Prerequisites You have maintained the authorizations in transaction RSMM. Features When you create a variable, if you choose Process with Authorization , the variable is automatically filled with the values of the user's authorization. When the user opens a query, the data is selected automatically according to his or her authorizations. Note that when they are automatically filled, variables do not have to be ready-for-input, which means a variables screen does not necessarily appear when you open the query or Web application. The user opens the query with the authorization variable, and can see only the data that corresponds to his or her authorizations. Activities In the variable wizard in the General Information dialog step, choose the processing type Authorization. !--a11y--> 1.3.3 Overview of Variable Types and Processing Types Use In the variable wizard, you choose a processing type that is dependent on the type of variable you are using. Depending on the variable type, only certain processing types are useful. The variable wizard offers you automatically only the possible processing types and takes you to the relevant settings for the chosen processing type using different dialog steps. Features The following table gives an overview of the possible combinations of variable types and processing types. The dialog steps that the variable wizard offers for PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 25 of 62
  • 26. each combination are also listed. Variable Type/Processing Type Manual entry / default value Replacement Path Customer Exit or SAP Exit Authorization Characteristic Value Variable Details Default Values Replacement Path: Replacement with Query Details Details Hierarchy Variable Details Default Values Details Hierarchy Node Variable Details Default Values Details Details Text Variable Details Default Values Characteristic Replacement Path: Replacement with a Characteristic Value Details Formula Variable Details Currencies and Units Default Values Characteristic Replacement Path: Replacement with a Characteristic Value Currencies and Units Details Currencies and Units !--a11y--> Defining Variables with the Variable Wizard Use The variable wizard takes you through the process of defining a variable step-by-step. Procedure 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 Overview of Variable Types and Processing Types. Introduction The first dialog step in the variable wizard explains that you can define variables as placeholders instead of using fixed values. These placeholders are then filled during the query runtime. If you do not want to see this step in the future, select Do not display this step in future. General Information The second dialog step shows the type of variable. You determine the type of variable by calling up the variable wizard in a specific context. If you have chosen, for example, New Variable in the context menu of a characteristic value, then Characteristic Value is shown automatically in the variable wizard as the variable type. For more information about context-sensitivity in the variable wizard, see Using Variables: The Variable Wizard and the Variable Editor. 1. Enter a variable name and a description for the variable. The variable name is the technical name of the variable and has to be unique across all queries. 2. In the Processing by field, choose the processing type for the variable. Depending on the type of variable, only the processing types that are relevant for this variable type appear for you to choose from in the dropdown box. For more information, see Variable Processing Types. 3. In the Characteristic field, select the InfoObject on which the variable is to be based. As standard procedure, define variables on the basic InfoObject . You are also able to select the InfoObject that references the basic InfoObject, and define the variable on that InfoObject, by using the dropdown box. The ability to define variables both on the basic InfoObject and on derived InfoObjects permits a higher level of reusability for variables. Because InfoSets contain many InfoObjects with the same basic InfoObject, it makes sense to define variables on the basic InfoObject particularly when using InfoSets as the InfoProvider for the query. In your BW system you have defined the characteristic CUSTOMER and have derived a further characteristic from this: MANUFACTURER. Both characteristics have the same variables. When you create new variables you can choose whether the variables are to reference CUSTOMER or MANUFACTURER. Both the variables that were created for MANUFACTURER and the variables that were created for CUSTOMER are listed in the left-hand selection box of the query designer InfoProvider object under the characteristic MANUFACTURER. The following dialog steps are context-sensitive: Depending on the variable type and processing type that you have chosen, the relevant dialog step appears. This is where you can make the necessary PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 26 of 62
  • 27. settings. · Details · Default Values · Replacement Path · Characteristic · Currencies and Units Saving Variables In the last dialog step, you get a summary of the settings for the variable. Choose Exit . The system saves the variable and closes the variable wizard. Result You have defined a variable. The changed variable can now be used in all queries. !--a11y--> 1.3.4.1 Details Definition Dialog step in the variable wizard that appears for almost all types of variable. Only those variables with the processing type Replacement Path do not require this dialog step. Structure In the Details dialog step, you can set the following options: The individual options for the settings here vary depending on the variable type and the processing type. The following section lists all of the settings. The variable wizard automatically displays only those settings that are useful and available. Variable Represents This is where you choose the display area that the variable represents. · Single Value The variable represents one value only. · Multiple Single Values The variable represents a number of single values. This setting is useful in hierarchy nodes, for example, to allow you to enter several single nodes. · Interval The variable represents the interval between a specific ‘from’ value and a specific ‘to’ value. · Selection Option The variable represents any combination of single values and intervals. In the variables screen where you select values for variables, you can also work with operators (>,<,=, and so on), search by specific criteria (for example, search for all values that begin with A) and exclude certain values (by specifying which values not to search for). For more information, see Default Values · Precalculated Value Set The variable represents a set of values that were precalculated with a query by the Reporting Agent. The available values are those values that were precalculated to the characteristic of the variable (for example 0SOLD_TO Sold-to Party ) or its basic characteristic (for example 0CUSTOMER Customer ). Such a variable can also be ready for input. During runtime you can select various value sets in the variable screen. For more information, see Defining the Value Set Setting. Please note that variables that represent a precalculated value cannot be used in restricted key figures or in selection structure elements for technical reasons. Variable Value Is · Optional This setting means that the variable does not have to be filled with a value during runtime. Variables with the processing type Authorization have the standard setting Variable Value is Optional . Therefore, the variable wizard does not offer you selection options, such as Optional , Obligatory , and Obligatory, Initial Value Not Permitted , for variables that are filled from the authorization. · Mandatory This setting means that at least one value has to be specified for the variable during runtime. The initial value (#) is permitted explicitly. The initial value # means “unassigned”, that is, you can use it to explicitly select all data records in which this characteristic has no characteristic values. · Mandatory, Initial Value Not Allowed This setting means that at least one value has to be specified for the variable during runtime. The initial value (#) is not permitted. This means that you have to enter one or more values in the variable screen to be able to execute the query. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 27 of 62
  • 28. Ready for Input Here you determine whether or not the variable is set to “ready for input” when you execute the query or the Web application. If, when you execute the query or the Web application, the Ready for Input option is active (this is the default setting), a dialog box appears (the variables screen). You either specify the value or values that you want to use, confirm the default values, or change the default values. You can deactivate the Ready for Input option if you want to fill the variable with a value beforehand. When you execute the query or the Web application, it is filled automatically with a value. If you set the variable as not ready for input, but have set the variable value as mandatory and have not specified a default value, the system cannot execute the query and an error message is displayed. The Ready for Input option is available for the following processing types; manual entry / default value, customer exit, SAP exit, and authorizations. Can Be Changed with Query Navigation If you choose the Can Be Changed with Query Navigation option, after you have run the query, not only are you able to select the values that you specified in the variables screen, but you are also able to use other values as dynamic filters for the query (see also: Selecting Filter Values). Note that this function is not possible if you are using the variable as part of a structure in the query definition. The system ignores the setting Can Be Changed with Query Navigation in this case. You can use this function for variables of characteristic values and hierarchy nodes. For more information on this topic see Special Features of Variables that can be Changed Dynamically. Copy Personalization Data from Variable Each user can personalize the variable values for variables that are ready for input. The personalized values are saved for each variable and each user. If you want to use the same personalization data in more than one variable, in the input field, specify the names of the variables under which the personalization data is stored. Note that you have to specify the variable without an ampersand &. You have defined a “Customer 1” variable that is mandatory and ready for input. You now want to define a “Customer 2” variable that is mandatory (blank value not allowed), ready for input and that can be changed in query navigation. By making the Copy Personalization Data from Variable “Customer 1” setting in the “Customer 2” variable, you give both variables the same personalized value. Length of Input Field In the dialog step Details for text variables, there is a setting for Length of Input Field. Specify a number here. This determines the number of characters of text that the user can specify to represent the variable. !--a11y--> Special Features with Dynamically Changeable Variables Use The Changeable with Query Navigation function allows you to override the variables entry by selecting the dynamic filter. When using a dynamically changeable variable, that is, a variable with the activated function Changeable with Query Navigation in a query in connection with a free characteristic, you can override the variable entry with the dynamic filter. In other words, you can also access values that are not found in the value area of the variable entry. The values entered for the variables are only used to parameterize the dynamic filter for the start list. This function is only available for characteristic value variables in the free characteristics. When using such a variable in the filter, it behaves like a “normal” variable that cannot be changed. When refreshing a workbook in the BEx Analyzer that contains a changeable variable, this variable does not appear in the variable screen, since the values have already been set in the dynamic filter and also displayed. For this reason, the value of such variables are also no longer displayed in the text elements for the variable values. Constraints When using a dynamically changeable variable for a compounded characteristic, the variable values cannot be dynamically changed when executing the query and the variable behaves like a fixed variable. It some cases, it is not technically possible to make the variable technically changeable. The system then treats the variable like a fixed variable. In such cases, a system message appears, which explains to you that the variable is set to not changeable. The following cases lead to the variable being set to not changeable: · The superior characteristic is restricted by a dynamically changeable variable. The subordinate characteristic is either set using a fixed variable or a fixed value. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 28 of 62
  • 29. Example: The cost center is compounded to the controlling area. The cost center is set using a fixed variable or fixed value. The controlling area is restricted by a dynamically changeable variable. This variable is converted into a fixed variable. · Both the superordinate and the subordinate characteristic is restricted with a dynamically changeable variable. In this case, the variable for the superordinate characteristic is converted. Example: For dynamically changeable variables for the cost center and controlling area, the variable for controlling area is set to non-changeable. · Both characteristics have been given a dynamically changeable variable. In addition, the subordinate characteristic is restricted to a fixed value. In this case, both variables are set to non-changeable. Example: The cost center is set to 1001001 and given a dynamically changeable variable. At the same time, the controlling area is also given a dynamically changeable variable. Both variables are treated as non-changeable variables. · You are using a dynamically changeable hierarchy node variable and choose not to set the presentation hierarchy uniquely. The node variable is also treated as a non-changeable variable in this case. Note: When refreshing variables that have been set as fixed, the system may display no data . Activities Note the following when using the Changeable with Query Navigation function : · A variable can only be changed in the query definition when it is only used in a drilldown characteristic and when there are no other restrictions to this characteristic aside from these variables. · No additional characteristic is allowed to be compounded with a variable to the affected characteristic. · For hierarchy node variables, the hierarchy must match the presentation hierarchy that has been set up. · The characteristic value is not allowed to be moved, for example offset –1. In addition, the variable is no longer changeable with the query navigation. !--a11y--> 1.3.4.2 Default Values Definition Dialog step in the variable wizard for variables with the processing type Manual Entry / Default Value Use You specify one or more default values when you define a variable. These then appear in the variables screen when you execute the query or Web application. If the variable is ready-for-input, you can overwrite the default value in the variables screen and select a different value. If the variable is not ready-for-input, the query is filled with the default value and you cannot change the value when you execute the query or Web application. Structure Depending on which setting you have chosen in the Details dialog step, the variable wizard offers various fields in the Default Values dialog step. · If the variable represents a single value, you can enter one default value here. · If the variable represents several single values, you can enter or select a default value here. a. Choose . The selection dialog box appears. b. In the left window Fixed Values , highlight the value and select it by clicking on the arrow pointing to the right. · If the variable represents an interval, you can enter a default value manually for the From Value and a default value for the To Value, or select the default values using . · If the variable represents a selection option, you have the following options for settings: a. In the +/- Sign field, choose either Include Value or Exclude Value b. In the Option field, select one of the following settings: - Is equal to - Is not equal to - Is between (is in the interval) - Is not between (is not in the interval) - Is less than or equal to - Is greater than - Is greater than or equal to - Is less than - Contains the pattern - Does not contain the pattern Depending on the setting that you selected in the Option field, context-specific options are given for the default value. c. Enter a default value manually or select it using . If you have chosen the option Contains the pattern or Does not contain the pattern , do not enter a purely numerical value as the default value, but enter PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 29 of 62
  • 30. characters such as ABC or *. If you choose Include Value and Contains the pattern *. * appears as the default value. If you choose Exclude Value and Contains the pattern *. Everything but * appears as the default value. · If the variable represents a precalculated value set, you have to enter the technical name of the value set created in the Reporting Agent as the default value. This value set contains the required precalculated values from the Reporting Agent background reporting. For more information about pre-calculating value sets, see Defining the Value Set Setting. You can enter only one default value. !--a11y--> 1.3.4.3 Replacement Path Definition A step in the variable wizard that appears for characteristic value, formula and text variables with the processing type Replacement Path . Structure According to the type of variable, you can make different settings for the replacement path. · Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value. See Replacement Path: Replacement with a Characteristic Value. · Characteristic value variables with the processing type Replacement Path, are replaced by the results of a query. See Replacement Path: Replacement with a Query. !--a11y--> Replacement Path: Replacement with a Characteristic Value Definition A step in the variable wizard that appears for formula and text variables with the processing type Replacement Path . Use Text and formula variables with the processing type Replacement Path are replaced by a corresponding characteristic value. The value of a formula variable has to be a number. The value of a text variable has to be a text. Structure Here you choose the characteristic or attribute value with which the variable is replaced. Replace Variable with · Key The variable value is replaced with the characteristic key. · External Characteristic Value Key The variable value is replaced with an external value of the characteristic (external/internal conversion). · Name (Text) The variable value is replaced with the name of the characteristic. Note that formula variables have to contain numbers in their names so that the formula variable represents a value after replacement. · Attribute Value The variable value is replaced with the value of an attribute. An additional field appears for entering the attribute. When replacing the variable with an attribute value, you can create a reference to the characteristic for which the variable is defined. Choose the attribute Reference to Characteristic (Constant 1). By choosing this attribute, you can influence the aggregation behavior of calculated key figures and obtain improved performance during calculation. You can find additional information under Properties of the Calculated Key Figure under Aggregational Behavior and under Calculating with Variables for Processing Type “Replacement Path”. This setting is only available for formula variables. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 30 of 62
  • 31. · Hierarchy Attribute The variable value is replaced with a value of a hierarchy attribute. An additional field appears for entering the hierarchy attribute. You need this setting for sign reversal with hierarchy nodes. For more information, see Sign Reversal This setting is only available for formula variables. For Intervals Use · From-value · To-value · Difference If the replacement value called is an interval, you use this setting to specify whether the lower interval limit (from value) or the upper interval limit (to value) is used as the replacement value. For formula variable, you can also choose the interval difference as the replacement value. Using this setting, you can easily calculate the difference of period boundaries. The interval difference is the from value minus the to value plus 1. For example, the period January to March gives a result of 3 (the to value 3, minus the from value 1, plus 1) Offset Start and Offset Length You use this setting to specify the start and length of the text output. You want to create a text variable for the fiscal year. In the replacement path Dialog Box, choose the option Replace Variable with Key and enter the offset start at value 2 and the offset length as 2. The fiscal year is four digits; the output of the value begins after the second digit and shows 2 digits. Therefore, in the executed query, the text variable for fiscal year 1997 is replaced by the value “97”. For more examples of the offset start and the offset length, see Variable Replacement Example. Evaluate as Boolean (Value 0 or 1) This function is only available for formula variables. If you select this setting, the formula variable is not replaced by a value (for example, the key value) but gives the existence of a value. · The value of the variable is 0 when the value to be replaced is a string with only blank spaces or a zero. · The value of the variable is 1 when the value to be replaced is a string with characters that are not blank spaces or a number does not equal 0. You want to calculate paid amounts only. a. In the Replacement Path dialog step, choose the option Replace Variable with an Attribute Value. b. Enter the attribute Paid. (The master data attribute Paid shows open invoices with a blank space “ “ and paid invoices with the value “X”.) c. Select Evaluate as Boolean (Value 0 or 1) For empty spaces you get the a 0 and for the value “X” you get a 1. Multiplication by such a formula variable means that all unpaid amounts are omitted from the query and you are only calculated paid amounts. !--a11y--> Calculating Variables for Processing Type “Replacement Path” Use In formulas it is possible to calculate with the properties or values for a characteristic (such as a key, an external attribute of the key, an attribute value, or a hierarchy attribute). In doing so, the formula is replaced, depending on the cell context. Features For example, the basic characteristic Sales Quantity multiplies with the current value for the attribute Price for the characteristic Material . You can reach this with the corresponding, defined formula variable: Processing type Replacement Path , replacement from characteristic Material , replace variable with Attribute Value : Attribute Price . The replacement of formula variables with the processing type Replacement Path acts differently in calculated key figures and formulas: · If you use a formula variable with “ Replacement from the Value of an Attribute ” in a calculated key figure, then the system automatically adds the drilldown according to the reference characteristic for the attribute. The system then evaluates the variables for each characteristic value for the reference characteristic. Afterwards, the calculated key figure is calculated and, subsequently, all of the other operations are executed, meaning all additional, calculated key figures, aggregations, and formulas. The system only calculates the operators, which are assembled in the calculated key figure itself, before the aggregation using the reference characteristic. Note that the calculation before the aggregation can impair performance. · If you use a formula variable with Replacement from the Value of an Attribute in a formula element, then the variable is only calculated if the reference characteristic is uniquely specified in the respective row, column, or in the filter. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 31 of 62
  • 32. Integration Replacement from the Value of an Attribute With formula variables you can set the processing type Replacement from the Value of an Attribute and create a reference to the reference characteristic for the variable. The attribute Reference to Characteristic (Constant 1) is a dummy attribute that is available with each characteristic. It serves to create a reference to the characteristic, by which it does not need to be aggregated. By choosing this attribute, you can influence the aggregation behavior of calculated key figures in a targeted way and can improve performance during calculation. Example Example for calculating with variables for process type Replacement from the Value of an Attribute : Master data table for material InfoCube In the example query there are the following objects: Material Price (V1) is a variable that is replaced by the material price. K1 = Material Price (V1) is a calculated key figure. F1 = Material Price (V1) is a formula. K2 = Material Price (V1) * Sales Quantity is a calculated key figure. F2 = Material Price (V1) * Sales Quantity is a formula. K3 = K1 * Sales Quantity is a calculated key figure in which the calculated key figure K1 is further processed. Query View 1 Query View 2 In the results rows the columns F1 and F2 are not specified, because the material value is not unique. Also, the system cannot calculate F1 and F2 in the overall Query View 2. K1 only aggregates the prices and K3 multiplies these aggregated prices with the aggregated sales quantities. Usually the results from K1 and K3 have no meaning. The calculated key figure K2 delivers the desired results. !--a11y--> 1.3.4.3.1.2 Variable Replacement Example The following example shows the replacement options you have for the characteristic value with regard to the setting Key / External Characteristic Value of the Key in connection with the offset start and offset length: Fiscal Year Variant K4 Fiscal Year / Period 2002/008 PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 32 of 62
  • 33. Fiscal Year 0FISCYEAR Fiscal Year / Period 0FISCPER Internal display (key) K42002 K42002008 External display (external characteristic value of the key) K4/2002 K4/008.2002 Internal Display (Key) Fiscal Year 0FISCYEAR For the Key setting for the Fiscal Year 0FISCYEAR characteristic, you have to set the offset start at 2 and the length as 4. In the query, K42002 is replaced by the value 2002. Fiscal Year / Period 0FISCPER For the Key setting for the Fiscal Year / Period 0FISCPER characteristic, you have to set the offset start at 2. If you want to display on the year in the text output, choose the offset length 4. K42002008 is replaced by 2002 in the query. If you want to display the year and the period in the text output, choose the offset length 7. 2002008 in the query replace K42002008. Overview 0FISCYEAR Offset start 2 Offset length 4 0FISCPER Offset start 2 Offset length 4 for year Offset length 7 for year and period External Display (External Characteristic Value of the Key) Fiscal Year 0FISCYEAR For the External Characteristic Value of the Key setting for the Fiscal Year 0FISCYEAR characteristic, you have to set the offset start at 3 and the length as 4. In the query, K4/2002 is replaced by the value 2002. Fiscal Year / Period 0FISCPER For the External Characteristic Value of the Key for the Fiscal Year / Period 0FISCPER, you have to make the following settings for the offset start and the offset length: If you want to display only the year in the text output, choose the offset start 7 and the offset length 4. K4/008.2002 is replaced by 2002 in the query. If you want to display only the period in the text output, choose the offset start 3 and the offset length 3. 008 in the query replace K4/008.2002. If you want to display the year and the period in the text output, choose the offset start 3 and the offset length 8. 008.2002 in the query replace K4/008.2002. Overview 0FISCYEAR Offset Start 3 Offset Length 4 0FISCPER Offset length 7 for year Offset start 3 for period Offset start 3 for year and period Offset length 4 for year Offset length 3 for period Offset length 8 for year and period !--a11y--> Replacement Path: Replacement with Query Definition A step in the variable wizard that appears for characteristic value variables with the processing type Replacement Path . Use Characteristic value variables with the processing type Replacement Path are replaced by the results of a query. Select the query whose result you want to use as the variable. You can now use the data result of the selected query as a variable in a different query. Please note that, for technical reasons, variables with processing type Replacing from a Query cannot be used in restricted key figures or in selection structure elements. Example You want to insert the result for the query Top 5 products as a variable in the query Sales – Calendar year / month . 1. Select the characteristic Product and from the context menu, choose New Variable. The Variable Wizard appears. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 33 of 62
  • 34. 2. Enter a variable name and a description. 3. Choose the processing type Replacement Path . 4. Choose Next . You reach the Replacement Path dialog step. 5. Enter the query Top 5 Products . 6. Choose Next . You reach the Save Variable dialog step. 7. Choose Exit . You are now able to insert the variable into the query Sales – Calendar year / month. This allows you to determine how the sales for these five, top-selling products has developed month for month. Every time you execute the query Sales – Calendar year / month , the query Top 5 Products is executed beforehand (= pre-query). This can lead to long run times. If you do not need to execute the pre-query (that is, if you do not have to determine the top 5 products every time because change monthly, for example), we recommend that you use a variable that represents a pre-calculated value set. For more information, see Details Defining the Value Set Setting. !--a11y--> 1.3.4.4 Characteristic Definition A step in the variable wizard for text and formula variables with the processing type Replacement Path . Use Some variables require a characteristic reference as a reference to the context in which they are used. The characteristic is usually determined from the context (for example, with characteristic value variables). The characteristic reference is not shown for text and formula variables with the processing type Replacement Path. Therefore, you have to choose a characteristic here to which the variable relates. !--a11y--> 1.3.4.5 Currencies and Units Definition A dialog step in the variable wizard for use with formula variables. Use Formula variables usually represent numbers without dimensions. You can select a dimension indicator so that the formula variable represents a dimension such as amount, quantity or price. Depending on the dimension, you can determine a currency or a unit. Structure You can choose from the following dimensions: Amount If you choose Amount as the dimension, you can select a currency. Quantity If you choose Quantity as the dimension, you can select a unit. Price If you choose Price as the dimension, you can select a currency and a unit. (Price = Currency/Unit) Number (=default setting) If you choose Number as the dimension, you do not need to make any further entries. Date If you choose Date as the dimension, you do not need to make any further entries. !--a11y--> PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 34 of 62
  • 35. 1.3.5 Changing Variables in the Variable Editor Use The variable editor dialog box offers all of the selection options for changing an existing variable. Procedure The individual fields of the dialog box reflect the steps in the variable wizard and show the current settings in the variable. Depending on the type of variable and the processing type (context-sensitive), only the relevant fields and settings are shown. Make the required changes and choose OK . If you want to make the changes using a step-by-step process with explanatory texts, you can jump to the variable wizard using . For more information, see Defining Variables with the Variable Wizard. Result You have changed the variable. The changed variable can now be used in all queries. !--a11y--> 1.3.6 Examples for Using Variables In this section you can find examples for using variables. Examples for Offset Variables You want to use a query to carry out a comparison of two years. Year Comparison You want to compare the costs of a year of your choice with the costs of the previous year. 1. In the Query Designer, create a new structure and add a new Selection for each year that you require. 2. Only use one key figure (for example revenue) in this example query. Add this key figure to the filter or add it to the selection. 3. Use a characteristic value variable for the characteristic Calendar Year (0CALYEAR): Select the characteristic value variables for Calendar Year and, from the context menu (right mouse click), choose New Variables. The Variables Wizard appears. If you always want to reference to the current year automatically, use the SAP Exit variable 0CALYEAR (or as appropriate for another time characteristic). 4. Move the defined characteristic value variable into the selection. 5. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict. a. Select the characteristic value variable and from the context menu, choose Enter Variable Offsets. b. Enter –1 as the offset and choose OK. 6. Choose OK . 7. Enter a description. Example: Use the name of the key figure, for example, revenue, for the name and use a text variable for the name of the calendar year. See Using Text Variables. When creating a new text variable, enter Replacement Path as the processing type, and choose calendar year 0CALYEAR as the characteristic with display as key. 8. Create a second selection with the same characteristic value variable and do not set an offset here. Also use a text variable in the description in this case. 9. Move the required characteristic into the rows. 10. Save the query. After execution, the query should appear as follows: Variable screen entry: 2002 (or no entry when using the SAP Exit Variable). Year Comparison A characteristic Revenue 2001 Revenue 2002 Value 1 100.000 90.000 Value 2 200.000 180.000 Value 3 300.000 400.000 PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 35 of 62
  • 36. … … … Comparison with Cumulative Previous Year Period For example: You want to compare the periods 1-8 of a particular year with the same periods for the previous year. 1. Create a new structure in the Query Designer and add a new Selection. 2. Move a key figure, for example, Revenue, into the selection. 3. Use a characteristic value variable for the characteristic Fiscal Year/Period (0FISCPER): Select the characteristic value variables for Fiscal Year/Period and from the context menu, choose New Variable. The Variables Wizard appears. Use the SAP Exit variable Current Fiscal Year/Period (0FPER) if you always want to reference to the current year. If you set the variable as entry-ready in the Variable Editor, after executing the query, the variable screen then appears with which you can change the default values were necessary. 4. Move the characteristic value variable, such as OFPER, into the selection. 5. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict. 6. Under Selection, choose Value Area and choose the tab page Variables. 7. Add the characteristic value variable, for example 0FPER, to the selection once again for the second value of the interval. 8. Select the characteristic value variable and from the context menu, choose Enter Variable Offsets. a. As an offset, enter -3 as the from value and 0 as the to value. Choose OK. b. Choose OK . 9. Enter a description, such as Revenue for current year. 10. Choose OK . 11. Select the selection and from the context menu, choose Copy and then Paste. 12. Now select the second selection and from the context menu, choose Edit. 13. Select the characteristic value variable and from the context menu (right mouse click), choose Restrict. 14. Select the characteristic value variable again and from the context menu (the right hand button), choose Enter Variable Offsets. a. As an offset, enter -15 as the from value and -12 as the to value. Choose OK. b. Choose OK . 15. Enter a description, for example Revenue for previous year. Also use a text variable in the description in this case. 16. Choose OK . 17. Move the required characteristic into the rows. 18. Save the query. After execution, the query should appear as follows: Variable screen entry: 01. 2002 to 08. 2002 Comparison with Cumulative Previous Year Period A characteristic Revenue 01. – 08. 2001 Revenue 01. – 08. 2002 Value 1 100.000 90.000 Value 2 200.000 180.000 Value 3 300.000 400.000 ... ... ... Two text variables replaced with characteristic values were used for the descriptions here. One is filled with the from-value for the column with an offset of 0 and a length of 3, the other filled with the to-value with an offset of 0 and a length of 7. You can find additional information under Example for Variable Replacement. Comparison of Cumulated Values for Two Years You may want to compare the cumulated values up to the current period of the current year with those of the previous year. For this example, use the variable 0FPER ( current fiscal year period) and the variable 0P_FPER ( your chosen fiscal year period). You use these two variables to set the interval limits. 1. In the Query Designer, create a structure with two selections: ¡ 1. selection: Cumulative Amount for current year ¡ 2. selection: Cumulative amount for previous year 2. With the first selection (cumulative amount for current year) , move the time characteristic 0FISCPER into the selection and select it. 3. Choose Restrict from the context menu (right mouse click) . 4. Choose Value Area between as the selection and go to the tab page Variables. 5. Double click to choose the variable 0P_FPER as the from value and variable 0FPER as the to value. The result is an interval from the chosen period to the current period. 6. Define the second selection (cumulative amount for previous year) and proceed as for the first selection. ¡ Add the variable 0P_FPER as the from value and variable 0FPER as the to value here. ¡ Set an offset of –12 for both the from and the to values: Select the interval and from the context menu (right click), choose Enter Variable Offsets. Enter –12 for each. The result is an interval that has been moved 12 periods ahead. 7. Add the key figures and additional characteristics for the query. After executing the query, you get a variable screen for the variable 0P_FPER. You need to enter the start period in the current fiscal year. You can also suppress this entry by deactivating the indicator Entry-ready in the Variable Editor for the variable 0P_FPER and entering a default value (for example, 001.2001 for 2001). You only have to change this value once per year. You have now defined a query that compares the cumulative values for two years. The variables with SAP Exit delivered by SAP have the following behaviors: Variable 0FPER ( current fiscal year period): Displays the values of the current fiscal year period. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 36 of 62
  • 37. Variable 0P_FPER ( any fiscal year period ): Displays the values of any fiscal year period. You can set the fiscal year period in the variable screen when executing the query in any way you require. Variable 0FYTCFP ( fiscal year up to current fiscal year period): Displays the values of the first period up to the current period of the current fiscal year. Variable 0FYTLFP ( fiscal year up to previous fiscal year period ): Displays the values of the first period up to the previous period (current period –1). You need to use the variables 0FPER and 0P_FPER in the above example for the comparison of cumulative values for two years. When using the variables 0FYTCFP and 0FYTLFP, only values for one month are displayed for year transitions with an offset of –12. !--a11y--> 1.4 Query Properties Use You can make various settings for your query in the Query Properties dialog box. Features The Query Properties dialog box is divided into three tab pages, each covering different settings. Tab Page: General Technical Name The technical name of the query is displayed. InfoProvider This is where the technical name of the InfoProvider, on which the query is based, is displayed. Description You can enter or change the query description here. You can use Text Variables in the description. You can also enter the query description when you save the query. Key Date Each query has a key date. For time-dependent data, the key date determines the time for which the data is selected. The default key date value is the date on which the query is executed, that is < Today>. 1. Choose . The Date Selection dialog box appears. 2. Choose a date from the calendar and use the arrow button to add it to the selection window on the right. If you select 01.01.1999 for example, time-dependent data is read up to 01.01.1999. 3. Choose OK . You can also select a variable key date: 1. In the Date Selection dialog box, choose the Variables tab page. 2. Choose a variable and use the arrow button to add it to the selection window on the right. In the selection, you may need to know the technical names of the queries as well as their descriptions. In the Description window on the left hand side, choose Technical Names from the context menu (secondary mouse click) . If you want to create a new variable, in the Description window on the left-hand side, choose New Variables from the context menu (secondary mouse click). The Variable Wizard dialog box appears, where you can create new variables . If you want to change a variable, in the Description window on the left-hand side, select the variable and choose Change Variable from the context menu (secondary mouse click). The Variable Editor dialog box appears, where you can change variables . 3. Choose OK . The key date only applies to time-dependent master data. Sequence of Entry Variables Any entry variables the query contains are listed here. You can use the two arrow buttons to the right of the field to determine the sequence in which the variables appear in the variable screen when executing the query. Last Changed This is where you can see details of the owner of the structure, the person who last changed the structure, and the corresponding date and time that the query was changed. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 37 of 62
  • 38. Tab Page: Display Display Options The following settings are possible: · Adjust format after refresh The setting is useful in the BEx Analyzer and is the default setting. Formatting for the query underlines the type of data contained in a cell, highlighting the structure of the delivered results. As a rule, the position and size of the cell area in the results area of the query changes when the query is refreshed. The function Adjust Format After Refresh guarantees that the format is adjusted after the updated query data is refreshed. You can deactivate the function for adjusting the format, for example, if you want to display the data more quickly, or if you use a workbook with your own format template. For more information, see Formatting · Suppress repeated key values Here you can determine whether or not identical key figures are to be displayed in duplicate in the query. The setting Suppress Identical Key Values is active by default, so that only the first key value is displayed for each characteristic and additional, identical key values are suppressed. The key value is the value with which the characteristic is presented. This can be the characteristic description or the characteristic key. You can determine how the characteristic is to presented in the Characteristic Properties. In the following example, the Suppress Identical Key Values is activated: Region Order Sales DE A 14,900 EUR B 15,800 EUR C 17,600 EUR USA A 12,800 EUR C 32,800 EUR In the following example, the Suppress Identical Key Values is deactivated: Region Order Sales DE A 14,900 EUR DE B 15,800 EUR DE C 17,600 EUR USA A 12,800 EUR USA C 32,800 EUR · Display Scaling Factors for Key Figures Key figures can have scaling factors and units/currencies. Normally, units/currencies are displayed for every key figure, but not the scaling factors. If you activate the Display Scaling Factors for Key Figures, an additional header row is added to the row or column header. Information about the scaling factor and currency/unit appears in this additional header row, as long as it is consistent (for example, 1,000 EURO). This setting is deactivated by default. In the following example, the Suppress Identical Key Values and Display Scaling Factors for Key Figures is activated: Region Order Sales 1,000 EUR DE A 14 B 15 C 17 F D 12 E 32 · Display document links For metadata, master data, and InfoProvider data for a query, you can display links to Documents that you have created for these objects. If documents exist for these objects, the symbol appears next to these objects. If you click on this symbol, you jump to where the document is displayed on the Web. Highlight the appropriate setting so that the document links for the desired document class are displayed. The document classes are oriented to the various categories of BW objects. InfoProvider data, metadata and master data. See Document Classes. For more information, see Using Documents in Web Applications. · Display Drag&Relate links When activating this setting, the symbol appears alongside the Drag&Relate-enabled InfoObjects in a Web application that serve as DataProviders for this query. This setting is necessary for you to be able to recognize Drag&Relate-enabled InfoObjects in an Enterprise Portal and to use the Drag&Relate function. For more information about the Drag&Relate function, see Drag&Relate with BW Content in the Enterprise Portal. Number Display The following settings are possible: PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 38 of 62
  • 39. · Results position This is where you determine where the result is displayed. - Bottom (for rows) right (for columns) (=default setting) - Bottom (for rows) left (for columns) - Top (for rows) right (for columns) - Top (for rows) left (for columns) · +/- sign display Here you determine how the minus sign is displayed. The following display options are available for negative values: - -X = the minus sign is positioned before the value (=default setting) - X- = the minus sign is positioned after the value - (X) = negative values are displayed in parentheses · Display zeroes The following display options are available for displaying zeroes: - Display Zeroes: Zeroes are displayed with the currency/unit, for example 0,00EUR. This is the default setting. - Zeroes without Currency/Unit: Zeroes are displayed without a currency or unit entry, that is, 0,00. - Do Not Display Zeroes: Cells containing a zero value remain empty. - Display Zeroes As...: Choosing this setting activates the Display Zeroes As field. You are now able to enter the required value (character, number or letter), for example *. The cells containing a zero value are filled with this value. Suppressing zeroes You can use this setting to determine whether columns or rows containing zeros are to be displayed. The following options are available to you under Suppression : · No : Rows or columns with zeroes are displayed. · Active : If characteristics are in the rows and columns, every row or column that has a result of zero is not displayed. The rows or columns include, for example, the values 1, -1, 1, -1 and thus the result is 0. If you select this setting, the whole row or column is not displayed. · Active (all values = 0): Columns or rows containing zero values in all cells are not displayed. Under Effect on , define whether suppression of zero values should be applied to rows and columns, only to rows or only to columns. Tab Page: Specific Release for OLE DB for OLAP External reporting tools that communicate using the OLE DB for OLAP interface use queries as data sources. If you want to release this query as a data source for external Reporting tools, select Allow External Access to this Query. Note: Queries containing formulas with the operators %RT, %CT, %GT, SUMRT, SUMCT, SUMGT, and LEAF cannot be released for OLE DB for OLAP. These operators are dependent on how the list is displayed in the BEx Analyzer and the formulas return unexpected values when using OLE DB for OLAP or MDX. You may be able to obtain the required result by selecting constants. For more information, see Selecting Constants. For more information about using formula operators, see Defining Formulas. For more information about OLE DB for OLAP, see Mapping Metadata. Document Pushbutton You can use the Documents button to get to the available documents that relate to the query in the Administrator Workbench. You can also create new documents for the query here. For more information, see Documents and Creating Documents . Activities You call up the properties dialog box for a query by clicking on Query Properties in the Query Designer toolbar. !--a11y--> 1.5 Properties of Query Components Use The various components of a query have specific properties that depict important functions. Features The following dialogs are available to set properties of query components: · Characteristic Properties · Attribute Properties · Structure Properties · Selection/Formula Properties PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 39 of 62
  • 40. · Restricted Key Figure Properties · Calculated Key Figure Properties Activities You call up the properties dialog box in the Query Designer from the context menu of a component of the query. Place the cursor over a query component, click the secondary mouse button and choose Properties. !--a11y--> 1.5.1 Characteristic Properties Use You can set a range of functions in the Characteristic Properties dialog box for a specific characteristic, such as order type. These settings then affect all key figures for this characteristic in a query drilldown. Features Description The name of the characteristic appears automatically here. You can overwrite this text. The new text is different to the text provided in the InfoObject maintenance and is used in the query display. Technical name The technical name of the characteristic is displayed here. Display as You can determine here whether and in which format you want to present the individual characteristic values of the characteristic. · (Standard) : The standard display type for characteristic values corresponds to the setting in InfoObject maintenance under Tab Page: Business Explorer. · No Display : The characteristic display is hidden. This function is useful, for example, with the Currency/Unit characteristic since the currencies are also shown in the key figures. · Key and Text : The characteristic values are shown by their technical key and by their text. · Text : The characteristic values are shown by their text. · Key : The characteristic values are shown by their technical key. · Text and Key : The characteristic values are shown by their text and by their technical key. Once you have made a setting in display type that contains text, you can select which text type you want to set in the dropdown box below. The following options are available: · Standard: The shortest available text for the characteristic values is used as the text . · Short text: The short text for the characteristic values is used as the text . · Long text: The long text for the characteristic values is used as the text. · Medium Text: The medium text for the characteristic values is used as the text. In the dropdown box for display type, the system offers the setting options as follows: § (Standard), No Display and Key are always offered. § Key and Text, Text, Text and Key are offered additionally if any text (short, medium or long) was created for this characteristic. In the dropdown box for text type, the system offers only those texts for selection that were created in the InfoObject Maintenance for the Characteristic. See Tab Page: Master Data/Texts. Results Display Suppress Results Rows Here you can choose whether to suppress the results rows Never, Always or Only for One Value. Only for One Value means that only those results rows are suppressed that aggregate only one value, that is, the value and the result are identical and the results row repeats the same value. Normalize to You can set the normalization for a specific characteristic here. The display affects the key figures displayed in the drilldown by displaying the query data as normalized for the relevant result that you chose for the normalization. That is, the percentage display in relation to the result is displayed. The normalization process refers to a particular characteristic each time, and has various independent settings for each characteristic. Normalization for the characteristic only has an effect when the characteristic is in the drilldown. You can choose from the following settings: You can choose whether and for which result you want to normalize the values for this characteristic. · No Normalization · Result All values are normalized to the result. The result equals the total result if there is only one characteristic in the drilldown. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 40 of 62
  • 41. · Overall Result All values are normalized to the overall result. If there are several characteristics in the drilldown, there are different results that are combined to form an overall result. · Query Result All values are normalized to the query result. Each key figure for a query has a query result. This is the result of the key figure that results from the aggregation of all characteristics for the query. The overall result and the query result are identical, providing that none of the characteristics are in the filter. The values of the results row and the overall results row are not displayed as percentages, but as absolute values. Since the function Normalize to affects all key figures here, unwanted results are often delivered. To avoid this, we recommend that you set the Normalize to function for each key figure. For more information, see Calculate Single Values As.... Cumulated If you choose this function, the system sorts the list in ascending order according to key. All the structure elements (key figures) are subsequently aggregated to the n+1 characteristic value, one after the other, for each of the n th characteristic values. With time characteristics, the missing characteristic values are included wherever necessary. The following example illustrates the concept of Cumulated function: Values Cumulated Values 1 1 2 3 3 6 4 10 If you subsequently choose a different sorting method for this function, the numbers become difficult to make sense of. Do not use the cumulated display function with more than one characteristic. Since the function Cumulated affects all key figures here, unwanted results are often delivered. To avoid this, we recommend that you set the function Cumulative for each key figure. For more information, see Calculate Single Values As.... Sorting Here you can set the sorting within the characteristic according to the Key or Name in Ascending or Descending order. If a characteristic has attributes, you can sort the characteristic by attribute. The attribute involved does not have to be chosen for the display. You want to sort your articles according to specific criteria. To do this, you create an attribute for the Article characteristic that contains these criteria and you can now sort the articles by this attribute. By default, the values are sorted as they are defined in the query definition. If you have not specified a filter value in the query definition, the system sorts the values according to the key. Presentation hierarchy You can present the characteristic hierarchically. Choose to select a hierarchy. The hierarchy is flagged automatically as an active presentation hierarchy. When you deactivate the Active selection box, the characteristic is displayed in the query not as a hierarchy but as a basic list. If you restrict the characteristic to a hierarchy node, the node hierarchy is adopted automatically as the presentation hierarchy. You can deactivate the presentation hierarchy here if necessary. You can set the sorting within the hierarchy according to the Key or Name in Ascending or Descending order. If you do not make any entries, the values are sorted as determined in the hierarchy. Each hierarchy has certain properties that you specify in the hierarchy definition. You can override the following hierarchy properties for the current hierarchy: · Expand to level In the column B (user settings), select the checkbox and enter a numerical value for the hierarchy level that you want to expand the hierarchy to. · Position of lower-level nodes In column B (user settings), select the checkbox and choose whether you want to position lower-level nodes Down or Up . Choose Up if, for example, you want to see the overall result at the bottom. · Values of posted nodes In column B (user settings), select the checkbox and choose whether you want to Display or Suppress the values of posted nodes. In hierarchies, nodes always display the aggregated values of the subordinate nodes and leaves. If a node has a posted value, you cannot see this. To display this posted value, an additional leaf is inserted that has the same name as the node. This leaf displays the value posted to the node. In the following example, you can see that for cost center A1, an additional leaf has been inserted and that the value of cost center A1 itself, namely 10, is displayed. This additional leaf does not exist in the hierarchy. You can display or suppress this leaf (with the value of the posted node). PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 41 of 62
  • 42. · Nodes with only one lower-level node In column B (user settings), select the checkbox and choose whether you want to Display or Suppress the values of nodes with only one lower-level node. Suppressing nodes with only one lower-level node helps you to reach the more detailed information quickly. In the following example, Cost Center A and Cost Center A.1. contain the same information since Cost Center A has only one lower-level node in the hierarchy. If you are interested in the detailed data for the individual cost centers, you can suppress the uppermost node with only one lower- level node as this does not contain any additional information. Activities Drag a characteristic into a directory in the Query Designer (rows, columns, free characteristics or filter), select it and, from the context menu, choose Properties. You get to the Characteristic Properties dialog box. !--a11y--> 1.5.2 Attribute Properties Use You can set display functions in the Attribute Properties dialog box for a specific attribute for a characteristic. Features Description The name of the attribute appears automatically here. You can overwrite this text. The new text is different to the text provided in the InfoObject maintenance and is used in the query display. Display As You can determine here whether and in which format you want to present the individual attribute values of the attribute. · (Standard) : The standard display type for attribute values corresponds to the setting in InfoObject maintenance under Tab Page: Business Explorer. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 42 of 62
  • 43. · No Display : The attribute display is hidden. · Key and Text : The attribute values are shown by their technical key and by their text. · Text : The attribute values are shown by their text. · Key : The attribute values are shown by their technical key. · Text and Key : The attribute values are shown by their text and by their technical key. Once you have made a setting in display type that contains text, you can select which text type you want to set in the dropdown box below. The following options are available: · Standard: The shortest available text for the attribute values is used as the text. · Short text: The short text for the attribute values is used as the text. · Long text: The longest text for the attribute values is used as the text. · Medium Text: The medium text for the attribute values is used as the text. In the dropdown box for display type, the system offers the setting options as follows: § (Standard), No Display and Key are always offered. § Key and Text, Text, Text and Key are offered additionally if any text (short, medium or long) was created for this attribute. In the text type dropdown box, the system offers only those texts for selection that were created for this attribute in the InfoObject maintenance. See Tab Page: Master Data/Texts. Technical name The technical name of the attribute is displayed here. Activities Select an attribute for a characteristic and choose Properties from t he context menu (secondary mouse click). You get to the Attribute Properties dialog box. !--a11y--> 1.5.3 Structure Properties Use In the Structure Properties dialog, you can change the description of a structure and get information on the technical name and the last changes made to the structure. Features Technical name If the structure has been saved as a reusable structure, the technical name of the structure is displayed here and you can no longer change it. You can enter a technical name for local structures. However, this is optional. Note that the technical name must be unique across all queries. For access from external interfaces (such as Crystal Reports, from URLs or using OLE DB for OLAP), a technical name is necessary for structures, since the structure is considered a table field and has to be uniquely accessible. If you do not enter a technical name, the unique ID (UID) is used for access from external interfaces for uniquely identifying the structure. However, the UID has 25 characters, which can lead to problems when you change queries. You can change the technical name. When you do so, a warning appears that tells you that when you use the structure in external interfaces, the references can be destroyed. Description The name of the structure appears automatically here. You can overwrite this text. Applying zero row/column suppression to this structure also If you made a setting for zero row/column suppression in the query properties, this setting is not transferred automatically to the structures that you use in the query. If you do not want to suppress rows or columns that contain zeros for this structure, select Also Apply Zero Row/Column Suppression to This Structure. For more information about the setting options for Suppressing Zero Rows/Columns , see Query Properties. Last changed This is where you can see details of the owner and person who last changed the structure, as well as the corresponding data and time that the structure was changed. This information can be useful since structures deal with reusable objects. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 43 of 62
  • 44. Activities Select the structure and choose Properties from t he context menu (secondary mouse click). The Structure Properties dialog box appears. !--a11y--> 1.5.4 Selection/Formula Properties Use In the dialog box Selection/Formula Properties for a structural component, you can set a range of functions. This setting is valid for the structural component, irrespective of whether the structural component is in the rows or columns. Features Technical Name You can enter a technical name for the structural component. However, this is optional. Note that the technical name must be unique across all queries. Access from external interfaces (such as Crystal Reports, from URLs or using OLE DB for OLAP), a technical name is necessary for structural components, since the structural component is considered a table field and has to be uniquely accessible. If you do not enter a technical name, the unique ID (UID) is used for access from external interfaces for uniquely identifying the structural component. However, the UID has 25 characters, which can lead to problems when you change queries. You can change the technical name. When you do so, a warning appears that tells you that when you use the structural component in external interfaces, the references can be destroyed. Description The name of the key figure, the restricted key figure (selection) or the formula appears here automatically. You can change the description here. In contrast to characteristics and attributes, structural components can contain several rows as the description. The total number of all characters in all rows, including the line-end character is restricted to 60 characters. You can use Text Variables in the description. Layout Highlighting Here you can choose whether you want to highlight the selection or formula. The type of highlighting depends on the style used in the BEx Analyzer or in the Web application. Hiding Here you can adopt the following settings to hide the selection or formula: · If you choose Always Show then the selection or formula is always visible. · If you chose Hide (can be shown) then the selection or formula is hidden in the report executed, but can be shown there again in future. This setting is useful for displaying only the necessary information in the start view of the report. You can show additional details if required. You can show the selection or formula in the report executed in the following ways: ¡ in Web applications under Select Filter Value ¡ in the BEx Analyzer under Selecting Filter Values and Changing Queries (local view) · If you choose Always Hide , the selection or formula is not displayed. You can use this setting for help columns that are not visible in the report executed and can also not be shown. Selecting constants Moreover, you can mark a selection as constant here. This means that the selection cannot be changed by navigation or filtering for the runtime and can therefore be used as a reference size. For more information, see Selecting Constants. Number Display You can set a scaling factor of 1 to a billion. If, for example, you set 1,000, the value 3,000 is shown in the report as 3. You can set the number of decimal places. The number can have either no decimal places or up to nine decimal places (0, 0.0, 0.00... to 0.000000000). The standard settings for the scaling factor and the number of decimal places correspond to settings that you have made in the InfoObject maintenance under Tab Page: Additional Properties Also see Priority Rule with Formatting Settings Select Reverse +/- Signs if you want to display the numbers as negative values. A positive number receives a minus as a sign (for example, 85 becomes – 85) or a negative number receives a plus (for example, -38 becomes +38). The reversal of plus and minus signs is purely a display function. If, for example, the key figure is added to a formula, it is calculated with its PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 44 of 62
  • 45. correct values. See also: Priority Rule with Formatting Settings Calculations You use this function to recalculate the results rows and single values that are displayed in the query according to particular criteria. Calculate Results As... Calculate Single Values As... Cumulated You use this function to cumulate the individual cells in an area. The first value is added to the second value, the result is added to the third value, and so on. In the columns, the cells are cumulated from top to bottom, and in the rows, the cells are cumulated from left to right. With blocks of single values, that is, a drilldown in both the rows and the columns, the values are cumulated from top to bottom and from left to right. Be careful that cumulation only operates with characteristic values and not with the structural elements of a characteristic structure. The Cumulated function is only effective if you have a characteristic instead of a characteristic structure in the drilldown. However if you have two structures – the key figure structure and a characteristic structure – then you cumulate using cell-specific definitions. See Defining Exception Cells Calculation direction Default calculation directions are not always as expected. You can change the calculation direction as required: · Use the default direction (from top to bottom and from left to right) · Calculate along the rows (from top to bottom) · Calculate along the columns (from left to right) The Calculate along the columns setting is useful, for instance, for all queries for which a time dimension is drilled down in the columns, and a cumulated output is to be created. This is shown in the following example query: Also apply to results You can also use the chosen recalculation on the results rows under Calculate Results as... or Calculate Single Values as... Note that you cannot use the following functions for hierarchy lists (for active display hierarchies), and they do not work for the characteristic with the hierarchy. - Calculate ® Result as - Calculate ® Single Value as ® Ranked list / Ranked list (Olympic) - Calculate ® Cumulated Currency Translation The Currency Translation function is not offered in the formula properties dialog box. You create translation keys for Currency Translation under SAP Menu ® Administration ® Settings ® Translation Keys. For more information, see Creating Currency Translation Keys. You can set a target currency for a structural component in the Query Designer. Select a translation key in the Translation Key dropdown box. According to how the currency translation key has been created, you have the following options: · Select the target currency when translating The target currency is not fixed in the translation key but can be determined when translating. Select the required translation key and enter the Target Currency in the dropdown box. You can also select a currency from the dropdown box. Moreover, you can also select, create or change a variable target currency. a. Select Variables Entry. The variable target currencies appear in a dropdown box. b. Select a variable. § You can change the variable using . The Variable Editor dialog box appears. For more information, see Changing Variables in the Variable Editor. § Choose if you want to create a new variable target currency. The Variables Wizard dialog box appears. For more information, see Defining Variables with the Variable Wizard. When you execute the query, the variable dialog box appears, in which you can choose the target currency. · Fixed target currency The target currency was determined the translation key. Select the required translation key with the fixed target currency. In the Target Currency dropdown box, the fixed target currency for this translation key appears. · InfoObject determines target currency The target currency is determined in the translation key so that it is determined from an InfoObject. Select the required translation key with the target currency from the InfoObject. · Target currency from variable A variable for 0CURRENCY was specified in the translation type. In the Target Currency field, when this translation type is selected, the text from variable appears. You can find additional information on currency translation under Currency Translation in the Business Explorer. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 45 of 62
  • 46. Formula Collision The Formula Collision function is offered ONLY in the formulas property window. When you define two structures, which both contain formulas, it is unclear to the system how to calculate the formulas at the point where both formulas intersect. The following example clarifies the concept of formula collision: Column 1 Column 2 Column 1 x Column 2 Row 1 Value A Value B A x B Row 2 Value C Value D C x D Row 1 + Row 2 A + C B + D ? Formula Collision? In this example, there are two rows and two columns with simple values, the third row is a simple summation formula and the third column is a simple multiplication. In the cell in which the row and column formulas meet, it is not clear which calculation should be made. If you calculate according to the column formula in this cell, the cell contains (A+C)x(B+D). If you calculate according to the rows formula in this cell, the cell contains (AxB)+(CxD). The result gives a different value. If a formula collision occurs, as described in the example above, you can determine which formula is used in the calculation. You can make the following settings in the Formula Collision field: · Nothing defined If you do not make a definition, the formula that was set last takes priority in a formula collision. Setting means that you defined and saved the formula. · Result of this formula The result of this formula has priority in a collision · Result of competing formula The result of a competing formula has priority in a collision Collisions always occur when point and dash calculations or functions are mixed in competing formulas. If there is only dash calculation or point calculation in both formulas, both calculation directions give the same result. Therefore, no settings are required for formula collision. Activities Select the structural component and choose Properties from t he context menu (secondary mouse click). The Selection/Formula Properties dialog box appears. !--a11y--> 1.5.5 Restricted Key Figure Properties Use In the Properties of the Restricted Key Figure dialog box, you can set a range of functions. Features Technical name The technical name of the restricted key figure is displayed. Description The name of the restricted key figure appears automatically here. You can change the description here. The total number of all characters in all rows, including the line-end character is restricted to 60 characters. You can use Text Variables in the description. Number display You can set a scaling factor of 1 to a billion. If, for example, you set 1,000, the value 3,000 is shown in the report as 3. You can set the number of decimal places. The number can have either no decimal places or up to nine decimal places (0, 0.0, 0.00... to 0.000000000). Currency translation You create the translation types for currency translation in the Administrator Workbench. For more information, see Creating Currency Translation Keys. You can set a target currency for a restricted key figure in the Query Designer. Select a translation key in the Translation Key dropdown box. According to how the currency translation key has been created in the Administrator Workbench, you have the following options: PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 46 of 62
  • 47. · Select the target currency when translating The target currency is not fixed in the translation key in the Administrator Workbench but can be determined when translating. Select the required translation key and enter the Target Currency in the dropdown box. You can also select a currency from the dropdown box. Moreover, you can also select, create or change a variable target currency. a. Select Variables Entry. The variable target currencies appear in a dropdown box. b. If you want to use an existing variable, select a variable. You can change the variable using . The Variables Editor dialog box appears. For more information, see Changing Variables in the Variable Editor. c. If you are want to create a new target currency variant, choose Create. The Variables Wizard dialog box appears. For more information, see Defining Variables with the Variable Wizard. When you execute the query, the variable dialog box appears, in which you can choose the target currency. · Fixed target currency The target currency is determined in the translation key in the Administrator Workbench. Select the required translation key with the fixed target currency. In the Target Currency dropdown box, the fixed target currency for this translation key appears. · InfoObject determines target currency The target currency is determined in the translation key in the Administrator Workbench so that it is determined from an InfoObject. Select the required translation key with the target currency from the InfoObject. Last changed This is where you can see details of the owner and person who last changed the restricted key figure, as well as the corresponding date and time that the restricted key figure was changed. This information can be useful since restricted key figures are reusable. Activities Select the restricted key figure and choose Properties from the context menu (secondary mouse click). You reach the Properties of the Restricted Key Figure dialog box. !--a11y--> 1.5.6 Calculated Key Figure Properties Use In the Key Figure Properties dialog box, you can make settings for a range of functions for a calculated key figure. Features You can select the following functions in the Selection/Formula Properties dialog box: · Description · Layout · Number Display · Calculations · Currency Translation For more information about these functions, see Selection/Formula Properties. In addition, you can select the following functions in the Key Figure Properties dialog box. Last Changed This is where you can see details of the owner and person who last changed the structure, as well as the corresponding data and time that the key figure was changed. This information can be useful since calculated key figures deal with reusable objects. Aggregation Behavior In the Key Figure Properties dialog box, choose Enhance >>. The Aggregation Behavior field is added to the dialog box. You can make settings for the aggregation of the calculated key figure and the time that the calculated key figure is calculated here. Depending on the complexity of the formula, you can select various settings in the enhanced properties of the calculated key figure. The following types of calculated key figures with the corresponding formula complexity are available: · Assignment A formula has the complexity Assignment if it has the form = operand (for example, =invoicedquantity), where the operand consists of a basic key figure. Formulas with the complexity Assignment are used to change the aggregation behavior of the key figure (for example, the key figure is aggregated to the total, but you want to have the average). The Aggregation field is visible but not ready-for-input. The Exception Aggregation field is visible and ready-for-input. The standard value for both of these fields is made up of the values from the corresponding fields in the source key figure. You can change the exception aggregation. You can select the following settings in the Exception Aggregation field. - Summation - Maximum - Minimum - Exception, if more than one record occurs - Exception, if more than one value occurs - Exception, if more than one value <> 0 occurs PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 47 of 62
  • 48. - Average of all values - Average of all values <> 0 - Average for calendar days - Average for working days - Count all values - Count all values <> 0 - First value - Last value - Standard deviation - Variance You can find additional information about the setting options for exception aggregation in the documentation for InfoObject maintenance under Tab Page: Aggregation. If the fields Aggregation and Exception Aggregation have the same setting, the field Reference Characteristic for Exception Aggregation is empty and not ready-for-input. If the fields Aggregation and Exception Aggregation have different settings, you have to specify the reference characteristic for the exception aggregation. · Simple A formula has the complexity Simple if it is made up exclusively of operands with the same aggregation, where the operands basic key figures, constants or calculated key figures can have the complexity Simple (for example, profit=sales minus revenue). In the Time of Calculation field, you can choose whether the formula is calculated After Aggregation or Before Aggregation. If you choose to calculate the formula before aggregation, this usually leads to bad performance as a large amount of data (single records) has to be calculated. Often in formula calculations, the single record information for only one or two specific characteristics is required and the rest of the InfoProvider data can be aggregated Therefore, we recommend that you use a formula variable that is replaced with the attribute Reference to Characteristic (Constant 1). Using this attribute, the reference to such a characteristic, which is not to be aggregated, can be created. The attribute Reference to Characteristic (Constant 1) is available for each characteristic. If you use such a variable in a formula (instead of in a calculated key figure), it is replaced with a 1 but this has no effect on the aggregation behavior since formulas are always calculated after aggregation. For more information about formula variables and replacing them with attribute values, see Replacement Path: Replacement with a Characteristic Value and Calculating with Variables for Processing Type “Replacemnt Path”. Example of replacement with a constant attribute: There are purchase orders in the InfoCube on a document line level with the key figures Quantity and Price (for each document line). You want to see the sales order value of a purchase order. To do this you have to calculate the quantity x price for each document line. If you define a calculated key figure Quantity x Price x &REFVAR& , where &REFVAR& represents the reference to the characteristic Purchase Order , the OLAP processor can aggregate all other dimensions first of all (for example, customer, period) and then make the calculation for each purchase order. This means that performance is considerably improved than when single records are calculated first and then aggregated. · Complex All other types of formula have the complexity Complex and are always calculated after aggregation. The different options for aggregation settings are not ready-for-input and the time of calculation is set at After Aggregation . Most formulas are complex and are therefore calculated after aggregation. Activities In the InfoProvider objects dialog box, select a calculated key figure and from the context menu, choose Properties. You reach the Calculated Key Figure Properties dialog box. !--a11y--> 1.6 Defining Conditions Use You can formulate conditions in the query designer to make data analysis more efficient. In the results area of the query, the data is filtered according to the conditions so that only the part of the results area that you are interested in is displayed. You can find additional information about the scope of functions for conditions under Conditions. Procedure ¡ Choose New Condition . (You can find this menu entry in the Query Designer toolbar under to the right of Condition ). The Define Condition dialog box appears. ¡ Specify a name for the condition in the Description field. If you only want to define the condition and not execute it actively in the query, remove the check from the active , which was set by default. ¡ You now have the following options: - If the condition lines below are to be evaluated independent of one another for all of the characteristics in the drilldown and you want to use the same condition for multiple characteristics of the query, select Evaluate Conditions Below for All Characteristics in the Drilldown Independently . This setting allows you to apply a condition in a very general way. Depending on which characteristics you use in the drilldown, you will obtain varying PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 48 of 62
  • 49. This setting allows you to apply a condition in a very general way. Depending on which characteristics you use in the drilldown, you will obtain varying results. Characteristics that are already used in an active condition for characteristic combinations are excluded from these. You can find more information under Ranked List Condition: Top 5 Products and Ranked List Condition for All Characteristics in Drilldown Independent: Top 3 Products and Top 3 Sales Channels. ¡ If you want to evaluate the condition for certain drilldowns of defined characteristics or characteristic combinations, in the field Evaluate the Conditions Below for Single characteristics or Combinations of Characteristics . You can then make entries in the list of characteristics used in the queries in rows, columns, or free characteristics. i. If you only want to evaluate the condition when a certain characteristic is present in the drilldown, select this characteristic. ii. If you want to evaluate the condition for characteristic combinations, select multiple characteristics. You can find more information under Ranked List Condition for Characteristic Combination: Top 3 Combinations of Product and Sales Channel. ¡ In the field Display all values for which at least one of the following conditions applies , enter one or more condition rows into the list. See Conditions/Exceptions: Add, Change, Delete Rows A condition row is always derived from the determination of an element for every structure used in the query (usually one or two structures), an operator, and a value that matches the operator. You can choose from the following operators for threshold conditions: - Is equal to - Is not equal to - Is less than - Is greater than - Is less than or equal to - Is greater than or equal to - Is between (is in the interval) - Is not between (is not in the interval) These operators demand a floating point number as a value. For the operators is in interval and is not in interval , you must enter a value area, that is, a lower and an upper threshold value. You can choose from the following operators for ranked list functions: ¡ Top N ¡ Bottom N ¡ Top percent ¡ Bottom percent ¡ Top sum ¡ Bottom sum You can find additional information about using operators for range lists under Conditions. For Top/Bottom N you must enter a whole, positive number as the value. For Top/Bottom percent enter a number between 0 and 100. For Top/Bottom sum you can also enter a floating point number (for example, 15.7). The format depends on the country setting in the operative system. The following convention makes it easier to handle numbers with many zeros: An apostrophe after the number means multiplied by one thousand, a quotation mark means multiplied by one million, and three apostrophe marks means multiplied by one billion, for example 1.5” = 1.5 mil = 1,500,000. You can also use formula variables as the reference value of the condition: b. Select the variable entry. The formula variables that are available appear in the dropdown box. c. Select a variable. § You can change the variable using Change Variable . The Variable Editor dialog box appears. You can find more information under Changing Variables in the Variable Editor. § If you want to create a new formula variable, select New Variable . The Variables Wizard dialog box appears. You can find more information under Defining Variables with the Variables Wizard. When you execute the query, a Variables dialog box appears, in which you can choose the value limit of the condition. A group of condition rows is logically linked with OR. This means that at least one of the condition rows has to be fulfilled for the entire condition to be true. See Ranked List Condition with Two Condition Rows: Top 2 Products and Bottom 2 Products. ¡ Choose OK . This takes you back to the query definition. ¡ Choose Save. Changing a Condition 1. Choose Change condition. (You can find this menu entry in the Query Designer toolbar under to the right of Condition ). The dialog box for conditions that have already been defined appears. 2. Choose the condition you want to use, and then choose OK . You get to the dialog box Defining conditions , where you make any changes. 3. In the Query Designer, choose Save. Deleting a Condition 1. Choose Condition . You get to the selection window for the conditions that have already been defined. 2. Choose the condition you want, and then choose Delete . 3. In the Query Designer, choose Save. Result You have defined or changed a condition for a query. In the status bar of the Query Designer, the symbol in the lower right-hand corner shows you that one or more conditions have been defined for this query. Execute the query. Only those objects are displayed which fulfill the defined conditions. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 49 of 62
  • 50. You can display the condition descriptions in the query view and activate or deactivate them there. See Using Conditions. See also: Background Information on Conditions !--a11y--> 1.7 Defining Exceptions Use You can define threshold values (exceptions) for a query. Data that varies from these thresholds are marked in different colors. You can use these exceptions to spot extraordinary variations from expected results straight away. You can find additional information under Exception Reporting. Procedure 1. Choose New Exception . (You can find this menu entry in the Query Designer toolbar under to the right of Exception. ) You get to the Defining Exceptions dialog box. 2. Give a name for the exception in the Description field. If you only want to define the exception, and do not want to execute it actively in the query, remove the check from the Active field that is set there by default. 3. In the Evaluation for field, choose the structure elements, for which you want to evaluate the exception. Choose a structure element individually for every structure used, or use the (Everything) setting to apply the exception to all the structure elements. You want to evaluate the exception for the key figure Sales . Choose the value Sales from the selection field for the Key Figures structure . 4. Choose the Exception Values tab page. Add one or more alert level rows to the list. See Conditions/Exceptions: Inserting, Changing, Deleting Rows An alert level row consists of: - From-value - To-value - Alert Level From and To Values Specify floating point numbers for the from and to values. If you want to, you can leave either the from- or the to- value blank. The format depends on the country setting in the operative system. The following convention makes it easier to handle numbers with many zeros: An apostrophe after the number means multiplied by one thousand, a quotation mark means multiplied by one million, and three apostrophe marks means multiplied by one billion, for example 1.5” = 1.5 mil = 1,500,000. You can use formula variables for the from and to values of the exception. Select Variables Entry. The available formula variables appear in a dropdown box. Select a variable. You can change the variable using . The Variables Editor dialog box appears. For more information, see Changing Variables in the Variable Editor. Choose if you want to create a new formula variable. The Variables Wizard dialog box appears. For more information, see Defining Variables with the Variable Wizard. When you execute the query, the variable dialog box appears, in which you can choose the from and to values. Alert Level Assign the exception priority you want to use as an Alert level. In the Excel formatting templates used as standard in the BEx Analyzer, a color ramp is used to display the priority given to an exception (dark green = good 1,...yellow = medium 5,...dark red = bad 9). There are a total of nine color shades, corresponding to nine different levels of priority. If you want to assign your own colors, choose Formatting ® Pattern from the BEx toolbar (see also Formatting. The formatting for Web applications is defined in the BW stylesheet. You can change the colors for the exceptions in the stylesheet. All sales below 1,000 are bad, all sales above 100,000 are good, and all sales between these two values are medium. Define three Alert level rows to correspond to these three categories: From To Alert Level 1,000 9 (bad) 1,000 100,000 5 (medium) 100,000 1 (good) PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 50 of 62
  • 51. For report data, the system processes alert level rows in sequence. If you have defined several alert level rows for one value, the row with the worst alert level is displayed in the row. 5. Choose the Cell Restrictions tab page if you want to define more precisely the data cells of the report for which the exception is evaluated. Add one or more cell restriction rows to the list. See Conditions/Exceptions: Inserting, Changing, Deleting Rows A restriction row consists of: - A characteristic - An operator - A value (only with the operator Fixed Value as a characteristic value, and the operator Level as a number) Choose from any of the free characteristics, or any of the characteristics from the rows and columns that are used in a query. You cannot use characteristics that have already been used in another restriction row in the list. Choose from the following operators: Operators Meaning everything The validity area is not restricted. The exception is valid for every drilldown status of the characteristic. totals only The exception is valid only for aggregated values of the characteristic. everything except totals The exception applies to all values of the characteristic apart from aggregated values. fixed values The exception is valid for only one particular value of the characteristic (“spare parts” under “product group”, for example). Specify the characteristic value you want to use in external non-compounded display format or call the value help with to choose a characteristic value. You can also use characteristic value variables. Select Variables Entry. The characteristic value variables appear in a dropdown box. Select a variable. You can change the variable using . The Variables Editor dialog box appears. For more information, see Changing Variables in the Variable Editor. Choose if you want to create a new characteristic value variable. The Variables Wizard dialog box appears. For more information, see Defining Variables with the Variable Wizard. When you execute the query, the variable dialog box appears, in which you can choose the characteristic value. Level The exception is valid only for a particular hierarchy level of the characteristic. Specify the hierarchy level you want to use as a number in the Value field. In the hierarchy for the characteristic Location , Country is the second hierarchy level ( continent – country – state – location ). If you want the exception to be valid only for the hierarchy level Country , put the number 2 in the Value field. If you want the exception to be valid only for the hierarchy level State , put the number 3 in the Value field, since State is the third hierarchy level. Validity Area for All Characteristics Not Listed: · For all characteristics for which you have not restricted the validity area, the preset value Only Results (Recommended for Relative Values) from the Validity Area for All Characteristics Not Listed goes into effect. This setting means that the exception is valid only for the aggregated values of this characteristic. · You can also use the default restriction Everything (Recommended for Relative Values) in the field Validity Area for All Characteristics Not Listed . This setting means that the exception is valid independent of the drilldown status of a characteristic, the validity area of which has not been restricted. This does not qualify as a restriction. We recommend that you use the Everything setting only with relative values, such as percentage deviations. 6. Choose OK . You return to the query definition. 7. Choose Save. Changing Exceptions 1. Choose Change Exception. (You can find this menu entry in the Query Designer toolbar under to the right of Exception. ) The dialog box for the exceptions that have already been defined appears. 2. Select the exception you want to use, and choose OK . The Defining exceptions dialog box appears . Make your changes here. 3. In the Query Designer, choose Save. Deleting Exceptions 1. Choose Exception . The dialog box for the exceptions that have already been defined appears. 2. Select the exception you want to remove, and choose Delete. 3. In the Query Designer, choose Save. Result You have defined or changed an exception for a query. In the status bar of the Query Designer, the symbol in the lower right-hand corner shows you that one or more exceptions have been defined for this query. Execute the query. The exception is evaluated online. The cells that are affected by the exception are displayed with the appropriate color shading in the result area of the query. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 51 of 62
  • 52. You can display the exception descriptions and activate or deactivate the exceptions you want. BEx Web applications: In the Web item List of Exceptions, choose the symbol for activating and deactivating exceptions. Under the Data Analysis tab page in the Standard Web Template for Ad-hoc Analysis or in the BEx Web Analyzer, choose the Exceptions and Conditions button to get to the display of existing exceptions and to execute the functions associated with them. BEx Analyzer: In the BEx Analyzer, choose Layout ® Display Exceptions . The descriptions for the exceptions are inserted into the cell area below the filter cells. You can activate/deactivate the exceptions with a double-click or over the context menu (secondary mouse-click). Exceptions are evaluated in the background, if they involve a large number of queries, for example. You schedule the exceptions for background processing in the Administrator Workbench Reporting Agent. See Reporting Agent, Defining the Exceptions Setting. !--a11y--> 1.7.1 Conditions/Exceptions: Inserting, Changing, Deleting Rows Use When you define conditions, you must set up condition rows. When you define exceptions, you can create alert level rows and restriction rows. Procedure Inserting a new row Choose New . Select the settings you want in the entry field under the list. Choose Copy . A new entry appears in the list with the new settings. You can now immediately create a new row in the entry field. Changing rows Select the required row in the list. Make the required changes in the entry field under the list. Choose Copy . The row has now been changed accordingly. Deleting rows Select the required row in the list. Choose Delete . The procedure applies when you are creating Condition rows (see Defining Conditions) Alert level and restriction rows (see Defining Exceptions) !--a11y--> 1.8 Tabular Query Display Use You can use all queries defined in the BEx query designer for OLAP reporting and also for Tabular Reporting. Features By (de)selecting the Tabular Display mode when defining a query, you can create a query for OLAP reporting or for tabular reporting. The OLAP reporting mode is the default mode. When you save the query, both display types are automatically saved in a query object in the database. If you define the query in one mode, the system automatically generates a standard presentation for the other mode. In addition, all existing queries automatically have a default tabular display. Therefore, you can use all defined queries for OLAP reporting in the BEx Analyzer and in BEx Web applications and also for formatted reporting within the scope of Crystal Reports integration. Queries that have two structures are available only in the multidimensional display and are suitable only for OLAP reporting. Characteristics and key figures are displayed in the columns in the tabular display. Unlike with OLAP reporting, there are no free characteristics and no rows. You can use filters in the tabular display and assign characteristics, key figures and attributes freely in the columns. For example, you can put a key figure column between two characteristic columns. The column display is determined when the query is designed and cannot be altered. In tabular reporting, the interaction options are limited to filters, filtering and drilling down according to, sorting according to, and navigation in hierarchies. Navigation functions that would change the PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 52 of 62
  • 53. geometry of the tabular list (that is the number and position of the columns), such as swapping or adding drilldowns, are not permitted in tabular reporting. Displaying queries in tabular format is particularly useful for formatted and form-based reporting (for example, for displaying a materials list). It is important in formatted reports that you can specify the layout design to one pixel and also have convenient print options. Switching between the two display types: When you switch a query defined for OLAP reporting to the tabular display, all InfoObjects are moved automatically from the rows into the columns. Similarly, when you switch a query that was defined in the tabular display to a multi-dimensional display, all characteristics are displayed in the rows and all key figures are displayed in the columns. The filter settings remain the same in both cases. Free characteristics from the multi-dimensional display change to filters when you switch to tabular display. If you remove an InfoObject from the query definition in one mode, the change is also made in the other mode. The InfoObject is also removed from the query there. In other words, changes to the definition of objects effect both display types. If you change the position of the InfoObject in the columns in the tabular display, this does not effect the multi-dimensional display for OLAP reporting. In other words, changes to the position of objects effect only the selected display type. Activities Choose in the Query Designer symbol list to switch between the two modes. For more information about the integration of formatted reporting, see Formatted Reporting: Crystal Reports Integration !--a11y--> 1.9 Defining Calculated Key Figures Use You can recalculate the key figures of an InfoProvider for reuse in the Query Designer using formulas. Calculated key figures consist of formula definitions containing basic key figures, restricted key figures or precalculated key figures. Procedure Defining a New Calculated Key Figure In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Calculated Key Figure. If a calculated key figure has already been defined for this InfoProvider, you can also select the Calculated Key Figures entry and, from the context menu, choose New Calculated Key Figure. The New Calculated Key Figure dialog box appears. The upper part of the screen contains a text field in which you enter a description of the calculated key figure. You can use text variables in the description. Beneath this is the input field for the formula that you want to use to calculated the key figure. The bottom left screen area contains all of the operands available for the formula definition. These are: The basic key figures, calculated key figures and restricted key figures from the relevant InfoProvider. All form variables On the right-hand side of the screen, you see the functions that are available as operators: Basic functions Percentage functions Data functions Mathematical functions Trigonometric functions Boolean operators Between the operands and the functions, the symbols for the basic arithmetic operations are displayed. To the right of the functions, there is a number block. Proceed as follows to define a formula: Choose the operands you want to use, and insert them in the entry field for the formula by double-clicking or by using Drag&Drop. Choose the calculation functions you want to use by either clicking on the symbols for the basic arithmetic operations, double-clicking on the functions, or using Drag&Drop. Select the numerical values for the formula by clicking on the number block. You can also enter digits, parentheses and basic arithmetical operations using the keyboard. 2. Define your formula using the available operands and operators. If, when defining a formula, you want to use a variable that is not contained in the operands, you must first create the variable. Highlight the Formula Variable entry and using the right mouse button on the context menu, choose New Formula . You reach the variable wizard that takes you through a step-by-step process for defining a new variable. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 53 of 62
  • 54. If you want to change a formula variable, select the variable and, from the context menu, choose Edit. The variable editor appears. Note that when you execute a query, the key figures are always calculated as the same unit. That is, a formula is semantically incorrect if, for example, a currency unit (for example, USD) is added to a weight unit (for example, kg). If you want to calculate values regardless of the unit, use the function Value Without Dimension (Without Units). See Data Functions. 3. Check the formula definition and choose Formula Syntax Check . The Formula Syntax Check function checks only the correctness of the syntax in the formula. It does not check whether the formula makes sense semantically, for example, if it contains the same units. You make semantic checks using the function Check Query (see Functions of the BEx Query Designer). 4. Enter a description for the calculated key figure.. 5. Choose OK . The new calculated key figure is defined for the InfoProvider. Editing Calculated Key Figures Note that when you change a calculated key figure, these changes are effective in all queries that use this calculated key figure. You can see where the calculated key figure is used. Choose Where-used List from the context menu (right mouse click) . 1. In the InfoProvider objects display frame, select the calculated key figure and, from the context menu (right-mouse click), choose Edit. 2. Make the required changes. 3. Choose OK . Determining Properties for the Calculated Key Figure In the left display frame for InfoProvider objects, select the calculated key figure and, from the context menu, choose Properties. Make the required settings for the description, display, number format, currency translation, local calculations and the aggregation behavior of the calculated key figure. See Calculated key figure properties Result You have defined a calculated key figure for reuse.You can now use this calculated key figure in all queries based on this InfoProvider by moving the key figure into the rows or columns of the query using Drag&Drop. The calculated key figure is not an actual element in this query, but a placeholder referenced to the calculated key figure in the InfoProvider. !--a11y--> 1.10 Defining Restricted Key Figures Use You can restrict the key figures of an InfoProvider for reuse by selecting one of more characteristics. The key figures that are restricted by one or more characteristic selections can be basic key figures, calculated key figures or key figures that are already restricted. Procedure Defining a New Restricted Key Figure 1. In the InfoProvider objects display frame, select Key Figure and from the context menu (right-mouse click), choose New Restricted Key Figure. If a restricted key figure has already been defined for this InfoProvider, you can also select the Restricted Key Figures entry and, from the context menu, choose New Restricted Key Figure using the right mouse button . The New Restricted Key Figure dialog box appears. The text field, in which you can enter a description of the restricted key figure, is found in the upper part of the screen. You can use Text Variables in the description. Underneath the text field, on the left, is the directory of all the objects available in the InfoProvider. The empty field for defining the restricted key figure is on the right-hand side of the screen. 2. Using Drag&Drop, choose a key figure from the InfoProvider, and restrict it by selecting one or more characteristic values. See, Restricting Characteristics. You can also use variables in place of the characteristic values. However, note that you cannot use the following variable types in restricted key figures for technical reasons. ¡ Variables with Replacement with Query process type (see also Replacement Path: Replacement with Query ¡ Variables that represent a precalculated value set (see also Details) You can use these variable types to restrict characteristics in the rows, columns or in the filter. 3. Choose OK . PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 54 of 62
  • 55. Editing restricted key figures Note that when you change a restricted key figure, these changes are effective in all queries that use this restricted key figure. You can see where the restricted key figure is used. Choose Where-used List from the context menu of the restricted key figure (secondary mouse click) . 1. In the InfoProvider objects display frame, select the restricted key figure and, from the context menu (right-mouse click), choose Edit. 2. Make the required changes. 3. Choose OK . Determining properties for the restricted key figure 1. In the left display frame for InfoProvider objects, select the restricted key figure and, from the context menu, choose Properties. 2. Make the required settings for the description, number format and currency translation for the restricted key figure. See Restricted key figure properties Result You have defined a restricted key figure for reuse. You can now use this restricted key figure in all queries based on this InfoProvider by moving the key figure into the rows or columns of the query using Drag&Drop. The restricted key figure is not an actual element in this query, but a placeholder referenced to the restricted key figure in the InfoProvider. !--a11y--> 1.11 Structures Definition Objects that appear in the Query Designer and can be defined freely. A structure forms the basic framework of the axes in a table (rows or columns). It consists of structural components. We differentiate between key figure structures and characteristic structures. Structural components of key figure structures are always based on the key figure selections (basic key figures, restricted key figures, and calculated key figures). Characteristic structural components cannot contain key figure selections. The set up of the structure determines the sequence and number of key figures or characteristic values in the columns and rows of the query. You can navigate through the structure in the executed query and set filters for it. If you are using two structures (for example, a key figure structure in the columns and a characteristic structure in the rows), a table with fixed cell definitions is created. You have to use two structures as a prerequisite for defining exception cells. You can override the value of cell values created implicitly at the intersection of two structural components. See Defining Exception Cells Use Structures and their structural components are complex objects. Structural components can be formulas or selections. In key figure structures, each selection structural component has to consist of one key figure selection along with possible characteristic selections. Within a query definition you can use either no structures or a maximum of two structures. Of these, only one can be a key figure structure. You can combine structures freely with other characteristics on the axes. Key figure structure A structure appears in the Query Designer automatically if you move a key figure from the left selection window for InfoProvider objects into the rows or columns of the query definition. The structure that the system creates automatically is identified by the symbol and contains the default name Key Figures as a proposal. You can change this default name. 1. Select the structure and choose Properties from the context menu (secondary mouse click). This brings you to the structure properties dialog box. 2. Change the name if necessary, and choose OK. For more information, see Structure Element Texts and their Language-Dependency. Note the following when using key figures in a query: § Key figures in the Rows or Columns are always a component of a structure. If you place a key figure in the Filter area of the query definition, the key figure is not a structural component. In this case, you can still use up to two characteristic structures in the rows or columns. § You can use key figures in a query in only one structure. § Each structural component of a key figure structure must contain a key figure. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 55 of 62
  • 56. Characteristic structure If you want to use a structure in the query with several characteristic values, you first have to create a structure and then insert the required characteristic values. 1. Use the right mouse button to open the context menu in the columns or rows and choose New Structure. The default name for the structure is Structure. You can change this default name. See above under Key Figure Structure. 2. Use Drag&Drop to move the required characteristic values from the left selection window for the InfoProvider objects into the structure. Although a key figure has to be available in the form of a structure for the query, the use of a characteristic structure is optional. The difference between a characteristic structure and the use of characteristics on an axis is that with the characteristic structure, you have already specified the number and sequence of the characteristic values in the query definition. If you use a characteristic on an axis, all posted characteristic values for the characteristic are displayed in the query. You can restrict the selection of specific characteristic values by setting a filter. Special features when using two structures Note that when you use two structures, you can include a characteristic in only one of the two structural components of a selection structural component. If you have made a selection in a structure element for one structure on the characteristic fiscal year , you cannot use the fiscal year characteristic as a selection in the other structure. Hierarchical display of structures You can arrange the structural components in a structure hierarchically. Use the right mouse button to call the context menu and choose Level Down or Level Up. The hierarchical relationship of the structural components is displayed in the executed query like a presentation hierarchy. You can expand and collapse the nodes. Arranging the structural components You determine the sequence of the structural components when you add a key figure or characteristic to the structure below another. You can change the sequence later by selecting the structural component and using Drag&Drop to move it to the required position further up or down. Copying structural components The components of key figure structures often contain very complex objects that are made up of formulas or selections. If you want to reuse the definition of a structural component within a structure, you can copy the structural component, paste it into the structure and continue to work with it. This enables you to create similarly structured structural components quickly and easily. For example, if you want to use the formula for a calculated key figure (K1) in another calculated key figure (K2), you can copy K1 and continue to build the formula in K2. From the context menu of the structural component, choose Copy and from the context menu of the structure, choose Insert. You can also copy structural components using temporary storage locations (Ctrl-C, Ctrl-V). Saving structures for reuse You can use structures in several different queries. You have to save them in the InfoProvider to reuse them. These structures are then called reusable structures. For more information, see Creating Reusable Structures. Integration Considered abstractly, you can think of a structure as a characteristic. However, the following differences exist between a characteristic and a structure: · Structural components can be complex objects (selections, formulas…) while characteristic values are atomic values. · You cannot aggregate structures. For a characteristic, you can determine whether it can be aggregated or not. If a characteristic can be aggregated, the sum of the characteristic values is created automatically. Structural components cannot create sums. · If a characteristic is in the drilldown, all posted characteristic values are displayed. Characteristic values that do not include posted values are not displayed. If a structural component does not include posted values, then the structural component is always displayed, and the respective cells for this structural component are empty and have no numbers. Constraints The number of structural components in a structure is restricted to 999. Examples Plan/Actual Comparison (= Key Figure Structure) PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 56 of 62
  • 57. Time Structure (= Characteristic Structure) Creating a query with two structures Key figure structure in the rows and characteristic structure in the columns: See also: Displaying Changes for Queries in Workbooks !--a11y--> 1.11.1 Creating Reusable Structures Use You can use structures in several different queries. You have to save them in the InfoProvider to reuse them. These structures are then called reusable structures. When you use a reusable structure in a query, the structure is not copied, but rather the reference to it is. Changes made to reusable structures affect all queries in which reusable structures are used. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 57 of 62
  • 58. To better distinguish between the two kinds of structures, structures that are not saved as reusable structures are called local structures. Local structures are used in only one query. You can change local structures into reusable structures in any existing query by selecting the structure and, choosing Save as... from the context menu and then entering a technical name and a description in the Save Structure as... dialog box. You can change reusable structures that you are using in a query into local structures by selecting the structure and choosing Remove Reference from the context menu. Prerequisites At least one InfoProvider that is filled with data must be available in the Business Information Warehouse. Procedure 1. Start the Query Designer. You open the Query Designer from Start/Programs/Business Explorer/Query Designer. You can also call up the BEx Query Designer from the following components: · BEx Analyzer · BEx Web Application Designer · Crystal Reports Business Explorer Analyzer: In the BEx toolbar, choose Open ® Queries . In the BEx Open Dialog, you have access to the selection screen displaying all available queries in your history, favorites and roles or assigned to the InfoAreas. Choose New Web Application Designer: In the menu toolbar in the Web Application Designer, choose Tools ® Query Designer. Choose New Query . 2. You get to the selection screen for all InfoProviders for which you can define a new query. From the list of all available InfoProviders, select the InfoProvider for which you want to create the reusable structure. The available objects in the InfoProvider you selected are displayed as a directory tree in the left side of the Query Designer. 3. In the Rows or Columns directory of the Query Designer, choose New Structure from the context menu (right mouse button). 4. Create a new structure. Select the characteristics and key figures of the InfoProvider that you want to use in the new structure and drag them into the structure directory. Where necessary, restrict a characteristic or a key figure, or define a new calculated key figure. You can copy individual structural components within a structure. This enables you to create similarly structured structural components quickly and easily. For example, if you want to use the formula for a calculated key figure (K1) in another calculated key figure (K2), you can copy K1 and continue to build the formula in K2. From the context menu of the structural component, choose Copy and from the context menu of the structure, choose Insert. You can also copy structural components using temporary storage locations (Ctrl-C, Ctrl-V). 5. Highlight the new structure. From the context menu (right mouse-click), choose Save as ... and enter a Technical name and a Description . Result The reusable structure is in the structure list of the InfoProvider tree and you can use it again when you create new queries. See also: Defining New Queries !--a11y--> Structure Element Texts and Their Language-Dependency Use When you define a query, in the left selection window you see the InfoProvider objects that you can move into the query directories using Drag&Drop for the definition. For example: · InfoObjects · Reusable calculated key figures · Reusable restricted key figures · Reusable structures You can maintain the texts for these objects in several languages. Examples Creating Structures and Changing or Accepting the Default Text 1. If you create a query in a logon language (for example, German) and include a basic key figure, a restricted key figure, or a calculated key figure in the PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 58 of 62
  • 59. columns or row, this key figure automatically becomes part of a structure, that is, a selection structural component. (You see the Selection type in the Edit Selection dialog box that appears when you double-click on a structural component.) The structure that the system creates automatically is identified by the symbol and contains the default name Key Figures as a proposal. A key figure in the rows or columns has to be part of a structure. You can have a maximum of two structures in a query, only one of which can be a key figure structure. You can also create a structure manually. Use the secondary mouse button to open the context menu in the Columns or Rows and choose New Structure. This structure automatically receives Structure as a suggested name . 2. You can change this suggested name. Select the structure and choose Properties from the context menu (secondary mouse click). This brings you to the structure properties dialog box. 3. Change the name if necessary, and choose OK. Structural Components and Their Texts · If you move a key figure from the InfoProvider object selection window on the left into the key figure structure, the default name for this structural component is given as the name from the left selection window (dependent on the logon language). · You can make additional restrictions on the structural component (by double-clicking on it) or change the properties of it (from the context menu under Properties ), and, therefore, can change the name given by default. You can transfer a key figure as often as you want and make changes to the structure locally (different settings, restrictions). Therefore, the name has to be individually changeable. · The structure does not contain the original element from the left selection window of the InfoProvider objects, but rather a structural component that links to the original key figure in the left window. · The names of the structural components are language-dependent. That is, when you define and save a query with the logon language as German, only the relevant German texts are saved in the corresponding tables (for example, RSZELTTXT). This is not the original key figure, but rather a structural component, a new object that links to the original key figure but is not the original key figure. · If you then execute the query in a different logon language to the one that you used to define the query, the relevant texts for all structural components are missing and displayed as empty. The system behaves differently with characteristics, since you do not create these objects in the Query Designer but rather in the InfoObject maintenance. For characteristics, the relevant text is displayed in the logon language when you execute the query. However, if you have manually changed a characteristic description in the Query Designer (for example, Region in a Favorite Region ), then the respective, translated text for the manual change (for example, Favorite Region ) is not displayed, but rather the original text is (for example, Region ), as long as this is maintained in the InfoObject maintenance. So that you also keep a respective translation in another language, you have to manually change the characteristic description in the Query Designer when logging on in another language and save the query. See Properties for a Characteristic . · When you logon in a different language (for example, English) and you want to see the English texts for the structural components when you execute the query, you have to open the Query Designer after you have logged on in English and save the query definition. If available, the English texts are then used as the default texts and you can change these individually. If no English texts have been maintained, the technical name is used instead. If you have not yet saved the query definition in a different logon language (for example, English), there are no English texts. When you logon in English and execute the query, the relevant fields are empty. · Structures and structural components (selections, formulas) are completely independent objects that appear in the BEx Query Designer and that you can store in the relevant tables when you save them. Since texts are fundamentally language-dependent, the texts in the query definition appear in the logon language only when you save the query. · Therefore, in queries that you have already defined, the system cannot adjust translated key figures within a structure automatically at a later date. You can only adjust the texts manually for each structural component, by, for example, removing them and inserting them back into the structure. !--a11y--> 1.12 Displaying and Changing Existing Queries in the Query Designer Prerequisites You must have created at least one query. Displaying Queries You open the Query Designer from Start Programs Business Explorer Query Designer. You can also call up the BEx Query Designer from the following components: BEx Analyzer BEx Web Application Designer Crystal Reports From the BEx Web Application Designer: 1. Choose Tools ® Query Designer . 2. In the Query Designer symbol toolbar, choose Open Query. The BEx Open Dialog appears. 3. From here, select a query from the queries in your history, favorites or roles, or from queries assigned to the InfoAreas. You can display them in the Query Designer: By double-clicking on them PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 59 of 62
  • 60. By selecting them and choosing Change From the BEx Analyzer: 1. Choose Open ® Queries in the BEx toolbar. The BEx Open Dialog appears. 2. From here, choose a query from the queries in your history, favorites or roles, or from queries assigned to the InfoAreas. Then select it. 3. Choose Change . Changing Queries Display the query in the Query Designer. You can now make changes in the query definition. The procedure for changing the query is the same as for creating a new query ( see also: Defining New Queries). You have two options for saving the query: You can save the changed query. From the toolbar, choose Save Query . You can save the changed query as a new query. From the toolbar, choose Save Query As . Enter a new technical name, a new short text and a new description. 4. You can also delete the query. From the toolbar, choose Delete Query . You can delete the query only if it is no longer being used (that is, if it is not being used in any workbooks, Web templates, Crystal Reports or Reporting Agent settings). Using the function Display <-> Change , you can toggle between the display and change modes. See also: Saving Queries Functions of the BEx Query Designer !--a11y--> 1.13 Functions on the BW Server Use There are certain functions that you can use with queries that you do not use in the Frontend but rather on the BW server. You cannot call up these functions in the Business Explorer tools. You call them up from the SAP Easy Access Menu of your BW system. Features You call up the following functions from the SAP Easy Access Menu of the BW system under SAP Menu ® Business Explorer ® Query : Copying Queries between InfoCubes Deleting Query Objects Editing Sender/Receiver Assignments to the R/RI in BW !--a11y--> 1.13.1 Copying Queries Between InfoCubes Use With this function you can copy queries and their sub-objects (structures, calculated key figures and restricted key figures) between different InfoCubes. The target InfoCube, that is, the InfoCube of the query copies, must contain all the InfoObjects of the source InfoCube (InfoCube of the original queries). Procedure In the SAP Easy Access Menu of the BW system, choose SAP Menu ® Business Explorer ® Query ® Copy. Double-clicking on Copy Queries brings you to the popup Copying Queries Between InfoCubes . 2. Select the required source and target InfoCube. 3. Choose Next . This brings you to a selection box with all the queries of the source InfoCube. PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 60 of 62
  • 61. 4. Select a query from those available. You have the following options for selecting multiple queries. To make several selections from the list, select the required queries with a mouse click and the Ctrl key. If you want to select several queries that follow each other in the list, you can select whole blocks by holding down the Shift key. 5. Choose Transfer Selections. Note the following if you are working with reusable sub-objects such as variables, structures, calculated key figures and restricted key figures: Variables are not dependent on InfoCubes, so variables are not copied. If you have selected several queries to be copied and they refer to sub-objects that follow each other in the list, only one copy is made for each of the sub-objects. The references of the copied queries remain. New sub-objects are created when queries are copied again. This means the references to queries that have already been copied are lost. Result The copied queries and the copied sub-objects have their own names. The new names are derived from the name of the original object and the added elements _<number>. This does not affect variables, since they are not copied. Example The queries w eekly report, monthly report and annual report use company code as a variable and the calculated key figure contribution margin . If you now copy the queries w eekly report and monthly report into another InfoCube, the queries w eekly report_1 and monthly report _ 1 as well as the calculated key figure contribution margin _ 1 are created. The new queries now refer to the new key figure contribution margin _ 1 and the variable company code . If you then copy the queries quarterly report and annual report , a new calculated key figure, contribution margin _ 2, has to be created as a copy of contribution margin . Quarterly report_1 and annual report_1 then refer to contribution margin _ 2 and not contribution margin _1 . Company code is still used as a variable. !--a11y--> 1.13.2 Deleting Query Objects Prerequisites You have already defined at least one query, or a structure, or a restricted or calculated key figure. Procedure In the SAP Easy Access Menu of the BW system, choose SAP Menu ® Business Explorer ® Query ® Delete Objects. This brings you to a selection screen. Choose the type of object to be deleted (query, structure, restricted key figure or calculated key figure). Where necessary, restrict your search further, for example, to a certain InfoProvider, to certain technical names or to the last person to make a change.. Choose Execute . You get a list of all query objects that match the selection criteria. The list contains the technical names of the query objects, the name, and the long description of the InfoProvider, for which the objects are defined. Select the objects that you want to delete. Choose to select all of the objects. Choose Transfer. Option of Deleting Workbooks after Deleting Queries After you have deleted a query, you can decide whether you also want to delete all the workbooks that contained a query which has now been deleted. All users can delete workbooks from any of their favorites and roles. This means there is no risk of accessing workbooks with deleted queries in. Result The query objects you specified are deleted. See also: PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 61 of 62
  • 62. Removing Queries from Workbooks PUBLIC © 2014 SAP SE or an SAP affiliate company. All rights reserved. Page 62 of 62