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 to know Decimals Currency

Former Member
0 Likes
934

I want to some function to know decimals currency, or format an input with a specific currency format.

e.g.

input 1234,5678 and USD

output 1234,56 or 1234,57

Thanks and Regards,

Sebastian

I want to some function to know decimals currency, or format an input with a specific currency format.

e.g.

input 1234,5678 and USD

output 1234,56 or 1234,57

Thanks and Regards,

Sebastian

6 REPLIES 6
Read only

Former Member
0 Likes
844

Try this...

DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.

l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).

Now l_descr_ref->components holds the entire list of fields in itab.

Thanks & Regards,

Shreemohan

Read only

0 Likes
844

Doesn't work.

I want to convert 123.123 and USD in 123.12

or 123.123 and JAP in 123 (yens hasn't decimals)

....

Read only

Former Member
0 Likes
844

Hi,

Following are FM with respect to Currency,

CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

CONVERT_AMOUNT_TO_CURRENCY Convert an amount from a currency to another (exchange rate taken from database tables)

CONVERT_CURRENCY_BY_RATE Convert an amount from a currency to another, according to the passed exchange rate

BAPI_CURRENCY_CONV_TO_EXTERNAL Conversion of Currency Amounts into External Data Format

BAPI_CURRENCY_CONV_TO_INTERNAL Conversion of Currency Amounts into Internal Data Format

Thanks & regards,

Shreemohan

Read only

0 Likes
844

Finally I consulted TCURX, that table contains information about decimals places for every currency. I need truncate a numeric value with decimals specified in that table.

Thanks

Read only

0 Likes
844

you can use Write with currency option to let SAp do that automatically.


write  xx currency 'USD' to yy.

or write  xx currency 'JPY' to yy.

Read only

0 Likes
844

Yes, thanks! but I need those values inside a Web Dynpro for Java.