Skip to Content
avatar image
Former Member

Lookup script issue

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 02, 2017 at 04:08 PM

    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
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 02, 2017 at 12:17 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 02, 2017 at 12:42 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded