‎2008 Nov 26 5:40 AM
Hi frnds,
If i input 1,00,000 then the fn.module is giving one hundred thousand as output.
But for me the output should be "One lakh".
Is there anyother fn.module to get this?...
OR any additional parameter i have to pass in the SPELL_AMOUNT fn.module to get the same.....
Regards,
Renga
‎2008 Nov 26 5:42 AM
Hi,
Check the below code:
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = 0 <--Amount variable
CURRENCY = ' '
FILLER = ' '
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = IN_WORDS <- Output in Words
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2.
DATA: w_amt(100) TYPE c.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = '2500500.00'
IMPORTING
amt_in_words = w_amt.
Edited by: Neenu Jose on Nov 26, 2008 6:43 AM
‎2009 Jan 12 8:36 AM
Hi,
Can u explain me the use of FILLER in the spell_amount FM.
Thanks in advance,
Kiran
‎2009 Jan 12 8:59 AM
Hi,
It is going to fill up the remaining spaces in the output parameter IN_WORDS with whatever you fill in parameter FILLER.
Regards,
Dev.
‎2008 Nov 26 5:43 AM
‎2008 Nov 26 5:45 AM
hi,
this is my own customised Function Module..You can use this...
import
AMOUNT TYPE KONV-KAWRT Condition base value
CURRENCY TYPE CHAR3 3-Byte field
export
WORDS TYPE C
FUNCTION zconvert_amnt_to_words.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(AMOUNT) TYPE KONV-KAWRT
*" REFERENCE(CURRENCY) TYPE CHAR3
*" EXPORTING
*" REFERENCE(WORDS) TYPE C
*"----
DATA: w_amount(255) TYPE c,
w_out_amt(255) TYPE c,
amt_in_inr TYPE pc207-betrg.
amt_in_inr = amount.
IF currency = 'INR'.
CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
EXPORTING
amt_in_num = amt_in_inr
IMPORTING
amt_in_words = w_amount
EXCEPTIONS
data_type_mismatch = 1
OTHERS = 2.
IF sy-subrc 0.
RAISE data_type_mismatch.
ENDIF.
IF w_amount CS 'Rupee' AND w_amount NS 'Rupees'.
IF w_amount CS 'Paise'.
REPLACE 'Rupee' WITH 'And' INTO w_amount.
ELSE.
REPLACE 'Rupee' WITH space INTO w_amount.
ENDIF.
CONCATENATE w_amount ' Only' INTO w_amount.
ELSEIF w_amount CS 'Rupees'.
IF w_amount CS 'Paise'.
REPLACE 'Rupees' WITH 'And' INTO w_amount.
ELSE.
REPLACE 'Rupees' WITH space INTO w_amount.
ENDIF.
CONCATENATE w_amount ' Only' INTO w_amount.
ELSE.
CONCATENATE w_amount ' Only' INTO w_amount.
ENDIF.
TRANSLATE w_amount TO UPPER CASE.
words = w_amount.
ENDIF.
ENDFUNCTION.
regards
siva
‎2008 Nov 26 5:45 AM
‎2009 Jan 12 9:05 AM
Hi Nivetha,
Example
HR_IN_CHG_INR_WRDS
Importing
AMT_IN_NUM = '100000'
Exporting
AMT_IN_WORDS = ans
ans = ONE LAKH Rupees
Cheers,
Pravin s
Edited by: pravin s. on Jan 12, 2009 10:05 AM