‎2006 Jul 07 2:22 PM
hi guys,
i want u guys to help me out here.i need a functional module which works exactly like SPELL_AMOUNT.The issue is that i want the amount 100,000 to be spelt as 1 lakh instead of one hundred thousand.
‎2006 Jul 07 2:23 PM
hi,
Check this
HR_IN_CHG_INR_WRDS -
number (price) to words.
SPELL_AMOUNT -
Same
1st Functional Module works the same way u want
Example
HR_IN_CHG_INR_WRDS
Importing
AMT_IN_NUM = '100000'
Exporting
AMT_IN_WORDS = ansans = ONE LAKH Rupees
Rewards points if solved
‎2006 Jul 07 2:27 PM
I know this is probably not what you are looking for, but I'm not sure that you will find a function module to do this for you.
report zrich_0001.
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.
Regards,
Rich heilman
‎2006 Jul 07 2:29 PM
‎2006 Jul 07 2:28 PM
hi Arup,
If you look at the documentation of the Function Module, it tells you that the table T015Z has to be customized for your language if the default format of the spelled amounts is not acceptable.
Unfortunately, the vales are stored only based on the language, and not on the currency. So If you configure the table for the English language, then all users who log on in English will get the same format (LAKHS, CRORES etc.,). This may not be acceptable for users in a country like US where the format preferred might be MILLIONS , BILLIONS etc.,
Please exercise caution before going ahead with configuring the table.
The only other alternative (to modifying the table) that I can think of will be to write your own function module!!
or check the below program
FUNCTION Z_FI_AMT_WRDS_CONVERT .
*"----
""Local interface:
*" IMPORTING
*" REFERENCE(AMT)
*" EXPORTING
*" REFERENCE(WORD) TYPE SPELL-WORD
*"----
amt_c1 = amt.
replace '.' with 'D' into amt_c1.
SEARCH amt_c1 for 'D'.
IF sy-subrc = 0.
amt_wh1 = amt_c1+0(sy-fdpos).
wrk_fdpos = sy-fdpos + 1.
amt_dc1 = amt_c1+wrk_fdpos(2).
ELSE.
amt_wh1 = amt_c1.
amt_dc1 = '00'.
ENDIF.
amtnmr = amt_wh1.
amtdec = amt_dc1.
CONCATENATE amtnmr amtdec INTO amount.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = amount
currency = 'INR'
filler = ' '
language = 'E'
IMPORTING
in_words = amountrs.
*WRITE: / 'amount in figures: ' ,'Rs.-->', AMTNMR,'.',AMTDEC.
*WRITE: / 'Amount in WORDS.: ' ,' Rs.' ,AMOUNTRS-WORD,
*'AND' ,AMOUNTRS-DECWORD ,'Paisa Only'.
*SKIP.
CLEAR: unit1,digit1,unit2,digit2,unit3,digit3,unit4,digit4,word1,word2,
word3,word4,word.
digit1 = amtnmr+14.
unit1 = amtnmr+13.
digit2 = amtnmr+12.
unit2 = '0'.
digit3 = amtnmr+11.
unit3 = amtnmr+10.
digit4 = amtnmr+9.
unit4 = amtnmr+8.
digit5 = amtnmr+7.
unit5 = amtnmr+6.
digit6 = amtnmr+5.
unit6 = '0'.
digit7 = amtnmr+4.
unit7 = amtnmr+3.
digit8 = amtnmr+2.
unit8 = amtnmr+1.
digit9 = amtnmr.
unit9 = '0'.
*WRITE:/ 'UNIT9 = ' , UNIT9, 'DIGIT9 = ', DIGIT9.
IF ( unit1 NE '0' ) OR ( digit1 NE '0' ).
SELECT SINGLE wort INTO word1 FROM t015z WHERE einh = unit1
AND ziff = digit1 AND spras = 'E'.
word1 = t015z-wort.
REPLACE ';' WITH '' INTO word1.
*write: / word1.
ENDIF.
IF unit2 NE '0' OR digit2 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit2
AND ziff = digit2 AND spras = 'E'.
word2 = t015z-wort.
REPLACE ';' WITH '' INTO word2.
CONCATENATE word2 ' HUNDRED ' INTO word2.
*REPLACE '(FEMININE)' WITH '' INTO WORD2.
*write: / word2.
ENDIF.
IF unit3 NE '0' OR digit3 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit3
AND ziff = digit3 AND spras = 'E'.
word3 = t015z-wort .
CONCATENATE word3 ' THOUSAND ' INTO word3.
REPLACE ';' WITH '' INTO word3.
*write: / word3.
ENDIF.
IF unit4 NE '0' OR digit4 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit4
AND ziff = digit4 AND spras = 'E'.
word4 = t015z-wort.
REPLACE ';' WITH '' INTO word4.
CONCATENATE word4 ' LAKH ' INTO word4.
*WRITE: / WORD4.
ENDIF.
IF unit5 NE '0' OR digit5 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit5
AND ziff = digit5 AND spras = 'E'.
word5 = t015z-wort.
REPLACE ';' WITH '' INTO word5.
*write: / word5.
ENDIF.
IF unit6 NE '0' OR digit6 NE '0'.
*UNIT6 = 'H'.
SELECT SINGLE * FROM t015z WHERE einh = unit6
AND ziff = digit6 AND spras = 'E'.
word6 = t015z-wort.
REPLACE ';' WITH ' ' INTO word6.
CONCATENATE word6 ' HUNDRED ' INTO word6.
*REPLACE '(FEMININE)' WITH '' INTO WORD6.
*write: / word6.
ENDIF.
IF unit7 NE '0' OR digit7 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit7
AND ziff = digit7 AND spras = 'E'.
word7 = t015z-wort.
REPLACE ';' WITH ' ' INTO word7.
CONCATENATE word7 ' THOUSAND ' INTO word7.
*write: / word7.
ENDIF.
IF unit8 NE '0' OR digit8 NE '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit8
AND ziff = digit8 AND spras = 'E'.
word8 = t015z-wort.
REPLACE ';' WITH '' INTO word8.
CONCATENATE word8 ' LAKHS ' INTO word8.
*write: / word8.
ENDIF.
IF digit9 NE '0'.
unit9 = '0'.
SELECT SINGLE * FROM t015z WHERE einh = unit9
AND ziff = digit9 AND spras = 'E'.
word9 = t015z-wort.
REPLACE ';' WITH ' ' INTO word9.
*REPLACE '(FEMININE)' WITH ' ' INTO WORD9.
CONCATENATE word9 ' HUNDRED ' INTO word9.
ENDIF.
CONCATENATE word9 word8 word7 word6 word5 ' CRORE ' INTO wordc
SEPARATED BY space.
*WRITE:/ 'Amount in Rs.------->'.
IF amountrs-decword NE 'ZERO'.
CONCATENATE ' AND PAISE ' amountrs-decword INTO dcwrd
SEPARATED BY space.
ENDIF.
IF amtnmr > 9999999.
*WRITE: / WORDC.
*ENDIF.
CONCATENATE 'RUPEES' wordc word4 word3 word2 word1 dcwrd 'ONLY'
INTO word SEPARATED BY space.
ELSE.
CONCATENATE 'RUPEES'word4 word3 word2 word1 dcwrd 'ONLY'
INTO word SEPARATED BY space.
ENDIF.
CLEAR dcwrd.
*WRITE 😕 WORD.
*WRITE: 'AND' ,AMOUNTRS-DECWORD ,'Paise Only
ENDFUNCTION.
or try to use the below function module
HR_IN_CHG_INR_WRDS
if u find it useful just mark some points
Regards,
Naveen
‎2006 Jul 07 2:29 PM
Hi,
There is a Fm <b>HR_IN_CHG_INR_WRDS</b> but it works only for india.
Regards
vijay
‎2007 Nov 13 5:28 AM
Hi the amount of greater than 1 lakh got transfeerrd to words day before yesterday but for 2 days it is not getting converted.Can nebody pls tell wy this problem is persisiting?
‎2014 May 30 7:58 AM
hii all,
my requirement is that, i have a smartform,and after i do some calculation of amount, taking that amount in a variable say val5 and i want to pass it in smartform .how do i do??
plzzz do reply..........
‎2014 May 30 8:59 AM
Hi Priyanka,
Hope you have a custom SMARTFORM. First set an import interface parameter for the form and push your amount from the program. If you want to display the amount in words, then use the function module, HR_IN_CHG_INR_WRDS and pass the amount as parameter. You will get the amount in words.
Regards,
Abijith