‎2006 Aug 03 7:30 AM
Hello experts,
Is there an function module that I can use for:
1. get the last date for a given year
2. get the exchange rate for a given document number in a span of 5 years -
for example, I need to get the exchange rate of doc. number 0000000123
for the year 2000, 2001, 2002, 2003, 2004 and 2005(maximum of 5 years)
Help would be greatly appreciated.
Again, thank you guys and take care!
‎2006 Aug 03 7:36 AM
Hi,
Check the following, this might help,
1.To get last date in a year - LAST_DAY_IN_YEAR_GET & FIRST_AND_LAST_DAY_IN_YEAR_GET
2. To get the exchange rate - CALCULATE_EXCHANGE_RATE_N, to get the history of exchange rates for 5 years, you need to write a custom fm or a report, as the exchange rate would be fluctuating,
Rgds,
‎2006 Aug 03 7:32 AM
get the last date for a given year---> its always 31-12-'Year' u can hard code.
check <b>BAPI_EXCHANGERATE_GETDETAIL</b>
Regards
prabhu
Message was edited by: Prabhu Peram
‎2006 Aug 03 7:33 AM
LAST DATE 31-12-
IF U WANT LAST DATE FOR FINACIAL YEAR..USE FM.
HR_E_GET_FISC_YEAR_DATES
or
FIRST_AND_LAST_DAY_IN_YEAR_GET
‎2006 Aug 03 7:36 AM
Hi,
Check the following, this might help,
1.To get last date in a year - LAST_DAY_IN_YEAR_GET & FIRST_AND_LAST_DAY_IN_YEAR_GET
2. To get the exchange rate - CALCULATE_EXCHANGE_RATE_N, to get the history of exchange rates for 5 years, you need to write a custom fm or a report, as the exchange rate would be fluctuating,
Rgds,
‎2006 Aug 03 7:53 AM
Hi again guys,
do you have any examples on how to use BAPI_EXCHANGERATE_GETDETAIL and
CALCULATE_EXCHANGE_RATE_N?
Thanks a lot!
‎2006 Aug 03 8:00 AM
Hi,
To use CALCULATE_EXCHANGE_RATE_N, you just have to pass the required parameters like foreign amount/currency and local amount/currency, instead you can query the table TCURR for the same data, remember to convert the 'DATE' to internal format before sending it in to the fm/table, you can refer the following code, this might help,
WRITE V_date TO LV_DATUM USING EDIT MASK '__.__.____'.
CALL FUNCTION 'CONVERSION_EXIT_INVDT_INPUT'
EXPORTING
INPUT = LV_DATUM
IMPORTING
OUTPUT = LV_DATUM.
Retrieve the Exchange rate from Custom table for the Exchange
*
select ukurs from tcurr
into tcurr-ukurs
up to 1 rows
where kurst = 'M'
and fcurr = komk-waerk
and tcurr = komk-HWAER
and gdatu >= LV_DATUM.
endselect.
Rgds,