cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with currency conversion CONVERT_CURRENCY in HANA SQL

TanmayVerma
Active Participant

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

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

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.

TanmayVerma
Active Participant

Thanks florian.pfeffer

Posted on.

This calls for an update to SAP Documentation 🙂

~Tanmay.

Answers (2)

Answers (2)

former_member673606
Discoverer
0 Kudos

Hi All,

I am wondering if it's not possible to create currency conversion using HANA Calculation views of dimension or cube-type (w/o star join). When I am trying to convert the currency, it's returning the exact same amount. But when done in Star join, it's working, I don't understand, Kindly help

Regards,

Deba

agentry_src
Active Contributor
0 Kudos

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