Skip to Content
0
Jan 29, 2020 at 07:29 AM

Script Logic: To post data to dimension member property of property

75 Views Last edit Jan 29, 2020 at 07:31 AM 2 rev

Hello Experts,

Product Version:-

CPMBPC 810 0015 SAPK-81015INCPMBPC (BPC10.1 SP 15)

SAP_BW 740 0020 SAPKW74020

Netweaver: 740

In Head-Count Model we have the dimensions HC_Account (A), CATEGORY (C), COST CENTER(User-def), FUNCTIONAL AREA (User-def), TIME(T), ENTITY (E), HC_Employee (user defined)

In the HC_Account (A) dimension there are members: HCOUNT, BONUS, BONUS_PCT, BONUS_PAY

In COSTCENTER dimension we have a property called BONUS_CC (Bonus Cost Center) and Functional Area.

We want to calculate BONUS via Data Manager Package. User provides the COSTCENTER, CATEGORY,TIME and BONUS is posted to BONUS_CC.

Script:

*SELECT(%YR%,"YEAR","CATEGORY",[ID=%CATEGORY_SET%])

//Use the year variable above to create current year time periods. 

*SELECT(%TIM%,"ID","TIME",[YEAR=%YR%])

//Variable for Bonus Costcenters

*SELECT(%BC%,[BONUS_CC],"COSTCENTER","[ID]=%COSTCENTER_SET%")

//Scoping of Cost centers with bonus cost centers populated. Scoping of Entity, Functional Area and 
Profit Center based on these Cost Centers. 

*SELECT(%CSTCTR%,"ID","COSTCENTER","[ID]=%COSTCENTER_SET% AND [BONUS_CC]<>""")
*SELECT(%ENT%,[ENTIY], "COSTCENTER","[ID]=%CSTCTR%")
*SELECT(%FA%,[FUNC_AREA],"COSTCENTER","[ID]=%CSTCTR%")
*SELECT(%PCTR%,[PROFIT_CENTER],"COSTCENTER","[ID]=%CSTCTR%")

*XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%
*XDIM_ADDMEMBERSET CATEGORY= ACTUAL
*XDIM_MEMBERSET TIME =%TIMESET%,
*XDIM_MEMBERSETCOSTCENTER=%CSTCTR%
*XDIM_MEMBERSET HC_EMPLOYEE= BAS(EMPLOYEE)
*XDIM_MEMBERSET RPTCURRENCY=LC
*XDIM_MEMBERSET ENTITY=%ENT%
*XDIM_MEMBERSET FUNCTIONALAREA=%FA%
*XDIM_MEMBERSET PROFITCENTER=%PCTR%
*XDIM_ADDMEMBERSET HC_ACCOUNT = HCOUNT

//Bonus calculation //*FOR %CCTR%=%COSTCTR%
*WHEN HC_ACCOUNT
*IS HCOUNT
*WHEN AUDITTRAIL
*IS INPUT
*WHEN CATEGORY
*IS %CATEGORY_SET%
*WHEN COSTCENTER
*IS %CSTCTR%
*WHEN RPTCURRENCY
*IS LC
*WHEN FUNCTIONALAREA
*IS %FA%
// //BONUS CALC 
*REC(EXPRESSION=(%VALUE%>0)*(([HC_ACCOUNT].[6100000],[AUDITTRAIL].[CALC],[CATEGORY].[%CATEGORY_SET%])*([HC_ACCOUNT].[BONUS_PCT],[AUDITTRAIL].[INPUT],[TIME].[%YR%.INP],[CATEGORY].[%CATEGORY_SET%])*([HC_ACCOUNT].[BONUS_PAY],[JOB_CODE].[NO_JOB_CODE],[FUNCTIONALAREA].[NO_FA],[COSTCENTER].[NO_COSTCENTER],[PROFITCENTER].[NO_PROFITCENTER],[ENTITY].[NO_ENTITY],[HC_EMPLOYEE].[NO_EMP],[HC_EMP_TYPE].[NO_TYPE],[CATEGORY].[%CATEGORY_SET%])),HC_ACCOUNT=BONUS,AUDITTRAIL=CALC,COSTCENTER=COSTCENTER.BONUS_CC,FUNCTIONALAREA=COSTCENTER.FUNC_AREA)

*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT

Dimension member Mapping Example: Cost Center (200) has BONUS_CC (500) and Functional Area (2)

Cost Center dimension (500) {which is also a BONUS_CC property of COSTCENTER dimension} has Functional Area (5)

Data Manager Prompts: Costcenter is 200 (which has a mapping to Functional Area 2 and BONUS_CC 500)

Results: Bonus is posted to BONUS_CC(500) and Functional Area (2)

Expected Result: To post BONUS to BONUS_CC (500) and Functional Area mapped to BONUS_CC which 5.

Regards,

Richa Pathak