on 12-24-2009 10:01 AM
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
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
multiply the amount by 10, then pass to the FM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.