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

Function Module FI_CURRENCIES_CONVERT

Former Member
0 Likes
819

We are using function module FI_CURRENCIES_CONVERT in our report. When the conversion rate for a Currency is not maintained it throws an error and program aborts. Is there any way to bring the user back to the selection screen of the report.

6 REPLIES 6
Read only

Former Member
0 Likes
727

Why don't you try some other function module e.g. convert_to_local_currency, convert_to_document_currency etc for the conversion?

Read only

Former Member
0 Likes
727

Hi Kaushal,

Even the FM 'FI_CURRENCIES_CONVERT' uses the FM 'CONVERT_TO_LOCAL_CURRENCY' as it's underlying calcualtion. I see that FM 'FI_CURRENCIES_CONVERT' does raise any exceptions.

My suggestion to you would be to create a new FM with 'Z_FI_CURRENCIES_CONVERT' by adding your own exceptions.

OR

call the FM 'FI_CURRENCIES_CONVERT' with <b>TRY....END TRY</b> block.

Hope this helps you.

Regards,

vicky

PS: Award points if helpful.

Read only

Former Member
0 Likes
727

Can you provide a little more help for TRY....END TRY block.

Read only

0 Likes
727

Kaushal,

Hope u r catching exception after calling function module.

Cheers,

Nilesh

Read only

0 Likes
727

I had the same problem once before. I checked to make sure the exchange rate was defined before calling the function module to convert.

If the TO and FROM currencies are different, check table TCURR. Do a SELECT against table TCURR with the TO/FROM currencies, date, and rate type (usually 'M'). If a record exists, call the function module to convert. If not, give a nice error message and return to the selection screen.

Read only

0 Likes
727

Hi Kausal,

You have more information with example on TRY - ENDTRY in this link.

http://help.sap.com/saphelp_nw04/helpdata/en/a9/b8eef8fe9411d4b2ee0050dadfb92b/content.htm

Even Norman Salter proposed a nice idea to deal in your situation. You can follow any one to finish the task.

Let me know if you need any help.

Regards,

Vicky

PS: Award points if helpful