Skip to Content

Need code to get exchange rate for a given range.

Hello experts,

I am currently doing a report and I need to do the following:

1. I have 2 parameters namely p_year(from year) and p_asof(as of date). Now,

suppose I entered 2005 in the p_asof and 2000 in p_year. I need to get the

exchange rate for each and every year. So that means year 2000, 2001, 2002,

2003 and 2004.

2. any sample codes on how to use FM CALCULATE_EXCHANGE_RATE_N and

for the BAPI -> BAPI_EXCHANGERATE_GETDETAIL. Help and suggestions would be

highly appreciated.

Again, thank you guys and have a nice day!

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 03, 2006 at 09:51 AM

    Basically, you would need use the below logic.

    l_year = p_year.

    DO while l_year <= p_asof.

    concatenate '01' '01' l_year into l_date separated by '.'.

    call function module.

    write : / results.

    l_year = l_year + 1.

    enddo.

    you can use the bapi - bapi_exchangerate_getdetail

    using rate_type = 'M' (moving average)

    from_curr = from currency code

    to_currency = to currency code

    date = l_date.

    Regards

    Anurag

    Add comment
    10|10000 characters needed characters exceeded