+ All Categories
Home > Documents > CUSTOMER MEASURE FORMULAS.

CUSTOMER MEASURE FORMULAS.

Date post: 18-Apr-2015
Category:
Upload: mohd-habib
View: 16 times
Download: 0 times
Share this document with a friend
Description:
CUSTOMER MEASURE FORMULAS.
31
win Create Customer measure formulas for Fiscal Periodic, QTD and YTD SAP Product Name: SAP Business Planning and Consolidation , version for NetWeaver Applicable Product Versions: 7.0 SP2 and above Document Version 1.0 Last Updated: Apr, 2009 Enterprise Performance Management www.sdn.sap.com/irj/sdn/bpx-cpm How To…
Transcript
Page 1: CUSTOMER MEASURE FORMULAS.

win

Create Customer measureformulas for Fiscal Periodic, QTDand YTD

SAP Product Name: SAP Business Planning and Consolidation ,

version for NetWeaver

Applicable Product Versions: 7.0 SP2 and above

Document Version 1.0

Last Updated: Apr, 2009

Enterprise PerformanceManagement

www.sdn.sap.com/irj/sdn/bpx-cpm

How To…

Page 2: CUSTOMER MEASURE FORMULAS.

© Copyright 2009 SAP AG. All rights reserved.

No part of this publication may be reproduced ortransmitted in any form or for any purpose without theexpress permission of SAP AG. The informationcontained herein may be changed without prior notice.

Some software products marketed by SAP AG and itsdistributors contain proprietary software components ofother software vendors.

Microsoft, Windows, Outlook,and PowerPointareregistered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, ParallelSysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400,iSeries, pSeries, xSeries, zSeries, z/OS, AFP, IntelligentMiner, WebSphere, Netfinity, Tivoli, and Informix aretrademarks or registered trademarks of IBM Corporationin the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registeredtrademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame,WinFrame, VideoFrame, and MultiWin are trademarksor registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks orregistered trademarks of W3C®, World Wide WebConsortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems,Inc., used under license for technology invented andimplemented by Netscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, and otherSAP products and services mentioned herein as well astheir respective logos are trademarks or registeredtrademarks of SAP AG in Germany and in several othercountries all over the world. All other product andservice names mentioned are the trademarks of theirrespective companies. Data

contained in this document serves informationalpurposes only. National product specifications may vary.

These materials are subject to change without notice.These materials are provided by SAP AG and its affiliatedcompanies ("SAP Group") for informational purposesonly, without representation or warranty of anykind, and SAP Group shall not be liable for errors oromissions with respect to the materials. The onlywarranties for SAP Group products and services are thosethat are set forth in the express warranty statementsaccompanying such products and services, if any.Nothing herein should be construed as constituting anadditional warranty.

These materials are provided “as is” without a warrantyof any kind, either express or implied, including but notlimited to, the implied warranties of merchantability,fitness for a particular purpose, or non-infringement.SAP shall not be liable for damages of any kind includingwithout limitation direct, special, indirect, orconsequential damages that may result from the use ofthese materials.SAP does not warrant the accuracy or completeness ofthe information, text, graphics, links or other itemscontained within these materials. SAP has no controlover the information that you may access through theuse of hot links contained in these materials and does notendorse your use of third party web pages nor provideany warranty whatsoever relating to third party webpages.SAP “How-to” Guides are intended to simplify theproduct implementation. While specific product featuresand procedures typically are explained in a practicalbusiness context, it is not implied that those features andprocedures are the only approach in solving a specificbusiness problem using SAP products. Should you wishto receive additional information, clarification orsupport, please refer to SAP Consulting.Any software coding and/or code lines / strings (“Code”)included in this documentation are only examples andare not intended to be used in a productive systemenvironment. The Code is only intended better explainand visualize the syntax and phrasing rules of certaincoding. SAP does not warrant the correctness andcompleteness of the Code given herein, and SAP shallnot be liable for errors or damages caused by the usage ofthe Code, except if such damages were caused by SAPintentionally or grossly negligent.

Page 3: CUSTOMER MEASURE FORMULAS.

1 ScenarioToday, within BPC NW, there exist the concept of measure formulas to be used withinapplications for reporting. This guide will show how to customize these measure formulasand create your own.

The delivered (system generated) Periodic & QTD measures in an YTD Storage typeapplication work only for calendars which start with January (JAN). In this how to, we willcreate custom periodic & QTD measures for the calendar which does not begin inJanuary.

2 IntroductionCustomers can have YTD Storage type application which allows to input/store YTDmeasure. In this type of application, Periodic & QTD are derived through measureformula. The default measure formula created for Period & QTD in this type ofapplication works for the calendar which starts in January. However, customers mayhave fiscal calendar which does not start in January. This how to guide walks throughstep-by-step implementation of custom measure. This solution is applicable for SAPBusiness Planning and Consolidation 7.0 Version for NetWeaver SP02 & higher.

Page 4: CUSTOMER MEASURE FORMULAS.

3 Prerequisites An installed & implemented SAP Business Planning and Consolidation 7.0,

Version for NetWeaver SP02 & higher. SAP ABAP layer access Knowledge in MDX syntax.

4 Restrictions of Measure Maintenance Program Pre-delivered measures cannot be deleted Pre-delivered PERIODIC on a Periodic cube and YTD on a YTD cube measures

cannot be changed. Other measures can be changed at your own risk. Note thatthese changes will be overwritten when you make any changes from Admin clientfor that application. SAP advises to create your own custom measures instead ofchanging the pre-delivered measures.

Formula names cannot be duplicated Formula names must be entered in upper case Usage of Parent node inside the formula is not supported.

5 The Step By Step Solution - Set up YTD StorageApplication.

In this section, we will create a YTD storage application. We will create a YTDapplication by copying PLANNING application delivered in APSHELL

1. Launch BPC AdminClient.

Page 5: CUSTOMER MEASURE FORMULAS.

2. Choose your AppSet

3. Click on “Application”

4. Then, click on “Add a newapplication” or “Copy an Application”if you want to use any existingapplication. Here, we will copy fromPLANNING application of APSHELL.

Page 6: CUSTOMER MEASURE FORMULAS.

5. Choose the existing application toduplicate as “PLANNING” andprovide name & description for thenew application and click on “Copyan Application”.

6. System will create the newapplication.

7. Now, open internet explorer andLaunch the Web Admin client. Useryou server URL (typically,http://<yourserver:port>/osoft/Admin)

Page 7: CUSTOMER MEASURE FORMULAS.

8. Then, go to the application which wejust created by clicking on CVapplication and changing toYTD_PLANNING application.

9. Then, click OK.

Page 8: CUSTOMER MEASURE FORMULAS.

10. Then, Click on “Set ApplicationParameters”. If you are not seeingthis option, you don’t have access tomaintain the parameters.

11. Locate YTDINPUT parameter. Then,change to “Yes”.

12. Click on “Update” button to save thischange. Now, we completed to setup a YTD Application.

Page 9: CUSTOMER MEASURE FORMULAS.

13. Make sure that your security isadjusted to have access to membersof this application. In this example,we do not secure any members. Todo this, choose the application wejust created and click on ModifyApplication.

14. Secured Dimensions have Y on thesecured column.

15. Choose each dimension and clickSecured button in the bottom toremove the security on thesedimensions. Then, click on ModifyApplication to save the changes.

Page 10: CUSTOMER MEASURE FORMULAS.

6 The Step By Step Solution – Create Custom measuresYou can create the custom measures either hard-coding your start period (not year) in themeasure formula or creating an additional property in the TIME dimension which hasyour periods maintained & using this in the custom measure. Here, we will show both themethods.

6.1 Hard-coding the start period in the custom measure

1. Log in ABAP layer from SAP Logonpad.

2. Once logged in, go to transactionSE38.

Page 11: CUSTOMER MEASURE FORMULAS.

3. Type“UJA_MAINTAIN_MEASURE_FORMULA” as program name and click

execute button. If you don’t havethis program in your system, you willhave to upgrade to Support Package02.

4. Provided AppSet, Application ID anduser id. Then, click Execute.

5. In the next screen, double click onPeriodic. Here, you can see that firstperiod is assumed as JAN. We willuse this measure as template for thecustom measure.

Page 12: CUSTOMER MEASURE FORMULAS.

6. Copy the measure formula from theprevious screen and paste in anotepad.

7. Go back to measure formulamaintenance program and click onCreate .

8. Provide Name and Description.Then, paste the measure formulafrom notepad in the Formula box.

Page 13: CUSTOMER MEASURE FORMULAS.

9. Locate the “JAN” period in theformula and change to your firstperiod of your calendar

10. For this example, we changed this toMAY.

11. Locate the “PERIODIC” measurename.

Page 14: CUSTOMER MEASURE FORMULAS.

12. Replace this with your custommeasure name. In this case, weused “CUSTOMPER”

13. Click on Save button to save thisformula.

14. Now the formula will be savedsuccessfully.

Page 15: CUSTOMER MEASURE FORMULAS.

15. Repeat similar steps custom QTDMeasures starting from pre-deliveredQTD Measure. Here, we will bechanging the period value first.

16. Then, wherever PERIODIC measureis referred, we will be replacing thatwith Custom Periodic measure name(in this case CUSTOMPER).

17. Then, change QTD measure nameto your custom QTD name. We willuse CUSTOMQTD in this example.

Page 16: CUSTOMER MEASURE FORMULAS.

18. Then, save the formula.

The MDX codes of custom formulas created here are provided in the appendix.

Page 17: CUSTOMER MEASURE FORMULAS.

6.2 Using a new property of TIME dimension

Here, we will a new property in TIME dimension where we will have to maintain eachbeginning period. In the measure formula, we will use this property to determine the firstperiod of each year.

1. Go to Admin client for the AppSetyou want to make change. ExpandDimension Library & locate yourTIME dimension.

2. Click on “Maintain dimensionproperty”.

Page 18: CUSTOMER MEASURE FORMULAS.

3. Add a new property. In our example,we will add a property called“BEGINPERIOD” with length of onecharacter. Please do not name thisfield as “ISBEGINNING” as this isreserved field name and SAP usesthis field for other purpose.

4. Click on “Modify DimensionProperty” to save the change.

5. Once completed, go to “Maintaindimension members”.

Page 19: CUSTOMER MEASURE FORMULAS.

6. Maintain “X” for Beginning periods.In case of ApShell, this would beTOTAL, Q1, and beginning monthfor each year.

Page 20: CUSTOMER MEASURE FORMULAS.

7. Once all years are maintained, saveto server and process dimension.

8. Log in ABAP layer from SAP Logonpad.

9. We will need technical name of thefield we added to refer this field inthe formula. To find this, Go totransaction MDXTEST.

Page 21: CUSTOMER MEASURE FORMULAS.

10. Choose “Infoprovider” as catalog.Then, locate you CUBE.

11. Expand TIME dimension and then,expand PROPERTIES.

12. Locate the property we added anddrag and drop to right hand sidewindow.

Page 22: CUSTOMER MEASURE FORMULAS.

13. Technical name of the property ishighlighted. Have this name copiedto a notepad.

14. Go to transaction SE38.

15. Type“UJA_MAINTAIN_MEASURE_FORMULA” as program name and click

execute button. If you don’t havethis program in your system, you willhave to upgrade to Support Package02.

Page 23: CUSTOMER MEASURE FORMULAS.

16. Provided AppSet, Application ID anduser id. Then, click Execute.

17. In the next screen, double click onPeriodic.

18. Copy the measure formula from theprevious screen and paste in anotepad.

Page 24: CUSTOMER MEASURE FORMULAS.

19. Go back to measure formulamaintenance program and click onCreate .

20. Provide Name and Description.Then, paste the measure formulafrom notepad in the Formula box.

21. Replace the PERIODIC measurename with your customer measurename.

Page 25: CUSTOMER MEASURE FORMULAS.

22. Replace([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="TOTAL" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="Q1" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="JAN" )

With([%TIME%].CURRENTMEMBER.PROPERTIES("<tech name>")="X").

<tech name> - technical name from step 13.

23. Press save.

24. Click OK.

Page 26: CUSTOMER MEASURE FORMULAS.

25. Now, we will create QTD formula.Double-click on QTD formula.

26. Copy the formula to a notepad.

27. Click on Create button.

Page 27: CUSTOMER MEASURE FORMULAS.

28. Provide Formula Name, Descriptionand paste QTD formula from thenotepad.

29. Change all the PERIODIC measuresto custom measure name. In thisexample, this will be CUSTOMPER.

30. Change QTD measure name to yourcustom measure name. In thisexample, we will use“CUSTOMQTD”.

Page 28: CUSTOMER MEASURE FORMULAS.

31. Replace([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="TOTAL" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="Q1" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="JAN" )

With([%TIME%].CURRENTMEMBER.PROPERTIES("<tech name>")="X").

<tech name> - technical name from step 13.

32. Press save to save the formula.

33. Click OK to confirm.

Page 29: CUSTOMER MEASURE FORMULAS.

34. Now, the custom measures arecreated.

Example Measure formula are provided in the appendix.

Page 30: CUSTOMER MEASURE FORMULAS.

7 Appendix

Hard-coding first period in the measure formula:

Elements in bold are changed from the standard formula.

Periodic Formula:MEMBER [MEASURES].[YTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ"),-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])))'SOLVE_ORDER=3##MEMBER [MEASURES].[CUSTOMPER] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP") AND NOT([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="TOTAL" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="Q1" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="MAY" ), [MEASURES].[YTD]-([MEASURES].[YTD],[%TIME%].LAG(1)), [MEASURES].[YTD])' SOLVE_ORDER=3

QTD Formula:MEMBER [MEASURES].[YTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ"),-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])))'SOLVE_ORDER=3##MEMBER [MEASURES].[CUSTOMPER] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP") AND NOT([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="TOTAL" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="Q1" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/PERIOD")="MAY" ), [MEASURES].[YTD]-([MEASURES].[YTD],[%TIME%].LAG(1)), [MEASURES].[YTD])' SOLVE_ORDER=3## MEMBER[MEASURES].[CUSTOMQTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP"),IIF([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="QUARTER",[MEASURES].[CUSTOMPER],IIF([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="MONTH" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="WEEK" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="DAY",SUM(PERIODSTODATE([%TIME%].CURRENTMEMBER.PARENT.LEVEL,[%TIME%].CURRENTMEMBER),[MEASURES].[CUSTOMPER]),NULL)),[MEASURES].[YTD])'SOLVE_ORDER = 3

Using TIME dimension’s property in the measure formula:

Elements in bold are changed from the standard formula.

Periodic Formula:MEMBER [MEASURES].[YTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ"),-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])))'SOLVE_ORDER=3##MEMBER [MEASURES].[CUSTOMPER] AS

Page 31: CUSTOMER MEASURE FORMULAS.

'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP") AND NOT([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/MOPOFSI")="X"), [MEASURES].[YTD]-([MEASURES].[YTD],[%TIME%].LAG(1)), [MEASURES].[YTD])' SOLVE_ORDER=3

QTD Formula:MEMBER [MEASURES].[YTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ"),-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])),([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TIME%].[LEVEL02])))'SOLVE_ORDER=3##MEMBER [MEASURES].[CUSTOMPER] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES ("2/CPMB/ACCTYPE")="EXP") AND NOT([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/MOPOFSI")="X"), [MEASURES].[YTD]-([MEASURES].[YTD],[%TIME%].LAG(1)), [MEASURES].[YTD])' SOLVE_ORDER=3## MEMBER[MEASURES].[CUSTOMQTD] AS'IIF(([%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC" OR[%P_ACCT%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP"),IIF([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="QUARTER",[MEASURES].[CUSTOMPER],IIF([%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="MONTH" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="WEEK" OR[%TIME%].CURRENTMEMBER.PROPERTIES("2/CPMB/TILEVEL")="DAY",SUM(PERIODSTODATE([%TIME%].CURRENTMEMBER.PARENT.LEVEL,[%TIME%].CURRENTMEMBER),[MEASURES].[CUSTOMPER]),NULL)),[MEASURES].[YTD])'SOLVE_ORDER = 3


Recommended