Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need code to get exchange rate for a given range.

aris_hidalgo
Contributor
0 Likes
466

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!

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!

1 REPLY 1
Read only

Former Member
0 Likes
419

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