cancel
Showing results for 
Search instead for 
Did you mean: 

Amount not converted in words properly

Former Member
0 Kudos

hi friends we are creating the import PO but the amount of the PO is not converted into the words properly.where could be the problem

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Use this FM for converting the amount into words

'HR_IN_CHG_INR_WRDS'

THEN U CAN CHANGE ACCORDING TO U...bY USING CONCATENATE STATEMENT.

and for translating into upp\er case use this fm..

'TERM_TRANSLATE_TO_UPPER_CASE'

former_member217544
Active Contributor
0 Kudos

Hi Achal,

I think your question is not clear.

How you are creating the PO? From transaction or using BAPI or any BDC. And what/where is the amount field you are pointing to?

(Hope these are valid questions)

Regards,

Swarna Munukoti.

Former Member
0 Kudos

hi swarna......we are creating it by tcode me21n (on Production server).and by amount i am reffering to the amount of PO and in its print preview the system shows the right amount in no. but in words the amount is not proper.the amount is in dollars

Former Member
0 Kudos

check currency key...getting passed to PO...it might be in $

Former Member
0 Kudos

i have checked . IN_WORDS is the output parameter.SPELL_AMount is used . a part of the code is:

CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT    = amount
CURRENCY  = ZXEKKO-waers
LANGUAGE  = SY-LANGU
IMPORTING
IN_WORDS  = in_words
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS    = 3.
endif.

select single * from TCURT into wa_tcurt where spras = sy-langu and WAERS =
ZXEKKO-waers.
condense in_words-word.
condense in_words-decword.

if ZXEKKO-waers <> 'INR'.
translate in_words-word to lower case.
translate in_words-decword to lower case.
translate in_words-word(1) to upper case.
concatenate wa_tcurt-ktext in_words-word 'and' in_words-decword 'only'
into in_words-word
separated by space.
find substring 'cents' in in_words-word.
if sy-subrc = 0.
replace substring 'cents' in in_words-word with space.
endif.

find substring 'only' in in_words-word.
if sy-subrc = 0.
replace substring 'only' in in_words-word with space.
endif.

concatenate in_words-word 'cents' 'only'
into in_words-word
separated by space.

Sandra_Rossi
Active Contributor
0 Kudos

What number and what text do you get?

Former Member
0 Kudos

AMOUNT : 4,310,551.80

IN WORDS : US DOLLAR FOUR MILION THREE HUNDERED TEN THOUSNAD FIVE HUNDERED FIFTY-ONE AND EIGHTY THOUSNAD CENTS ONLY

everything is ok except the eighty thousand cents....that is amount aftr decimal

Sandra_Rossi
Active Contributor
0 Kudos

That's strange, SPELL_AMOUNT behaves as if the input amount has 5 decimals (4,310,551.80000) and the input currency has 5 decimals (for example dummy currency code "5").

1) Is there some custom code somewhere?

Could you check that by debug:

2) what is the variable type of the input amount?

3) what is the currency code (by debug) and could you check the number of decimals in TCURX table?

4) what is the language SY-LANGU?

Thx

Former Member
0 Kudos

Hi,

I thnk you can use this FM HR_IN_CHG_INR_WRDS

and replace Rupees with dollars and paise with cents.

Regards

Former Member
0 Kudos

multiply the amount by 10, then pass to the FM.

Former Member
0 Kudos

multiply by 10????? FM???????

i am not getting you