Variables in BI Integrated Planning

KHNC 28.11.2997

Dr. Gerd Schoeffl, SAPNetWeaver BI RIG EMEA 28.11.2007


1. 2. 3. 4.

Types of Variables Variables in Queries and Planning Functions Notes/Important Hints Examples for Efficient Use of Variables

© SAP 2007 / Page 2

Types of Variables

Variables can replace:
Characteristic values Hierarchies Hierarchy nodes Texts Numeric values in formulas

Variables can be used in queries, filters, structures, planning functions etc.

© SAP 2007 / Page 3

with or without default values Replacement path (from a query result.Replacement Types for Variables Variables can be replaced by: Manual Input. another variable) Customer Exit SAP Exit Authorizations Manual Input can be switched on for all types except for Replacement Path © SAP 2007 / Page 4 .

Types of Variables Variables in Queries and Planning Functions Notes/Important Hints Examples for Efficient Use of Variables © SAP 2007 / Page 5 . 3.Agenda 1. 4. 2.

or definition (e. default values. © SAP 2007 / Page 6 . a variant or User entry Variables can define the fixed selection. Variables are merged (or melted) by default.Variables in BI Integrated Planning Use of variables in queries: when starting the query the variables can be filled by: a default value.g. restricted key figures) of the query. Variables are instantiated/filled when a query is started. Variables are fixed within one execution of the query. restart of query after a change of a variable.

variables with same name have same values in both queries Var1 Var2 Var1 Var2 Query 1 Query 2 © SAP 2007 / Page 7 .Merging of Variables in Queries Variable Popup Value 1 Value 2 Each Variable only once in Variable Popup.

but only when the planning function is executed. replacement path or Exit) © SAP 2007 / Page 8 . Are NOT merged with other variables (e. such as the source of a copy function Either have to be filled by a command in the application or a default value Are NOT instantiated when the application is started. with a variable with the same name in a query). Multiple ways of setting the variables by a command are possible Variables in planning sequences… Similar behavior as in planning functions Variables with same name in filter and definition of planning function are merged Variables in Data Slices cannot be filled interactively (use default values.g.Variables in BI Integrated Planning Variables in planning functions… Act as parameters of the planning function.

Merging of Variables in Planning Functions Variable Popup Value 1 Value 2 Filled by commands in the planning application Var1 Var2 Var1 Var2 Query 1 PF 1 © SAP 2007 / Page 9 .

they are filled with the default value of the variable or from another source specified in the command wizard: By a command range in Bex Analyzer By data binding with a huge variety of objects as sources in WAD. Link the result into a command for a planning function. by using drop down boxes comes down to: Creating a screen element that has a value help and that is used to select a value.Use Commands for Executing Planning Functions Commands are customized by a command wizard (WAD and Bex Analyzer). Variables are parameters of the planning function.g. Do not assume the variables are set automatically when using the same variable in a query – always explicitly set the variable © SAP 2007 / Page 10 . Thus setting variables for planning functions e.

input field etc.) to enter or select a value and link in via Excel cell reference into the command range.Setting Variables in Planning Functions in Bex Analyzer Product 1 =A1 Set a variable value in a planning function: 1. 2. 3. Create a command range. © SAP 2007 / Page 11 . Create a command for executing the planning function. Use Excel functionality (drop down list.

Setting Variables in Planning Functions in WAD II © SAP 2007 / Page 12 .

Use of Variables for Interactive Selections Variables are fixed within on execution of a query or a planning function. The change of a variable restarts the query. Interactive changes of a selection within an application/query are rather done by changing the filters using: Filter pane Drop down box Radio buttons © SAP 2007 / Page 13 .

2. 4. Types of Variables Variables in Queries and Planning Functions Notes/Important Hints Examples for Efficient Use of Variables © SAP 2007 / Page 14 .Agenda 1. 3.

). F4 help can be used.Variables and Manual Input Default value of variable is filled according to the definition (e. F4 help shows ALL values in master data. Value can be overtyped. from Exit etc. User can enter ANY value. Exception: Authorization variables (only authorized values) Compound characteristics (and upper characteristic already restricted) © SAP 2007 / Page 15 .g. entered default value.

© SAP 2007 / Page 16 .Variables Type Authorization and Replacement Path Authorization: Variable values (and F4 help) are restricted by the allowed values No distinction between display and change authorization(!) Consequence for use in planning projects: Do not use characteristic values that have only display but not change authorization Use own concept to build work package (see below) Replacement Path: Variables can be filled by from the result of another query The pre-query cannot be defined on an aggregation level.

Variable of Type Exit Standard BW approach: Create a project in transaction cmod Assign enhancement RSR00001 Implement the include in the assigned function module Attention: one include that implements the logic for all variables Alternative way to navigate to the include: Function module EXIT_SAPLRRS0_001 © SAP 2007 / Page 17 .

Step 2 is also called again subsequently. the variable screen appears again. When an exception (RAISE) is triggered. Step 2: Call is made directly after variable entry. The exit receives the information which step is currently processed (parameter I_STEP) and can react accordingly. The call can originate from the authorization check or from the monitor.When Are the Exits Called? Variables can be filled at various instants (called steps): Step 1: Call is made directly before variable entry (variable popup). you can check the values of the variables. This step is only executed if the same variable is not input ready and could not be filled for step 1. Step 0: The enhancement is not called from the variable screen. Step 3: In this call. © SAP 2007 / Page 18 .

Call of Exit Variables: Query Exit variable that is input off: Called any time the variables are processed. Behavior can be changed in Query Designer from SPS14 on. when the query is restarted or variable popup is called. Not called when the query is restarted or variable popup is called. Exit variable that is input on: Called only once the application is started in order to fill the default value. © SAP 2007 / Page 19 . e.g.

Call of Exit Variables: Other Customizing Objects Data Slices Variable Exits are called ONCE when the application is started. Only restart of application forces variables to be executed again (closing workbook is not enough. restart Bex Analyzer!) Remember: If you use the same variable in a query they are not melted! Refreshing the variable in the query does not change the variable in the data slice/characteristic relationship Planning Functions Planning Functions are only loaded when they are executed (unlike data providers) Variables used in definition of planning function are called every time the planning function is executed (i_step = 1) © SAP 2007 / Page 20 .

or complex binding Exit Variable 1 Button: Execute PF Definition of Planning Function Exit Variable 2 Variable refreshed when query is restarted. Filter. No refresh when planning function is executed © SAP 2007 / Page 21 Variable refreshed when function is executed .Example Query and Planning Functions in Application Data Binding Selection of data: Query.

Variables and Multiple Applications Planning Application 1 Exit Var_1 Planning Application 2 Exit Var_1 Where am I called from?!? ABAP Coding for Exit Var_1 © SAP 2007 / Page 22 .

Exit might be called also multiple times in one applications – do not implement counters in variables. Coding must be independent of the application. © SAP 2007 / Page 23 .Variables and Multiple Applications Exit cannot determine from which application they are called.

4. Types of Variables Variables in Queries and Planning Functions Notes/Important Hints Examples for Efficient Use of Variables © SAP 2007 / Page 24 . 3. 2.Agenda 1.

Clever Use of Variables in Planning Some typical requirements in planning applications: Dependent Drop Down Boxes Global parameters Global Parameters User dependent work packages © SAP 2007 / Page 25 .

Web Application Examples. Using Cascading Dropdown Boxes) Use compound characteristics (variable popup) Restricts the upper characteristic The value help for the dependent characteristic in restricted now © SAP 2007 / Page 26 .Dependent Drop Down Boxes Use drop down boxes and two data providers: see documentation: Bex Web.

Or: use a customer exit variable Or: use a variable type replacement path that reads the value from a pre-query (InfoCube or DataStoreObject) © SAP 2007 / Page 27 . planning year.Global Planning Parameters Often needed to set global parameters (e. actual planning version) for all users Parameter is changed by some administrator. Use the variable in the fixed filter or the planning functions/queries. end users should not be able to change it How to realize: Create a variable ‘manual entry/default value’ and do not check the flag ‘Ready for Input’.g. Set the default value.

List might depend on the planning application List might be a subset of all authorized values (remember – in standard authorization variable no difference between display and change!) List is user dependent Work packages of different users might intersect (several users working on the same set of data) or might be disjoint. If work packages are disjoint locks are easy to handle © SAP 2007 / Page 28 .Work Packages Each plan user should get a list a values he can choose from.

All values are locked Can be changed at execution.Repetition: Selections and Locks Default value for dynamic filter: Fixed filter: Cannot be changed at execution. Does not influence the locks © SAP 2007 / Page 29 .

Work Packages without Intersections Variable for country. input off (replacement path) Query with restricted user Fixed filter (all countries in work package) Country 1 DSO/InfoCube with user name and countries © SAP 2007 / Page 30 Select a single country in dynamic filter by drop down box .

Work Packages with Intersections Additional requirements: a user should only lock the data he/she is actually working on. when the selection changes the new selection has to be locked How to control the locks: Use a variable in the fixed filter and move through the work package by changing the variable (and thus the fixed filter). Query is restarted when variable is changed and can set the new locks But how to provide a user dependent F4 help for the variable?!? © SAP 2007 / Page 31 .

Example Country 1 Filter Drop Down Box with countries Use command “set variable value” Variable for country Query with restricted user Data Provider in application DSO/InfoCube with user name and countries © SAP 2007 / Page 32 Fixed filter (ONE country) .Solution: Control the F4 Help.

Thank you! © SAP 2007 / Page 33 .

com. Grafiken. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden. mySAP. SAP. either express or implied. graphics. einschließlich und ohne Einschränkung für direkte. including but not limited to the implied warranties of merchantability. The statutory liability for personal injury and defective products is not affected. SAP garantiert nicht die Richtigkeit oder Vollständigkeit der xApps. Links oder anderer in diesen Materialien enthaltenen Elemente. or other items contained within this material. unterliegen nicht dem Einfluss von SAP. SAP übernimmt keine Verantwortung für Fehler oder Auslassungen in diesen Materialien. SAP does not warrant the accuracy or completeness of the information. This document contains only intended strategies. Texte. This document is provided without a warranty of any kind. © SAP 2007 / Page 34 . Duet. developments. ohne die ausdrückliche schriftliche Genehmigung durch SAP AG nicht gestattet. die Eigentum anderer Softwarehersteller sind. xApp.Copyright 2007 SAP AG 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 AG. PartnerEdge and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. auf die Sie möglicherweise über die in diesem Material enthaltenen Hotlinks zugreifen. R/3. indirect. Die gesetzliche Haftung bei Personenschäden oder die Produkthaftung bleibt unberührt. product strategy. Produkte können länderspezifische Unterschiede aufweisen. mySAP. The information in this document is proprietary to SAP. SAP NetWeaver. Duet. mySAP. Alle Rechte vorbehalten. special. Entwicklungen und Funktionen des SAP®-Produkts und ist für SAP nicht bindend. Alle anderen in diesem Dokument erwähnten Namen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. National product specifications may vary. ByDesign. Die in diesem Dokument enthaltenen Informationen sind Eigentum von SAP. a. SAP assumes no responsibility for errors or omissions in this document. links. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. text. weder ausdrücklich noch stillschweigend. spezielle. Business ByDesign. hinsichtlich der Gewährleistung der Marktgängigkeit und der Eignung für einen bestimmten Zweck sowie für die Gewährleistung der Nichtverletzung geltenden Rechts. Data contained in this document serves informational purposes only. Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte können Softwarekomponenten umfassen. Dies gilt u. PartnerEdge und andere in diesem Dokument erwähnte SAP-Produkte und Services sowie die dazugehörigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Ländern weltweit. xApp. and/or development. SAP shall have no liability for damages of any kind including without limitation direct. zu welchem Zweck und in welcher Form auch immer. and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business.. Diese Publikation wird ohne jegliche Gewähr. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. aber nicht ausschließlich. eine Produktstrategie bzw. einen bestimmten Geschäftsweg. Die Angaben im Text sind unverbindlich und dienen lediglich zu Informationszwecken. und SAP unterstützt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewährleistungen oder Zusagen über Internetseiten Dritter ab. xApps. Diese Einschränkung gilt nicht bei Vorsatz oder grober Fahrlässigkeit. This limitation shall not apply in cases of intent or gross negligence. The information contained herein may be changed without prior notice. Business ByDesign. bereitgestellt. SAP übernimmt keine Haftung für Schäden jeglicher Art. All other product and service names mentioned and associated logos displayed are the trademarks of their respective companies. R/3. SAP NetWeaver. mySAP. -entwicklung einzuschlagen. fitness for a particular purpose. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderen Vereinbarung mit SAP. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third-party Web pages nor provide any warranty whatsoever relating to third-party Web pages Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind. ByDesign. or non-infringement. Die Informationen. or consequential damages that may result from the use of these materials. SAP. indirekte oder Folgeschäden im Zusammenhang mit der Verwendung dieser Unterlagen. Dieses Dokument enthält nur vorgesehene Strategien.

Sign up to vote on this title
UsefulNot useful