cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Lookup script issue

0 Likes
355

Hi Experts,

we write one script logic in a Ytd model to take GBP values and multiply by the JPY exchange rate to show the results in JPY.

Please see attached script for reference and we are calling this package through DM.

i have checked the results and it showing correct numbers for period 1, but for period 2 it is giving wrong numbers for one hierarchy, the other hierarchy numbers looks ok.

Exchange rate for GBP: 0.7763, For JPY: 122.836., period may 2016 .

Please help.

script.txt

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

Your code can be reduced:

*XDIM_MEMBERSET ACCOUNT = <ALL>
*XDIM_MEMBERSET AUDITTRAIL = <ALL>
*XDIM_MEMBERSET CONSPARTNER = <ALL>
*XDIM_MEMBERSET FLOW = PL99
*XDIM_MEMBERSET MEASURES = YTD
//*XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
//*XDIM_MEMBERSET CONSGROUP = %CONSGROUP_SET%
//*XDIM_MEMBERSET CONSUNIT = %CONSUNIT_SET%
*XDIM_MEMBERSET RPTCURRENCY =GBP
//*XDIM_MEMBERSET TIME = %TIME_SET%

*LOOKUP Rates
*DIM MEASURES = PERIODIC //common
*DIM R_ACCOUNT = AVG //common
*DIM R_ENTITY = GLOBAL //common - may be Global - case sensitive!!!!
//*DIM JPYCURR: CATEGORY = %CATEGORY_SET% - will be from current record
*DIM JPYCURR: INPUTCURRENCY = JPY
//*DIM JPYCURR: R_ACCOUNT = AVG
//*DIM JPYCURR: R_ENTITY = GLOBAL
//*DIM JPYCURR: TIME = %TIME_SET% - will be from current record
//*DIM JPYCURR: MEASURES = PERIODIC

//*DIM GBPCURR: CATEGORY = %CATEGORY_SET% - will be from current record
*DIM GBPCURR: INPUTCURRENCY = GBP
//*DIM GBPCURR: R_ACCOUNT = AVG
//*DIM GBPCURR: R_ENTITY = GLOBAL
//*DIM GBPCURR: TIME = %TIME_SET% - will be from current record
//*DIM GBPCURR: MEASURES = PERIODIC
*ENDLOOKUP

*WHEN FLOW
*IS * //already scoped
*REC(EXPRESSION=%VALUE%*LOOKUP(JPYCURR)/LOOKUP(GBPCURR),RPTCURRENCY=JPY)
*ENDWHEN

Answers (2)

Answers (2)

0 Likes

Hi Vadim,

Thanks for the reply.

we have a GBP values in cons model and the storage type is YTD, i just want to convert these values into JPY using below calculation.

GBP value * JPYcurr/GBPcurr

RATES: GBP: 0.7763, For JPY: 122.836

2500*122.836/0.7763 expected result: 395581.61

Version :sapbw 730 0007

cpmbpc 800 0007

Thanks for your help.

former_member186338
Active Contributor
0 Likes

Your code is not clear, please read https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

You have to explain the calculation logic!

former_member186338
Active Contributor
0 Likes

P.S. "i have checked the results and it showing correct numbers for period 1, but for period 2 it is giving wrong numbers for one hierarchy, the other hierarchy numbers looks ok."

What do you mean by "period 1 and period 2"???

What do you mean by "one hierarchy, other hierarchy"???

What do you mean by this code:

*REC(EXPRESSION=0,RPTCURRENCY=JPY)
//*REC(EXPRESSION=%VALUE%,RPTCURRENCY=JPY)// 
*REC(EXPRESSION=([TIME].[TMVL(-1,%TIME_SET%)],[RPTCURRENCY].[JPY]),RPTCURRENCY=JPY)
*REC(EXPRESSION=([TIME].[%TIME_SET%]*LOOKUP(JPYCURR)/LOOKUP(GBPCURR)),RPTCURRENCY=JPY)
*REC(EXPRESSION=-([TIME].[TMVL(-1,%TIME_SET%)]*LOOKUP(JPYCURR)/LOOKUP(GBPCURR)),RPTCURRENCY=JPY)// Even with previous month defined, still error

???

0 Likes

Hi Vadim,

period 1 and period 2 are the time periods 2016.p01 & 2016.p02

I have modified my code and it looks okay now.

script1.txt

Thanks for the help.