Application Development 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: 

SPELL_AMOUNT to convert amount in ( USD )words

Former Member
0 Kudos

hi guys,

i m using the following function module to convert amount to words for USD. but the result is coming in lakhs and crores .. i want the amount in thousands and millions .

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = val

CURRENCY = 'USD'

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = IN_WORDS.

SPELL_VAL = IN_WORDS-WORD.

for example,

val = 231,620.00

words = TWO HUNDRED THIRTY-ONE THOUSAND SIX HUNDRED TWENTY DOLLARS

above is the output i get in development server for the f.m. and is exactly what i want.

but for the same example, in production server , the output is

words = TWO LAKH THIRTY-ONE THOUSAND SIX HUNDRED TWENTY DOLLARS

and suggestions ????

1 ACCEPTED SOLUTION

NAeda
Contributor
0 Kudos

Hello,

Check The default currency , and sy-langu of production server..!

thanks

Regards

Narsim Aeda

Edited by: Aeda N on Oct 16, 2008 8:35 AM

17 REPLIES 17

NAeda
Contributor
0 Kudos

Hello,

Check The default currency , and sy-langu of production server..!

thanks

Regards

Narsim Aeda

Edited by: Aeda N on Oct 16, 2008 8:35 AM

Former Member
0 Kudos

thanks for replying...can u please tell me how do i check this???

0 Kudos

Hi,

Check it with TCode SCC4 in Production Server as well as in Development Server, is there any differece..?

Thanks

Regards

Narsim Aeda

Former Member
0 Kudos

the currency is INR is both servers..so why do u think there is a difference in the results

Former Member
0 Kudos

Hi Poonam,

Try this code

DATA : WORDS       TYPE SPELL,
       WORDS_SPELL TYPE CHAR1024.

DATA : NO TYPE I VALUE '231620.00'.

CALL FUNCTION 'SPELL_AMOUNT'
 EXPORTING
   AMOUNT          = NO
*   CURRENCY        = ' '
*   FILLER          = ' '
*   LANGUAGE        = SY-LANGU
 IMPORTING
   IN_WORDS        = WORDS
* EXCEPTIONS
*   NOT_FOUND       = 1
*   TOO_LARGE       = 2
*   OTHERS          = 3
          .

WRITE : WORDS-WORD.

WORDS-WORD will contain TWO HUNDRED THIRTY-ONE THOUSAND SIX HUNDRED TWENTY.

Let me know what output you are getting in your system.

Regards

Edited by: Rajvansh Ravi on Oct 16, 2008 8:48 AM

Former Member
0 Kudos

Hi,

Can you check the entries in T015Z table are same in Dev and Prod server...

Revrt back..

Regards,

Naveen

Former Member
0 Kudos

Thnx Rajvansh ,

same problem for this code as well...

Former Member
0 Kudos

hi naveen...

no difference is the table..

Former Member
0 Kudos

Hi Poonam,

If you have not already checked the program RF_SPELL try checking it in Development and production system to see how it behaves.

Regards.

Former Member
0 Kudos

thnx for replying ..

i have checked the program RF_SPELL..

Selection-screen :

Language EN

Currency (with 'space' digits) usd

Amount 123,456,789.12

In production for this program o/p is as follows..

TWELVE CRORE THIRTY-FOUR LAKH FIFTY-SIX THOUSAND SEVEN HUNDRED E

IGHTY-NINE

TWELVE

In development for this program o/p is as follows..

ONE HUNDRED TWENTY-THREE MILLION FOUR HUNDRED FIFTY-SIX THOUSAND

SEVEN HUNDRED EIGHTY-NINE

TWELVE

Former Member
0 Kudos

Hi Poonam,

Check this note Note 939145. It says "The words for the input numbers are read from the customizing table T015Z. It can be maintained using the customizing view V_T015Z."

I have checked 2 scenarios. USD works fine for me as the table T015Z contains proper entries.

But i am not able to display the amount in INR which i assume is because of my table T015Z which does not have entries for LAKH or CRORE .

Does your table contain entries for LAKH or CRORE in production. Check the field WORT in T015Z for language E.

Regards

Former Member
0 Kudos

i have compared the entries in table T015Z in both the servers and the are the same....

Former Member
0 Kudos

Thank you sir...

Former Member
0 Kudos

Hi ,

Try this function module . Then there will be no such problems.


CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
      AMT_IN_NUM         = W_EXBED
    IMPORTING
      AMT_IN_WORDS       = W_EXBED_WORD
    EXCEPTIONS
      DATA_TYPE_MISMATCH = 1
      OTHERS             = 2..

Regards.

Eshwar.

Former Member
0 Kudos

its problem with ','(comma) check it once..

Former Member
0 Kudos

Hi Please try this code....

DATA : WORDS TYPE SPELL,

WORDS_SPELL TYPE CHAR1024.

parameters p_val type p decimals 2.

*DATA : NO TYPE I VALUE '231620.00'.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = p_val

  • CURRENCY = 'USD'

  • FILLER = ' '

LANGUAGE = sy-langu

IMPORTING

IN_WORDS = WORDS

  • EXCEPTIONS

  • NOT_FOUND = 1

  • TOO_LARGE = 2

  • OTHERS = 3

.

WRITE : WORDS-WORD.

I this its working fine in Millions and thousands...

I hope it will be helpfull.

Thnaks

Former Member
0 Kudos

did not get a solution yet..