Skip to Content

Currency conv for multiple fiscal years only translates differences within the same fiscal year

We have the following currency translation script in our default logic:

*FOR %TIME% = %TIME_SET%

*RUN_PROGRAM CURR_CONVERSION

CATEGORY = %VERSION_SET%

CURRENCY=EUR, RUB

TID_RA = %TIME%

RATEENTITY = Global

OTHER = [ENTITY=%ENTITY_SET%]

*COMMIT

*NEXT

The logic works for our MTP version (inputs for DEC of multiple years). Input sheet contains e.g. 2017.DEC, 2018.DEC, 2019.DEC, 2020.DEC and 2021.DEC.

But not for a budget version in which we send data for multiple months in the same year: it works for January, but for the other months only the difference between this month and the previous month is converted: see screenshot.

currency-conversion.png

How can I create a script that correctly translates the currencies in both cases:

for multiple years for MTP version, for multiple months for all other version.

thank you!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 25 at 02:22 PM

    You can use this code to distinguish between multiple years and single year:

    *SELECT(%YS%,[YEAR],TIME,ID=%TIME_SET%) //Get list of years
    *SELECT(%M%,[ID],TIME,YEAR=%YS% AND PERIOD=JAN) //Get list of JAN of years
    *SELECT(%TIDS%,[TIMEID],TIME,ID=%M%) //Get list of TIMEID's
    *SELECT(%GEIDS%,[ID],TIME,TIMEID>=%TIDS%) //GE ID's
    *SELECT(%LEIDS%,[ID],TIME,TIMEID<=%TIDS%) //LE ID's
    *SELECT(%GETIDS%,[TIMEID],TIME,ID=%GEIDS%) //GE TIMEID's
    *SELECT(%LETIDS%,[TIMEID],TIME,ID=%LEIDS%) //LE TIMEID's
    *SELECT(%T1%,[ID],TIME,ID=%M% AND TIMEID=%LETIDS%) // First Time ID
    *SELECT(%T2%,[ID],TIME,ID=%M% AND TIMEID=%GETIDS%) //Last Time ID
    *SELECT(%TID2%,[TIMEID],TIME,ID=%T2%) //TIMEID of the last Time ID
    *SELECT(%MULTIYEAR%,[ID],TIME,ID=%T1% AND TIMEID<%TID2%) //Value if multiple years or nothing
    *SELECT(%SINGLEYEAR%,[ID],TIME,ID=%T1% AND TIMEID=%TID2%) //Value if single year or nothing
    
    *FOR %TEST1%=%MULTIYEAR% //If multiple years
    *FOR %TIME% = %TIME_SET%
    *RUN_PROGRAM CURR_CONVERSION
    CATEGORY = %VERSION_SET%
    CURRENCY=EUR, RUB
    TID_RA = %TIME%
    RATEENTITY = Global
    OTHER = [ENTITY=%ENTITY_SET%]
    *ENDRUN_PROGRAM
    *NEXT
    *NEXT
    
    *FOR %TEST2%=%SINGLEYEAR% //If single year
    *RUN_PROGRAM CURR_CONVERSION
    CATEGORY = %VERSION_SET%
    CURRENCY=EUR, RUB
    TID_RA = %TIME_SET%
    RATEENTITY = Global
    OTHER = [ENTITY=%ENTITY_SET%]
    *ENDRUN_PROGRAM
    *NEXT

    A bit complex, but you can test it in UJKT :)

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 24 at 02:06 PM

    You don't need for/next in general!

    Please show the rule setup...

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 24 at 02:26 PM

    Dear Vadim

    In the business rules, there are only two relevant rules: AVG and KEYFIGURE.

    Here is the set-up for the AVG one.

    If I delete the *FOR %TIME% = %TIME_SET% statement in the logic script, all versions, except MTP are working fine. I found this solution in this question: https://archive.sap.com/discussions/thread/1709018 also in note

    For MTP the amounts are not converted.

    kind regards

    Add comment
    10|10000 characters needed characters exceeded