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

Converting USD amount into word

Former Member
0 Likes
1,584

Hi,

I want to convert amount which is in USD into word i am using below FM

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = dmbtr

currency = waers

  • FILLER = ' '

language = langu

IMPORTING

in_words = spell

EXCEPTIONS

not_found = 1

too_large = 2

OTHERS = 3.

IF sy-subrc = 0.

**************

now my DMBTR amount is 21960.00 which is atually 219.60 USD but in dmbtr initially amount is coming as 21960.00 and when i convert it to word it is coming as USD : TWO HUNDRED NINETEEN, AND CENTS AS SIX THOUSAND, but acutally it should be USD DOLLAR TWO HUNDRED NINETEEN AND CENTS SIXTY ONLY, it is not coming peoprly so is there any other functionn module for this to convert USD , JPY into word.

regards,

zafar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,089

Hi Zafar,

Check the Number of decimal places for USD currency in table TCURX.

It should be 2. I think now it is set as4. So it is giving the wrong out put.

Use transaction OY04 to set the Number of decimal places for Currency.

Regards

DKS

Hi,

I want to convert amount which is in USD into word i am using below FM

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

amount = dmbtr

currency = waers

  • FILLER = ' '

language = langu

IMPORTING

in_words = spell

EXCEPTIONS

not_found = 1

too_large = 2

OTHERS = 3.

IF sy-subrc = 0.

**************

now my DMBTR amount is 21960.00 which is atually 219.60 USD but in dmbtr initially amount is coming as 21960.00 and when i convert it to word it is coming as USD : TWO HUNDRED NINETEEN, AND CENTS AS SIX THOUSAND, but acutally it should be USD DOLLAR TWO HUNDRED NINETEEN AND CENTS SIXTY ONLY, it is not coming peoprly so is there any other functionn module for this to convert USD , JPY into word.

regards,

zafar

4 REPLIES 4
Read only

Former Member
0 Likes
1,089

Hi,

check these FM

CONVERT_TO_LOCAL_CURRENCY - Conversion of currency

CONVERT_TO_FOREIGN_CURRENCY Convert local currency to foreign currency.

CONVERT_TO_LOCAL_CURRENCY Convert from foreign currency to local currency

Ashutosh

Read only

Former Member
0 Likes
1,089

Hi,

Assign dmbtr to type PAYR_FI-RWBTR.

PARAMETERS: dmbtr type PAYR_FI-RWBTR.

OR

If you didnt get from this try by using type P

PARAMETERS: dmbtr type P.

Regards,

kalandar

Edited by: kalandar on Jun 16, 2010 9:48 AM

Read only

Former Member
0 Likes
1,090

Hi Zafar,

Check the Number of decimal places for USD currency in table TCURX.

It should be 2. I think now it is set as4. So it is giving the wrong out put.

Use transaction OY04 to set the Number of decimal places for Currency.

Regards

DKS

Read only

0 Likes
1,089

Ok