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

Convert currency to string

Former Member
0 Likes
822

Hi everybody,

Do you know any fuction module which convert a curency type, for example WERTV8 into a string type?

I have this code:

data: l_moneda_in TYPE WERTV8, l_moneda_out TYPE WERTV8.

data: l_in(18) TYPE c, l_out(18) type c.

l_in = '1000.50'.

l_moneda_in = l_in.

CALL FUNCTION 'WLF_CURRENCY_DECIMAL_JUSTIFY'

EXPORTING

i_curr_new = 'INR'

i_curr_old = 'INR'

i_amount_old = l_moneda_in

IMPORTING

E_AMOUNT_NEW = l_moneda_out

.

write: l_moneda_out.

l_out = l_moneda_out.

write: l_out.

I need the correct value '1.000,50' in the l_out variable but although l_moneda_out write the correct value when I try to write l_out is incorrect.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
698

Hi Lorena,

Could you please try like


write  l_moneda_out to l_out currency 'INR'.

Regards

Caglar

3 REPLIES 3
Read only

Former Member
0 Likes
699

Hi Lorena,

Could you please try like


write  l_moneda_out to l_out currency 'INR'.

Regards

Caglar

Read only

Former Member
0 Likes
698

Hi,

Please try the following code:

data: l_moneda_in TYPE WERTV8, l_moneda_out TYPE WERTV8.

data: l_in(18) TYPE c, l_out(18) type c.

l_in = '1000.50'.

l_moneda_in = l_in.

CALL FUNCTION 'WLF_CURRENCY_DECIMAL_JUSTIFY'

EXPORTING

i_curr_new = 'INR'

i_curr_old = 'INR'

i_amount_old = l_moneda_in

IMPORTING

E_AMOUNT_NEW = l_moneda_out

.

write: l_moneda_out.

<b>move l_moneda_out to l_out.</b>

write: l_out <b>currency 'INR'</b>.

Best regards,

Prashant

Read only

Former Member
0 Likes
698
change ur code like this

REPORT YCHATEST.

DATA: L_MONEDA_IN TYPE WERTV8, L_MONEDA_OUT TYPE WERTV8.
DATA: L_IN(18) TYPE C, L_OUT(18).

L_IN = '1000.50'.
L_MONEDA_IN = L_IN.

CALL FUNCTION 'WLF_CURRENCY_DECIMAL_JUSTIFY'
  EXPORTING
    I_CURR_NEW   = 'INR'
    I_CURR_OLD   = 'INR'
    I_AMOUNT_OLD = L_MONEDA_IN
  IMPORTING
    E_AMOUNT_NEW = L_MONEDA_OUT.

WRITE: L_MONEDA_OUT TO L_OUT.
WRITE: L_OUT.