variables in bi ip
TRANSCRIPT
Variables in BI Integrated PlanningKHNC 28.11.2997
Dr. Gerd Schoeffl, SAPNetWeaver BI RIG EMEA28.11.2007
© SAP 2007 / Page 2
1. Types of Variables2. Variables in Queries and Planning Functions3. Notes/Important Hints4. Examples for Efficient Use of Variables
Agenda
© SAP 2007 / Page 3
Types of Variables
Variables can replace:Characteristic valuesHierarchiesHierarchy nodesTextsNumeric values in formulas
Variables can be used in queries, filters, structures, planning functions etc.
© SAP 2007 / Page 4
Replacement Types for Variables
Variables can be replaced by:Manual Input, with or without default valuesReplacement path (from a query result, another variable)Customer ExitSAP ExitAuthorizations
Manual Input can be switched on for all types except for Replacement Path
© SAP 2007 / Page 5
1. Types of Variables2. Variables in Queries and Planning Functions3. Notes/Important Hints4. Examples for Efficient Use of Variables
Agenda
© SAP 2007 / Page 6
Variables in BI Integrated Planning
Use of variables in queries:when starting the query the variables can be filled by:
a default value,a variant orUser entry
Variables can define thefixed selection,default values,or definition (e.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 avariable.Variables are merged (or melted) by default.
© SAP 2007 / Page 7
Merging of Variables in Queries
Query 1
Var1 Var2
Query 2
Var1 Var2
Variable Popup
Value 1
Value 2
Each Variable only oncein Variable Popup,
variables with samename have same values
in both queries
© SAP 2007 / Page 8
Variables in BI Integrated Planning
Variables in planning functions…Act as parameters of the planning function, such as the source of a copy functionEither have to be filled by a command in the application or a default valueAre NOT instantiated when the application is started, but only when the planning function isexecuted.Are NOT merged with other variables (e.g. 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 functionsVariables with same name in filter and definition of planning function are merged
Variables in Data Slices cannot be filled interactively (use default values,replacement path or Exit)
© SAP 2007 / Page 9
Merging of Variables in Planning Functions
Query 1
Var1 Var2
PF 1
Var1 Var2
Variable Popup
Value 1
Value 2
Filled bycommands in the
planningapplication
© SAP 2007 / Page 10
Use Commands for Executing PlanningFunctions
Commands are customized by a command wizard (WAD and Bex Analyzer).
Variables are parameters of the planning function; they are filledwith the default value of the variable orfrom another source specified in the command wizard:
By a command range in Bex AnalyzerBy data binding with a huge variety of objects as sources in WAD.
Thus setting variables for planning functions e.g. 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,Link the result into a command for a planning function.
Do not assume the variables are set automatically when using the same variable in a query –always explicitly set the variable
© SAP 2007 / Page 11
Setting Variables in Planning Functions in BexAnalyzer
Set a variable value in a planning function:
1. Create a command for executing theplanning function.
=A1
Product 1
3. Use Excel functionality (drop down list,input field etc.) to enter or select avalue and link in via Excel cellreference into the command range.
2. Create a command range.
© SAP 2007 / Page 12
Setting Variables in Planning Functions inWAD II
© SAP 2007 / Page 13
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 thefilters using:
Filter paneDrop down boxRadio buttons
Use of Variables for Interactive Selections
© SAP 2007 / Page 14
1. Types of Variables2. Variables in Queries and Planning Functions3. Notes/Important Hints4. Examples for Efficient Use of Variables
Agenda
© SAP 2007 / Page 15
Default value of variable is filled according to the definition (e.g. entered default value, fromExit etc.).Value can be overtyped, F4 help can be used.User can enter ANY value, F4 help shows ALL values in master data;Exception:
Authorization variables (only authorized values)Compound characteristics (and upper characteristic already restricted)
Variables and Manual Input
© SAP 2007 / Page 16
Variables Type Authorization andReplacement Path
Authorization:Variable values (and F4 help) are restricted by the allowed valuesNo distinction between display and change authorization(!)Consequence for use in planning projects:
Do not use characteristic values that have only display but not change authorizationUse own concept to build work package (see below)
Replacement Path:Variables can be filled by from the result of another queryThe pre-query cannot be defined on an aggregation level.
© SAP 2007 / Page 17
Variable of Type Exit
Standard BW approach:Create a project in transaction cmodAssign enhancement RSR00001Implement the include in the assigned function moduleAttention: one include that implements the logic for all variablesAlternative way to navigate to the include: Function module EXIT_SAPLRRS0_001
© SAP 2007 / Page 18
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).Step 2: Call is made directly after variable entry. This step is only executed if the samevariable is not input ready and could not be filled for step 1.Step 3: In this call, you can check the values of the variables. When an exception (RAISE) istriggered, the variable screen appears again. Step 2 is also called again subsequently.Step 0: The enhancement is not called from the variable screen. The call can originate fromthe authorization check or from the monitor.
The exit receives the information which step is currently processed (parameterI_STEP) and can react accordingly.
© SAP 2007 / Page 19
Call of Exit Variables: Query
Exit variable that is input off:Called any time the variables are processed, e.g. when the query is restarted or variablepopup is called.
Exit variable that is input on:Called only once the application is started in order to fill the default value.Not called when the query is restarted or variable popup is called.Behavior can be changed in Query Designer from SPS14 on.
© SAP 2007 / Page 20
Call of Exit Variables: Other CustomizingObjects
Data SlicesVariable Exits are called ONCE when the application is started.Only restart of application forces variables to be executed again (closing workbook is notenough; restart Bex Analyzer!)Remember: If you use the same variable in a query they are not melted! Refreshing thevariable in the query does not change the variable in the data slice/characteristic relationship
Planning FunctionsPlanning 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 isexecuted (i_step = 1)
© SAP 2007 / Page 21
Example Query and Planning Functions inApplication
Selection ofdata: Query,
Filter, orcomplexbinding
ExitVariable 1
Button:Execute PFData
Binding
Definitionof Planning
Function
ExitVariable 2
Variable refreshedwhen function is
executed
Variable refreshedwhen query is
restarted;
No refresh whenplanning function is
executed
© SAP 2007 / Page 22
Variables and Multiple Applications
Planning Application 1
Exit Var_1
Planning Application 2
Exit Var_1
ABAP Coding for ExitVar_1
Where am I calledfrom?!?
© SAP 2007 / Page 23
Variables and Multiple Applications
Exit cannot determine from which application they are called.
Coding must be independent of the application.
Exit might be called also multiple times in one applications – do not implementcounters in variables.
© SAP 2007 / Page 24
1. Types of Variables2. Variables in Queries and Planning Functions3. Notes/Important Hints4. Examples for Efficient Use of Variables
Agenda
© SAP 2007 / Page 25
Clever Use of Variables in Planning
Some typical requirements in planning applications:Dependent Drop Down Boxes Global parametersGlobal ParametersUser dependent work packages
© SAP 2007 / Page 26
Dependent Drop Down Boxes
Use drop down boxes and two data providers:see documentation: Bex Web, Web Application Examples, Using Cascading DropdownBoxes)
Use compound characteristics (variable popup)Restricts the upper characteristicThe value help for the dependent characteristic in restricted now
© SAP 2007 / Page 27
Global Planning Parameters
Often needed to set global parameters (e.g. planning year, actual planning version)for all users
Parameter is changed by some administrator, end users should not be able tochange it
How to realize:Create a variable ‘manual entry/default value’ and do not check the flag ‘Ready for Input’.Set the default value.Use the variable in the fixed filter or the planning functions/queries.Or: use a customer exit variableOr: use a variable type replacement path that reads the value from a pre-query (InfoCube orDataStoreObject)
© SAP 2007 / Page 28
Work Packages
Each plan user should get a list a values he can choose from.List might depend on the planning applicationList might be a subset of all authorized values (remember – in standard authorization variableno difference between display and change!)List is user dependent
Work packages of different users might intersect (several users working on the sameset of data) or might be disjoint.
If work packages are disjoint locks are easy to handle
© SAP 2007 / Page 29
Repetition: Selections and Locks
Fixed filter:
Cannot be changed atexecution;
All values are locked
Default value fordynamic filter:
Can be changed atexecution;
Does not influencethe locks
© SAP 2007 / Page 30
Work Packages without Intersections
DSO/InfoCubewith username andcountries
Query withrestricted
user
Variable forcountry, input off
(replacement path)
Fixed filter(all countries
in work package)
Country 1
Select a singlecountry in
dynamic filter bydrop down box
© SAP 2007 / Page 31
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 32
Solution: Control the F4 Help, Example
Query withrestricted
user
DataProvider inapplication
Country 1
Filter DropDown Box
with countries
Use command“set variable
value”
Variable forcountry
Fixed filter(ONE country)
DSO/InfoCubewith username andcountries
© SAP 2007 / Page 33
Thank you!
© SAP 2007 / Page 34
Copyright 2007 SAP AGAll 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. The information contained herein may be changedwithout prior notice.Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge and other SAP products and services mentioned herein as well as theirrespective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned andassociated logos displayed are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.
The information in this document is proprietary to SAP. This document is a preliminary version and not subject to your license agreement or any other agreement with SAP. This documentcontains only intended strategies, developments, and functionalities of the SAP® product and is not intended to be binding upon SAP to any particular course of business, product strategy,and/or development. SAP assumes no responsibility for errors or omissions in this document. SAP does not warrant the accuracy or completeness of the information, text, graphics, links, orother items contained within this material. This document is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties ofmerchantability, fitness for a particular purpose, or non-infringement.
SAP shall have no liability for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. This limitationshall not apply in cases of intent or gross negligence.The statutory liability for personal injury and defective products is not affected. SAP has no control over the information that you may access through the use of hot links contained in thesematerials 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, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche Genehmigung durchSAP AG nicht gestattet. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden.Einige von der SAP AG und deren Vertriebspartnern vertriebene Softwareprodukte können Softwarekomponenten umfassen, die Eigentum anderer Softwarehersteller sind.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, Duet, Business ByDesign, ByDesign, PartnerEdge und andere in diesem Dokument erwähnte SAP-Produkte und Servicessowie die dazugehörigen Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und in mehreren anderen Ländern weltweit. Alle anderen in diesem Dokument erwähntenNamen von Produkten und Services sowie die damit verbundenen Firmenlogos sind Marken der jeweiligen Unternehmen. Die Angaben im Text sind unverbindlich und dienen lediglich zuInformationszwecken. Produkte können länderspezifische Unterschiede aufweisen.
Die in diesem Dokument enthaltenen Informationen sind Eigentum von SAP. Dieses Dokument ist eine Vorabversion und unterliegt nicht Ihrer Lizenzvereinbarung oder einer anderenVereinbarung mit SAP. Dieses Dokument enthält nur vorgesehene Strategien, Entwicklungen und Funktionen des SAP®-Produkts und ist für SAP nicht bindend, einen bestimmtenGeschäftsweg, eine Produktstrategie bzw. -entwicklung einzuschlagen. SAP übernimmt keine Verantwortung für Fehler oder Auslassungen in diesen Materialien. SAP garantiert nicht dieRichtigkeit oder Vollständigkeit der Informationen, Texte, Grafiken, Links oder anderer in diesen Materialien enthaltenen Elemente. Diese Publikation wird ohne jegliche Gewähr, wederausdrücklich noch stillschweigend, bereitgestellt. Dies gilt u. a., aber nicht ausschließlich, hinsichtlich der Gewährleistung der Marktgängigkeit und der Eignung für einen bestimmten Zwecksowie für die Gewährleistung der Nichtverletzung geltenden Rechts.
SAP übernimmt keine Haftung für Schäden jeglicher Art, einschließlich und ohne Einschränkung für direkte, spezielle, indirekte oder Folgeschäden im Zusammenhang mit der Verwendungdieser Unterlagen. Diese Einschränkung gilt nicht bei Vorsatz oder grober Fahrlässigkeit.Die gesetzliche Haftung bei Personenschäden oder die Produkthaftung bleibt unberührt. Die Informationen, auf die Sie möglicherweise über die in diesem Material enthaltenen Hotlinkszugreifen, unterliegen nicht dem Einfluss von SAP, und SAP unterstützt nicht die Nutzung von Internetseiten Dritter durch Sie und gibt keinerlei Gewährleistungen oder Zusagen überInternetseiten Dritter ab.
Alle Rechte vorbehalten.