cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to use SQL function CONVERT_CURRENCY in Cloud Application Programming Model

QuyVu
Participant
0 Likes
1,193

Hi all,

I'm trying to use Convert_currency function in my CAP application but I can't find a way to do it.
Please let me know how to use this function and others.

Regards

LeoVu

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Likes

Hello All,

I have similar requirement to do currency conversion from currency A to currency B using Exchange rate type. I am working on CAP project and not finding any API in API hub for this. Could you please confirm how to handle this.

quy_vungoc87 - Did you manage to resolve currency conversion in CAP application? Let me know how you have handled it?

Kind regards,

Deepti

pfefferf
Active Contributor
0 Likes

To my knowledge so far no API way exists to use these DB specific function in CAP.

But you can go the way to use it via a HANA Native HANA Artifact, meaning encapsulate your logic to use the currency conversion function in e.g. a table function and make it usable within CAP. Details are described in the CAP documentation (see link before).

QuyVu
Participant
0 Likes

Thank you for your suggestions.

0 Likes

You should try this code to convert SQL function into currency

Create a table and populate it with two example currency amounts.
CREATE ROW TABLE sample_input (price DECIMAL(15,2),
                             source_unit NVARCHAR(4),
                             target_unit NVARCHAR(4),
                             ref_date NVARCHAR(10)
                             );

 INSERT INTO sample_input VALUES (1.0, 'SRC', 'TRG', '2011-01-01');
 INSERT INTO sample_input VALUES (1.0, 'SRC', 'TRG', '2011-02-01');

QuyVu
Participant
0 Likes

Thank you for your suggestions.