‎2007 Apr 27 11:41 AM
I am trying to use this function module to display subtotals of orders in my report....But I am not able to pass the parameters correctly.....Can I have a sample code of working with this function module.Thank you.
‎2007 Apr 27 11:43 AM
Hi Venkat
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 HR_IN_CHG_INR_WRDS
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
‎2007 Apr 27 11:43 AM
chk the program <b>RF_SPELL</b>
but this FM is used to give the amount in words
‎2007 Apr 27 11:44 AM
spell_amount function module is used to write the given number in words
‎2007 Apr 27 11:50 AM
Hi,
This is the code,
TABLES SPELL.
DATA : T_SPELL LIKE SPELL.
DATA: PWAERS LIKE SY-WAERS.
PARAMETERS : AMOUNT LIKE SPELL-NUMBER.
*PARAMETERS: AMOUNT LIKE PAMOUNT.
SY-TITLE = 'AMOUNT TO WORDS'.
*PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
*FORM SPELL_AMOUNT USING PWRBTR PWAERS.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = AMOUNT
CURRENCY = PWAERS
FILLER = SPACE
LANGUAGE = 'E'
IMPORTING
IN_WORDS = T_SPELL
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
*ENDFORM. " SPELL_AMOUNT
WRITE:1 'RS.',5 T_SPELL-WORD, 'POINT', T_SPELL-DECWORD, 'ONLY'.
‎2007 Apr 27 11:52 AM
call function 'SPELL_AMOUNT'
exporting
amount = w_amount
CURRENCY = 'USD'
FILLER = ' '
language = sy-langu
importing
in_words = w_text
exceptions
not_found = 1
too_large = 2
others = 3