5 KNOWLEDGEBASE
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Contents Summary: .................................................................................................................................................................................................................. 3 Script Logic Basics...................................................................................................................................................................................................... 3 Business Scenario: ..................................................................................................................................................................................................... 3 SAP BPC Solutions Data Model: .............................................................................................................................................................................. 4 Solutions Building Blocks ........................................................................................................................................................................................... 5 Logic Script in Action: .............................................................................................................................................................................................. 11 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. *XDIM_MEMBERSET ............................................................................................................................................................................... 11 *XDIM_ADDMEMBERSET ........................................................................................................................................................................ 21 *XDIM_MAXMEMBERS ........................................................................................................................................................................... 25 *XDIM_FILTER ......................................................................................................................................................................................... 26 *INCLUDE ................................................................................................................................................................................................ 29 *WHEN / *ENDWHEN ............................................................................................................................................................................. 30 *REC ........................................................................................................................................................................................................ 32 TMVL ....................................................................................................................................................................................................... 35 *SELECT ................................................................................................................................................................................................... 38 *SELECTCASE / *ENDSELECT .............................................................................................................................................................. 42 *FOR / *NEXT..................................................................................................................................................................................... 46 *ADD / *ENDADD .............................................................................................................................................................................. 49 13. *BEGIN / *END............................................................................................................................................................................. 52 *FUNCTION / *ENDFUNCTION........................................................................................................................................................... 54 *SUB / *ENDSUB................................................................................................................................................................................ 57 LOOKUP ............................................................................................................................................................................................. 60 RUN ALLOCATION .............................................................................................................................................................................. 64
18. *COMMIT ..................................................................................................................................................................................................... 69 Debugging Script Logic: ........................................................................................................................................................................................... 73 Golden Rules of Script Logic: ................................................................................................................................................................................... 78 Calling Script Logic Various Options: .................................................................................................................................................................... 79
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Summary:
The purpose of this document is to demonstrate the implementation of script logic in reallife projects, which includes designing, creating, executing and debugging Script Logic in a SAP BPC 10. This document educates the user only the essential topics that are required to solve practical problems and it expose the user to the Script Logic commands that are widely used in any business process automations such as Budget Allocation Revenue Distributions Cost Calculations Revenue and Cost Implementation Impact of Financial Statements Scenario (What If) Analysis Adjustment to plan to formalizing forecasting
Business Scenario:
WalMart automates their Sales Revenue Planning process through SAP BPC NW 10 software and here, we are using SAP BPCs core function of Script Logic to perform key business calculations and also automatic data management. Also it has been identified to implement a special requirements on the planning calculations and distribution.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
SPECIAL_DISCOUNT(1)
AGENT_COMMISSION
Dimension ZS_ACCOUNT
The following image shows the member sheet of ZS_ACCOUNT dimension
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Dimension ZS_CATEGORY
The following image shows the member sheet of ZS_CATEGORY dimension
Dimension ZS_ENTITY
The following image shows the member sheet of ZS_ENTITY dimension
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Dimension ZS_RPTCURRENCY
The following image shows the member sheet of ZS_RPTCURRENCY dimension
Dimension ZS_TIME
The following image shows the member sheet of ZS_TIME dimension
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Dimension ZS_PRODUCT
The following image sheet of ZS_PRODUCT dimension
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
We will be discussing all of the above sections in details of the above in a short while.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
Note: Instead of having a separate logic file, the code can be put into the Default.lgf file and it will get executed when data is sent to the BPC server. This may not be a good practice and may not be manageable if the script has lots of lines of code. These are all sample steps, there are several different ways to implement a Script logic
Scoping Commands
1. 2. 3. 4. *XDIM_MEMBERSET *XDIM_ADDMEMBERSET *XDIM_MAXMEMBERS *XDIM_FILTER
Body/Code/Processing Commands
5. *INCLUDE 6. *WHEN/ENDWHEN 7. *REC 8. TMVL Parameter 9. *SELECT 10. *SELECTCASE/ENDSELECT 11. *FOR/*NEXT 12. *ADD/*ENDADD 13. *BEGIN/*END 14. *FUNCTION/*ENDFUNCTION 15. *SUB/*ENDSUB 16. *LOOKUP 17. *RUNALLOCATION
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
10
Saving Commands
18. COMMIT
Business Scenario:
Increase the discount given to the PRODUCT [LAPTOP] by 10% and book the value to the SPL_DISCOUNT [ACCOUNT] for PLAN data for the period 2012.01
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
11
Implementation steps:1) Launch Planning and Consolidation Administration and log into Environment :- ZEENAT
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
12
2) Under the Environment ZEENAT, click on Rules - > Logic Scripts -> Click on Scripts for: ZS_PLANNING
3) Click on LOGIC_1.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
13
5) Click the link on Validate and then Save which appears on the top.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
14
6) Now, Click on Scripts for: ZS_PLANNING and look for the file Default.lgf file. If it does not exist, create a new one and enter the code as mentioned below:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
15
8) Click on EPM Office Add-in Excel. Choose the options as shown below
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
16
9) Login to ZS_PLANNING Environment and select the following EPM Context as shown below
10) Open the Input Form Template Trend By Account and click on refresh
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
17
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
18
11) As shown below, enter data for Discount account and click the button at the top Send and Refresh worksheet Data
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
19
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
20
14) Following screen shows the value 6, which is 10% of 60[DISCOUNT Account], in the Special Discount Account.
2. *XDIM_ADDMEMBERSET
Syntax: *XDIM_ADDMEMBERSET {dimension} = {members set} Description: *XDIM_ADDMEMBERSET allows you to add/join/union members to the data region already passed by *XDIM_MEMBERSET command. This is different from *XDIM_MEMBERSET command in that, the data region defined by subsequent *XDIM_MEMBERSET overrides the data region defined by earlier *XDIM_MEMBERSET. Example: *XDIM_MEMBERSET ZS_TIME=BAS(2011.Q1) *XDIM_ADDMEMBERSET ZS_TIME=2011.04
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
21
Business Scenario:
Calculate special discount and copy it to 2011 first quarter. And also, calculate and copy the same to 2011.04 2.1 Create a new logic file LOGIC_ADDMEMBER as follows:-
Point Default.LGF to LOGIC_ADDMEMBER.LGF 2.2 Enter discount data for 2011.04 as below. Take note of the current view here.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
22
2.2 Open an Input Form template (Account Trend). Here, the EPM Context and pane should be set as follows to get the following screen 2011.Q1. Enter discount data for first quarter of 2011. Click Save Data-> Save and Refresh worksheet data.
Here, the data (discount) is entered for 2011.Q1 (Jan, Feb and Mar) months and the scope of the member set is defined as BAS (2011.Q1). As the requirement is to calculate for 2011.04 also, the XDIM_ADDMEMBERSET ZS_TIME=2011.04 is included to add more members (2011.04) to define the scope. Now, change the memberset parameter for ZS_TIME as 2011.01, 2011.02, 2011.03 and 2011.04. Click Expand All now.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
23
This will show the calculation of special discount for 2011s first quarter and also for 2011.04 as shown below:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
24
3. *XDIM_MAXMEMBERS
Syntax : *XDIM_MAXMEMBERS {dimension} = {max number of members} Description: When there are too many records to be processed, *XDIM_MAXMEMBERS can be used to do batch processing, i.e. you can tell the server to process the first batch of records(say 100 records) and when that is completed, next batch can be started. This stops the server from slowing down which arises when too many records are being processed in-memory. Example: *XDIM_MEMBERSET ZS_CATEGORY=ACTUAL *XDIM_MEMBERSET ZS_TIME=2010.01 *XDIM_MEMBERSET ZS_ACCOUNT=QTY,U_PRICE,U_COST *XDIM_MAXMEMBERS ZS_PRODUCT=5 *WHEN ZS_ACCOUNT *IS "QTY" *REC(EXPRESSION=%VALUE%*1.1,ZS_CATEGORY=PLAN,ZS_TIME=2010.01) *IS "U_PRICE","U_COST" *REC(EXPRESSION=%VALUE%,ZS_CATEGORY=PLAN,ZS_TIME=2010.01) *ENDWHEN *COMMIT The above example processes 5 Products at a time. Once that is completed, it picks the next 5 Products and it goes on like that.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
25
4. *XDIM_FILTER
Syntax : *XDIM_FILTER {Dimension name} = { Dimension name }.properties(Property Name) = Property Value Description: This command selects all the members satisfying the condition. Example: *XDIM_FILTER ZS_ENTITY=[ZS_ENTITY].properties("SPECIAL_DISCOUNT")="Y" Business Scenario: Calculate special discount which is 10% of discount for first quarter of 2006 for the entities for which, the special discount property is Y. 4.1 Create a logic file LOGIC_FILTER.LGF as follows: Point Defalut.LGF to LOGIC_FILTER.LGF.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
26
4.2 Open an input Form (Nested Rows)as shown below. Specify the member set parameter as DISCOUNT, SPL_DISCOUNT for ZS_ACCOUNT. Click Expand All button. In the following screen, enter DISCOUNT FOR India, Singapore and Germany.
Note that ONLY India and Germany are having SPECIAL_DISCOUNT property as Y.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
27
4.3 Now, enter the discount data for India, Singapore and Germany. And, click the Save and Refresh worksheet data.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
28
4.4 The following screen shows the special discount only for India and Germany
5. *INCLUDE Syntax : *INCLUDE {Logic file Name} Description: Multiple files can be put into a single logic file and this file can then be included in the main logic file. When .LGF file is generated, main logic file is stuffed with the code in the included logic file. Example:
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
29
*INCLUDE LOGIC_SUB.LGF 6. *WHEN / *ENDWHEN Syntax : *WHEN {criteria} *IS [=]{value1}[,{value2},] | <>{value} *REC(FACTOR={Real number}|EXPRESSION={Expression}[,{dim1}={member},{dim2}=]) [ *REC(FACTOR={Real number}|EXPRESSION={Expression}[,{dim1}={member},{dim2}=])] [*ELSE] *ENDWHEN Description: {Criteria} is the member property name to test. *IS is followed the values to be testes against. It has to be comma delimited if multiple values are to be checked against. The operators allowed are = and <>. If no operator is specified, then = is assumed. Example: *WHEN ZS_ACCOUNT *IS QTY *REC(EXPRESSION=%VALUE%, ZS_CATEGORY=PLAN, ZS_TIME=2008.01) *REC(EXPRESSION=%VALUE%, ZS_CATEGORY=PLAN, ZS_TIME=2008.02) *REC(EXPRESSION=%VALUE%, ZS_CATEGORY=PLAN, ZS_TIME=2008.03) *ENDWHEN Business Scenario: Copy Quantity accounts ACTUAL data for JAN, 2007 to JAN,FEB & MAR, 2008 PLAN data for the product - LAPTOP. 17.1 Create a new logic file LOGIC_WHEN.LGF in the Script Logic folder. Point Default.LGF to the new logic file. Validate and Save both logic files. The new logic file is as follows:
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
30
6.2 Now, change the Current View as follows. This will refresh the screen with the latest data from the database.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
31
6.3 The following screen shows the data copied to JAN, FEB & MAR 2008.
7.
*REC
Syntax : *REC ( {Expression/Factor to change the signed data}, {Comma delimited additional member values to insert/update in the target member} ) Description: *REC() generated a new record to post to the database. Multiple *REC() statements can be used to insert multiple new records in to the target/dimension. *REC() can also be used to update the same record in the dimension and this is achieved through delta record/update.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
32
Example: *WHEN ZS_ACCOUNT *IS QTY *REC(EXPRESSION=%VALUE%*1.1,ZS_CATEGORY=PLAN,ZS_TIME=2006.07) *REC(EXPRESSION=%VALUE%*1.1,ZS_CATEGORY=PLAN,ZS_TIME=2006.08) *REC(EXPRESSION=%VALUE%*1.1,ZS_CATEGORY=PLAN,ZS_TIME=2006.09) *ENDWHEN Business Scenario: Increase quantity data by 10% for APR, 2005 for the product LAPTOP, for the ACTUAL category and copy it to JUL, AUG & SEP 2006s PLAN data 7.1 Create a logic file LOGIC_REC.LGF under the folder : In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING , as follows:
Validate and Save LOGIC_REC.LGF. And, point Default.LGF to LOGIC_REC.LGF. Validate and Save it.
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
33
7.2 In the following screen, enter Quantity as 1000 for APR 2006 as below:
Click Save and Refresh worksheet data Button. 7.3 The following screen shows the Quantity(increased by 10%) data for JUL, AUG, SEP, 2006(PLAN), which have been copied from APR, 2006 for the same product.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
34
8. TMVL Syntax : TMVL(offset, base_period) Description: This command returns time value after offsetting the value from the base period which is passed as parameter to this command. This command works with only base members. Nested commands are not supported. Example: TMVL(1, 2006.OCT) //will return NOV, 2006 Business Scenario: Increase the ACTUAL quantity by 10% for OCT, 2006 and book it to PLAN data for OCT, 2007. 8.1 Create a new logic file LOGIC_TMVL.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_TMVL.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_TMVL.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
35
8.2 Make sure the EPM pane is as follows to get the following screen which contains OCT, 2007 PLAN data. The data is empty now.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
36
8.3 Now, change the EPM pane as follows to get the following screen to enter data for OCT, 2006 and ACTUAL. Key in data for Quantity and click on Save Data - > Save and Refresh worksheet data.
8.4 Again, change the EPM Pane as follows to see the OCT, 2007 Planned data. Here, the Quantity has been increased by 10%.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
37
9. *SELECT
Syntax: *SELECT ({variable}, {[What]}, {from dimension}, {Where}) Variable - Holds the selected (retrieved) data What - Property which need to be retrieved From Dimension - From which Dimension the data need to retrieved Where - The selection criteria Description: The special instruction *SELECT allows the user to retrieve a list of elements from a dimension and save it in a user-defined variable for later use anywhere else in the logic. The SELECT instruction is not specific to a given logic section, but it can be written once anywhere in the logic and used across multiple commit sections. The SELECT statement is fairly limited, as it only supports the equal sign (=), not equal to (<>) and cannot be used to combine multiple filter criteria with AND or OR keywords. The dataset retrieved using *SELECT can be used in XDIM_MEMBERSET to define scope. The memory variables are defined at compile time, not at run-time, so the logic file needs to be revalidated when new members are added to the dimensions. Example: *SELECT (%PRODSET%,"ID",ZS_PRODUCT,"AGENT_COMMISSION='A'") 9.1 Select all the entities which are having AGENT_COMMISSION property as A and save the retrieved dataset in %PRODSET% variable which can later be used in the script. Business Scenario: Calculate the Agent Commission which is 3% of Revenue for all the products which are having A in their AGENT_COMMISION property for Jan, 2006 when Revenue data is entered/ calculated. 9.2 Create a new logic file LOGIC_SELECT.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_SELECT.LGF Remove all the INCLUDEs from Default.LGF
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
38
9.3 Make sure the EPM Pane and Context is set as shown in the following screen which contains 2009 Q3 (Jul, Aug and Sep) PLAN data for the product LAPTOP. The data is empty for AGT_COMM.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
39
9.4 Now enter data in REVENUE for 2009 Q3 (Jul, Aug and Sep), PLAN and for the Product LAPTOP. And, click on Save Data-> Save and Refresh Worksheet Data.
9.5 Verify 2009 Q3 Planned data for the product LAPTOP. Here, the AGT_COMM have been calculated as 3% of REVENUE as the AGENT_COMMISION property value for the product LAPTOP is A
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
40
9.6 Now change the LAPTOP to DESKTOP for the Product in EPM Context and enter data in REVENUE for 2009 Q3 (Jul, Aug and Sep), PLAN. And, click Save and Refresh worksheet data.
9.7 Verify 2009 Q3 Planned data for the product DESKTOP. Here, the AGT_COMM has not been calculated as the AGENT_COMMISION property value for the product DESKTOP is B
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
41
10. *SELECTCASE / *ENDSELECT Syntax: *SELECTCASE {expression} *CASE {value1}[,{value2},] {Formulae} [*CASE {value1}[,{value2},] {Formulae} [*CASEELSE] {Formulae} *ENDSELECT where {Expression} is the condition to be evaluated {value1},.. is the range of comma-delimited results that satisfy the condition for the current case Description: *SELECTCASE is an alternate to IIF MDX statements and expands into IIF when executed. IIF and SELECTCASE have same impact on the performance. Example: *SELECTCASE [ZS_PRODUCT].CURRENTMEMBER.PROPERTIES("AGENT_COMMISSION") *CASE "A" [#AGT_COMM]=[REVENUE]*0.03 *CASE "B" [#AGT_COMM]=[REVENUE]*0.02 *CASEELSE [#AGT_COMM]=[REVENUE]*0.01 *ENDSELECT Agent Commission for the each product is calculated based on the Product DIMs AGENT_COMMISSION property.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
42
Business Scenario: Calculate the Agent Commission for all the products based on the AGENT_COMMISION property (A 3% 0f Revenue, B 2% of Revenue, <empty> - 1% of Revenue) for 2009 Q4 when Revenue data is entered/ calculated. 10.1 Create a new logic file LOGIC_SELECTCASE.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_SELECTCASE.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_SELECTCASE.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
43
10.2 Make sure the EPM Context and EPM panes is set as follows to get the following screen which contains 2009 Q4 (Oct, Nov and Dec) PLAN data for the product LAPTOP. The data is empty for AGT_COMM.
10.3 Now enter data in REVENUE for 2009 Q4 (Oct, Nov and Dec), PLAN and for the product LAPTOP. And, click Save Data - > Save and Refresh worksheet Data
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
44
10.4 Verify 2009 Q4 Planned data for the product LAPTOP. Here, the AGT_COMM have been calculated as 3% of REVENUE as the AGENT_COMMISION property value for the product LAPTOP is A
10.5 Now change the LAPTOP to DESKTOP for the Product in EPM Context and enter data in REVENUE for 2009 Q4 (OCT,NOV and DEC), PLAN. And, click Save Data - > save and refresh worksheet data.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
45
10.6 Verify 2009 Q4 Planned data for the product DESKTOP. Here, the AGT_COMM has been calculated as 2% of the Revenue as the AGENT_COMMISION property for DESKTOP is B.
11. *FOR / *NEXT Syntax : *FOR {variable1} = {set1} [ AND {variable2={set2}] {text} {text} *NEXT Description: *FOR / *NEXT is used to execute the scripts written between *FOR and *NEXT repeatedly. Variables will be used in FOR loop to identify the records. Example: *WHEN ZS_ACCOUNT *IS "QTY" *FOR%CURMONTH%=2006.10,2006.11,2006.12
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
46
*REC(EXPRESSION=%VALUE%*1.1,ZS_CATEGORY=PLAN,ZS_TIME=TMVL(12,%CURMONTH%)) *NEXT *ENDWHEN Here, the *REC function will get executed for each month (2006.10,2006.11,2006.12) and the %CURMONTH% variable is used to hold the time value. Business Scenario: Increase the ACTUAL quantity by 10% for 2006 Q4 and book it to PLAN data for 2007 in same Months 11.1 Create a new logic file LOGIC_SELECTNEXT.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_SELECTNEXT.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_SELECTNEXT.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
47
11.2 Make sure the EPM Context and Pane is set as follows to get the following screen which contains 2007 Q4 (Oct, Nov and Dec) PLAN data. The data is empty now.
11.3 Now, change the EPM Context as follows to get the following screen to enter data for 2006 Q4 (Oct, Nov and Dec) and ACTUAL. Key in data for Quantity and click on Save Data - > Save and Refresh worksheet data.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
48
11.4 Again, change the EPM Context and the pane to set as follows to see 2007 Q4 Planned data. Here, the Quantities have been increased by 10% for 3 months.
12.
*ADD / *ENDADD
Syntax: *ADD {variable} = {set} {Formula} *ENDADD Description: *ADD / *ENDADD allows members values, delimited by comma, to be Accumulated/added and then to be stored in a calculated member. Example: *ADD %VARCOST% = [DISCOUNT], [SPL_DISCOUNT], [AGT_COMM] [#VAR_COSTS]= %VARCOST% *ENDADD Business Scenario: Calculate the variable costs[VAR_COSTS] by adding Discount, Special Discount & Agent Commission, and then booking it to VAR_COSTS account for PLAN data for the period
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
49
2008, JAN. 12.1 Create a new logic file LOGIC_2.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_2.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_2.LGF in Default.LGF Save and Validate Default.LGF
12.3 The following screen shows the data for before the calculation of variable costs:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
50
12.4 Now, enter the Discount,AGT_COMM and special discount values as shown below and click the button Save and refresh worksheet data
12.5 The following screen shows variable costs as 70 which is a sum of Discount, Special Discount and Agent Commission Accounts.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
51
13.
Syntax : *BEGIN {Formula}. {Continuation of same Formula} {Continuation of same Formula} *END Description: *BEGIN / *END is used to split long formulae into multiple lines to improve readability. Example: *BEGIN [#VAR_COSTS] = [DISCOUNT] + [SPL_DISCOUNT] + [AGT_COMM] *END Business Scenario: Calculate the variable costs[VAR_COSTS] by adding Discount, Special Discount & Agent Commission, and then booking it to VAR_COSTS account for PLAN data for the period 2008, JAN. Ensure that the formula, adding the values, is spread across multiple line. 13.1 Create a new logic file LOGIC_BEGIN.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_BEGIN.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_BEGIN.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
52
13.2 After entering the following data, click the Button Save and Refresh worksheet data.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
53
14.
*FUNCTION / *ENDFUNCTION
Syntax : * FUNCTION Function_Name( param1, param2, etc) Function Text * ENDFUNCTION Description: *FUNCTION / *ENDFUNCTION allows you to write user defined functions where in formulae can be put in and can be called from the main logic. These functions could be in a separate logic file or part of the mail logic file(in-line). This can improve the readability of the logic statement. Unlike Subroutines, Functions return a value. Example: *FUNCTION GETREV(%QUANTITY%,%UNIT_PRICE%) %QUANTITY%*%UNIT_PRICE% *ENDFUNCTION
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
54
Business Scenario: Multiply Quantity by Unit Price and boot it to REVENUE account for the year Feb, 2008 for the product - LAPTOP. 14.1 Create a new logic file FUNCTIONS.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate FUNCTIONS.LGF This should contain the function (GETREV) which will be called from the mail logic file LOGIC_FUNCTIONS.LGF. Script the FUNCTIONS.LGF file as follows:
Create a new logic file LOGIC_FUNCTION.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_ FUNCTION.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_ FUNCTION.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
55
First line in the script includes the FUNCTIONS.LGF. And, the last line in the script calls the GETREV() function that is stuffed in the FUNCTIONS.LGF. Now, point Default.LGF to LOGIC_FUNCTIONS.LGF. Validate and Save the two .LGF files. 14.3 Now, enter the quantity value as 100 and unit price as 1000 as shown below:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
56
15. *SUB / *ENDSUB Syntax : *SUB {SubName}({Param1,[,{Param2}]) {body text} {body text} {body text} [] *ENDSUB Description: *SUB / *ENDSUB allows you to create sub routines which can be called from the main logic. It is similar to *FUNCTION except that subroutines can not return values. And, *SUB / *ENDSUB does not have to be in a separate a file it can be part of the main logic. If a particular segment of the code is to be repeated, then it can be coded as a subroutine and called from main code. Example:
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
57
*SUB SET_REV ( %QUANTITY%, %PRICE% ) [ZS_ACCOUNT].[#REVENUE] = %QUANTITY% * %PRICE% *ENDSUB SET_REV( [ZS_ACCOUNT].[QTY], [ZS_ACCOUNT].[U_PRICE] ) Business Scenario: Calculate REVENUE by multiplying QTY and U_PRICE and book it to REVENUE account for the PLAN data for the year MAR, 2008 for the product - LAPTOP. 15.1 Create a new logic file LOGIC_SUB.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_SUB.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_SUB.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
58
15. 2 Make sure the EPM Context and EPM Pane is set to get the following screen. And, key in the data for Quantity and Unit Price as follows too:
Click on Save and Refresh Worksheet Data 15.3 The following screen shows the calculated REVENUE, which is performed by the sub routine.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
59
16. LOOKUP Syntax : *LOOKUP {App} *DIM [{LookupID}:]{DimensionName}="Value" | {CallingDimensionName}[.{Property}] *DIM MEASURES=MeasureName *ENDLOOKUP Description: When a value, which is not inside the current data region, is required for calculation, LOOKUP can be used. LOOKUP can be used to retrieve value from current model or another model. Only one LOOKUP is allowed per COMMIT block. Example: *LOOKUP RATE *DIM TIME=ZS_TIME.ID *DIM CATEGORY="ACTUAL" *DIM R_ACCT="AVG" *DIM R_ENTITY="GLOBAL" *DIM ZSCCURR:INPUTCURRENCY=ZS_ENTITY.CURRENCY *DIM RATEEUR:INPUTCURRENCY="EUR" *DIM RATEUSD:INPUTCURRENCY="USD" *DIM MEASURES="PERIODIC" *ENDLOOKUP Business Scenario: Convert NETREVENUE from ZS_ENTITYs local currency to the reporting currencies(USD & EUR). 16.1 Create a new logic file LOGIC_LOOKUP.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_ LOOKUP.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
60
Remove all the INCLUDEs from Default.LGF Include LOGIC_ LOOKUP.LGF in Default.LGF Save and Validate Default.LGF
16.2 Open the Nested Rows Dynamic Report Template as per the EPM Context and EPM pane parameters shown below to view the data available before running the LOGIC_LOOKUP.LGF. Following screen shows no NETREVENUE data for all the currencies for second quarter of 2008.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
61
There is no data available for any currencies for Account - NETREVENUE, Product LAPTOP and Entity India. 16.3 Make sure that you have the exchange rates available in the Rates model as shown below:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
62
16.4 Now, use the Trend by Account Dynamic Input Form, enter the NETREVNUE data for local currency (Indian Rupees) for second quarter for 2008.Click on Save and Refresh Worksheet Data. This will save the data in local currency (INR) and the LOGIC_LOOKUP will insert two more records (one for USD currency and another one for EUR currency) by coverting the NETREVENUE for the Indian Rupees using the exchange rates from RATES Model.
16.5 Open a Nested Row dynamic report template with current view as shown below.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
63
The above screen shows the data records for the respective reporting currencies USD & EUR, apart from local currency(LC).
17.
RUN ALLOCATION
We will be using ZS_LOGIC Model which will be having the same Dimensions as that of ZS_PLANNING Model except the following change in ZS_ENTITY dimension
And also we have one more dimension in ZS_LOGIC Model i.e. ZS_AUDITTRAIL as shown below :-
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
64
Syntax : *RUNALLOCATION *FACTOR=<driver> *DIM P_ACCT WHAT=<source>; WHERE=<target>; USING=<distribution key>; [TOTAL=<distribution key>] *DIM <other dimensions> *ENDALLOCATION Description: Allocation engine helps to distribute the data from a source region to a target region using the specified driver. Allocation is often used in Planning as a top-down scenario. The following are the elements which define the allocation: WHAT: Source (Base members which holds the data(amount) to be allocated) WHERE: Target (Destination Base members where the allocated data(amount) will be written) USING: (Optional) Member storing an Allocation Factor/ the "Amount" of the Driver TOTAL: (Optional) Sum of the driver or the Using Amounts FACTOR: (Optional) How to calculate the Distribution Key using "USING" and "TOTAL"
A SAP EPM/BPC Community Service
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
65
Example: *RUNALLOCATION *FACTOR=USING/TOTAL *DIM ZS_ENTITY WHAT=ALLOC_ENTITY; WHERE=BAS(HQ); USING= <<<; TOTAL= <<<; *DIM ZS_ACCOUNT WHAT=REV_TARGET; WHERE= <<<; USING= NETREVENUE; TOTAL= <<<; *DIM ZS_CATEGORY WHAT=PLAN; WHERE= <<<; USING= ACTUAL; TOTAL= <<<; *DIM ZS_RPTCURRENCY WHAT=USD; WHERE= <<<; USING= <<<; TOTAL= <<<; *DIM ZS_TIME WHAT=2009.09; WHERE= 2009.09; USING= 2008.09; TOTAL= <<<; *ENDALLOCATION The above can be written as follows:
*RUNALLOCATION *FACTOR = USING/TOTAL *DIM ZS_CATEGORY WHAT=Plan;WHERE=Plan;USING=Actual;TOTAL=Actual *DIM ZS_TIME WHAT=2009.02;WHERE=2009.02;USING=2008.02;TOTAL=2008.02 *DIM ZS_ENTITY WHAT=ASA;WHERE=BAS(RASA);USING=BAS(RASA);TOTAL=BAS(RASA) *DIM ZS_ACCOUNT WHAT=NETREVENUE;WHERE=NETREVENUE;USING=NETREVENUE;TOTAL=NETREVENUE *DIM ZS_AUDITTRAIL WHAT=BEFORE_ALLOC;WHERE=INSIDE_ALLOC;USING=BEFORE_ALLOC;TOTAL=BEFORE_ALLOC *ENDALLOCATION
17.1 Create a new logic file BPC_ALLOCATION.LGF under in ZEENAT (in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_LOGIC Save and Validate BPC_ALLOCATION.LGF Remove all the INCLUDEs from Default.LGF Include BPC_ALLOCATION.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
66
Business Scenario: Allocate the amount USD : 30 million in revenue target account, to all the entities which are coming under the RASA for the year/month FEB, 2009, using the ACTUAL net revenue generated by those entities in FEB, 2008. 17.1 The following screen shows the net revenue generated by the concerned entities for the year/month FEB, 2008:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
67
The amount shown in the above screen will be used by the allocation engine to calculate the amount to be allocated to those entities for FEB, 2009. 17.2 Enter the allocation amount USD : 30 million, in the ASA(which is the entity to hold the amount to be allocated) as in the following screen:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
68
Click on Save and Refresh worksheet data. This will do the allocation. The following screen will show the allocated amount to the respective entities. 17.2 The following screen shows how the 30 million USD is distributed to the NET REVENUE to those entities. Make sure that the ZS_AUDITTRAIL from BEFORE_ALLOC to INSIDE_ALLOC
18. *COMMIT
Syntax : *COMMIT Description: Logic engine performs the processing in memory. And, *COMMIT is used to post the processed data to the database. In the logic file, there could be multiple *COMMIT statements. This is needed when the logic file contains multiple sections of code wherein, one section of the code needs the output of another section. Under these circumstances, the section containing the output has to be committed so that the other section can use the output value in its processing.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
69
After committing the records, data generated by XDIM_MEMBERSET will be destroyed and will have to be rebuilt(scoping again) by executing XDIM_MEMBERSET again. Example: *WHEN ZS_ACCOUNT *IS "DISCOUNT" *REC(FACTOR=0.1, ZS_ACCOUNT=SPL_DISCOUNT) *ENDWHEN *COMMIT Business Scenario: Calculate and book the special discount which is 10% of Discount for the plan data for the entity USA, for the year OCT, 2009 18.1 Create a new logic file LOGIC_COMMIT.LGF under In ZEENAT(in your own environment) Environment Rules -> Logic Scripts -> Scripts for: ZS_PLANNING Save and Validate LOGIC_COMMIT.LGF Remove all the INCLUDEs from Default.LGF Include LOGIC_COMMIT.LGF in Default.LGF Save and Validate Default.LGF
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
70
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
71
Now click on Save and refresh worksheet data. Data is updated in the database. The following screen shows the calculated special discount.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
72
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
73
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
74
To debug the script, specify the settings, at the top, as shown below
Copy the script to be debugged from the BPC admin client(from Rules-- > Logic Scripts) and paste it into the text area at the bottom left side as shown below:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
75
An error has been introduced in the script intentionally. The script contains WHEN1 instead of WHEN. After pasting the script in the text area, click VALIDATE button. This will throw an error message in the text area at the bottom right side of the screen. The following screen shows that.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
76
Scripts can be debugged this way. Note that, there are two more buttons EXECUTE and EXCUTE (simulate). EXECUTE will actually execute the script and update the database accordingly. But, EXCUTE (simulate) will compile and execute the script WITHOUT updating the database. Instead, it will show the records to be selected/inserted in the text area bottom right side. Benefits of Script Logic: Script Logic allows for Real-time calculations. Script Logic can re-run from Data Manager. Different formulas to different applications within the Environment can be applied through Script Logic. It is powerful and effective tool to perform calculations, delivering the desired results efficiently and accurately.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
77
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
78
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
79
Option - 2:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
80
Option - 3:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
81
Option - 4:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
82
Option 5:
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
83
Disclaimer:
This description is a preliminary version and not subject to a license agreement or any other agreement with SAP. This document contains 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. Please note that this preview is subject to change and may be changed by SAP at any time without notice. SAP/We assume no responsibility for errors or omissions in this document. SAP/We does not warrant the accuracy or completeness of the information, text, graphics, links, or other items contained within this material. This preview is provided without a warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP/We 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 limitation shall not apply in cases of intent or gross negligence. The statutory liability for personal injury and defective products is not affected.
Author: 1 Zeenat Siddique SAP BPC Developer SAP EPM/BPC Solutions Lead
Chief Architect: Jothi Periasamy SAP HANA/EPM/BI/EIM Community Leader SAP BPC/BOBJ/BI/MDM Community Domain Champion Joesaran@gmail.com, (916)-296-0228 - Cell
84