‎2007 Dec 20 6:09 AM
Hi,
Is there any function module to convert value of numeric field to words.
Eg.
Amount : $ 2881.88
Words: Two Thousand eight hundred eighty-one dollars and 88 cents
please mention constraints if any.
‎2007 Dec 20 6:12 AM
HI
use SPELL_AMOUNT
code
data: words type spell.
call function 'SPELL_AMOUNT'
exporting
amount = '100000'
CURRENCY = ' '
FILLER = ' '
LANGUAGE = SY-LANGU
importing
in_words = words.
if words-word = 'ONE HUNDRED THOUSAND'.
words-word = '1 LAKH'.
endif.
write:/ words-word.[/code]
/community [original link is broken]
Reward if usefull
‎2007 Dec 20 6:13 AM
hi Vivek.,
use these fm SPELL_AMOUNT,
HR_IN_CHG_INR_WRDS which tells amnt in Rupees.
Reward points if useful
Edited by: Chandra
‎2007 Dec 20 6:14 AM
‎2007 Dec 20 6:16 AM
‎2007 Dec 20 6:18 AM
hi,
use SPELL_AMOUNT fm,
give value
IMPORT
AMOUNT parameter
export
IN WORDS u get the output.
‎2007 Dec 20 6:35 AM
‎2007 Dec 20 8:42 AM
Hi All,
i also want to know how to get the output as 88 cents and not eighty-eight cents (as shown in my example)
‎2007 Dec 20 8:54 AM
hi,
you can try in other way,use spell_amount function first part and not for decimal part.
just before calling fm you separate value at . into 2 variables.
split value at '.' into v_value1 v_value2.
pass v_value1 to fm:spell_amount.
then depending upon the currency symbol you have to cancatenate other part currency like cents or paisa..etc.
currency = value+0(1).
if currency = '$'.
v_curr = 'cents'.
else.
v_curr = 'paisa'.
endif.
concatenate value_op_from_fm
v_value2
v_curr into final_variable.
Regds
Sivaparvathi
Please reward points if helpful..............