‎2007 Apr 24 10:38 AM
Hi All,
Can anyone tell me the fm for coverting digits to words?
Ex. !0,020 - ten thousand and twenty only.
Thanks in advance
‎2007 Apr 24 10:41 AM
‎2007 Apr 24 10:40 AM
HI Shreya
You can use <b>SPELL_AMOUNT</b>
REPORT ZSPELL.
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '123451022343333235'.
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT
or
Use FM <b>HR_IN_CHG_INR_WRDS</b>
DATA cur LIKE pc207-betrg VALUE '100000.00'.
DATA words(100) TYPE c.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = cur
IMPORTING
amt_in_words = words.
WRITE words.
Regards Rk
Message was edited by:
Rk Pasupuleti
‎2007 Apr 24 10:51 AM
ur code is directly showing this value.
NUMBERS
FOUR TRILLIONSFIVE HUNDRED TEN BILLIONS TWO HUNDRED TWENTY-THREE MILLION FOUR HUNDRED THIRTY-THREE THOUSAND THREE HUNDRED THIRTY-TWO
DECIMALS THIRTY-FIVE
is it hard coded?
‎2007 Apr 24 10:57 AM
Hi Shreya
I didn't get your question , If you give that input then you will get the according output or
if you need to pass the number then change that Variable as <b>Parameter</b> Instead of Data and pass the required number from selection screen
Regards Rk
‎2007 Apr 24 10:40 AM
u can use SPELL_AMOUNT fm or
HR_IN_CHG_INR_WRDS for INR.
or check program RF_SPELL.
Regards
prabhu
‎2007 Apr 24 10:41 AM
‎2007 Apr 24 10:43 AM
‎2007 Apr 24 10:58 AM
Hi shreya,
<b>
SPELL_AMOUNT, HR_IN_CHG_INR_WRDS</b>
serves for your purpose.
Here
TABLES SPELL.
DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '123451022343333235'.
<b> Here change the value it is not hard coded.
You can change this variable into a parameter. So that you can give the values you want</b>
SY-TITLE = 'SPELLING NUMBER'.
PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = PAMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
ENDFORM. " SPELL_AMOUNT
‎2007 Apr 24 11:06 AM
Thanks to all,
I'll try using these fms in my programs.
Points r rewarded to all helpful answers.
‎2007 Apr 24 11:16 AM
HI Shreya
Dont forget to <b>close the Thread</b> if you got the Answer
Regards Rk