Skip to Content
0

Lookup script issue

Mar 02, 2017 at 10:24 AM

32

avatar image

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

capture.png (10.0 kB)
script.txt (1.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Vadim Kalinin Mar 02, 2017 at 04:08 PM
0

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
Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Mar 02, 2017 at 12:17 PM
0

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!

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

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.

script1.txt (966 B)
0
srikanth g Mar 02, 2017 at 12:42 PM
0

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.


capture.png (12.8 kB)
Share
10 |10000 characters needed characters left characters exceeded