Skip to Content

Issue with currency conversion CONVERT_CURRENCY in HANA SQL

Hi All,

I am executing the below query and able to get the result successfully:

SELECT
	 CONVERT_CURRENCY( "AMOUNT" => 1,
	 "SOURCE_UNIT" => 'JPY',
	 "TARGET_UNIT" => 'EUR',
	 "REFERENCE_DATE" => '20200212',
	 "ERROR_HANDLING" => 'set to null',
	 "CLIENT" => '400',
	 "SCHEMA" => 'SAPEPR',
	 "STEPS" => 'convert'  ) as abc 
FROM dummy;			  						

However when i am explicitly trying to provide configuration tables then i am getting an error:

SELECT
	 CONVERT_CURRENCY( "AMOUNT" => 1,
	 "SOURCE_UNIT" => 'JPY',
	 "TARGET_UNIT" => 'EUR',
	 "REFERENCE_DATE" => '20200212',
	 "ERROR_HANDLING" => 'set to null',
	 "CLIENT" => '400',
	 "SCHEMA" => 'SAPEPR',
	 "STEPS" => 'convert' ,
	 "CONFIGURATION_TABLE" => 'TCURV',
	 "PRECISIONS_TABLE" => 'TCURX',
	 "NOTATION_TABLE" => 'TCURN',
	 "RATES_TABLE" => 'TCURR',
	 "PREFACTORS_TABLE" => 'TCURF' ) as abc 
FROM dummy ;

I am getting the below error :

Could not execute 'SELECT CONVERT_CURRENCY( "AMOUNT" => 1, "SOURCE_UNIT" => 'JPY', "TARGET_UNIT" => 'EUR', ...' SAP DBTech JDBC: [328]: invalid name of function or procedure: CONVERT_CURRENCY: line 2 col 3 (at pos 10)

I am not able to understand where is the mistake even though the values i am providing are the default values of the paramters of CONVERT_CURRENCY.

Any pointers are will be helpful.

Regards,

Tanmay

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Best Answer
    Posted on Feb 14 at 07:20 AM

    The problem is related to parameter "NOTATION_TABLE". It is documented that it is called "NOTATION_TABLE", but in reality it is called "NOTATIONS_TABLE". Please adjust the name and then the function will be recognized.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 13 at 10:10 PM

    I would check the existence and locations of the five tables at the end of your script. Check the schema to verify they exist and where. You may not be properly configured for the use of those tables for currency conversion.

    See if you should use the fully defined location instead of the default. One could probably test each one separately to make sure whether it is one or perhaps as many as all of them which are not in the standard location.

    Cheers, Mike

    Add comment
    10|10000 characters needed characters exceeded