07-25-2008 11:23 AM
Hi
Can anybody tell me the functional module to convert amount in thousand and lacks .
Regards
Kamal
07-25-2008 11:25 AM
07-25-2008 11:24 AM
hi,
i have copied standard and did this......u can use this....
function zspell_amount.
*"----
""Local Interface:
*" IMPORTING
*" REFERENCE(AMOUNT)
*" EXPORTING
*" REFERENCE(TEXT)
*" EXCEPTIONS
*" NOT_FOUND
*" TOO_LARGE
*"----
TABLES SPELL.
&----
*
& Data Declaration *
&----
*
data: amount_ch(13) ,
text1(150) ,
text2(35) ,
flag ,
len type i ,
move type i .
data : begin of itab ,
cr(3),
lac(2),
th(2),
hun(3),
paise(3),
end of itab .
amount_ch = amount.
len = strlen( amount_ch ).
move = 13 - len.
shift amount_ch right by move places.
move amount_ch to itab.
write: 'RUPEES' to text1.
if itab-cr ne '000' and itab-cr ne space.
perform spellamount using itab-cr 'CRORE' flag text1.
endif.
if itab-lac ne '00' and itab-lac ne space.
perform spellamount using itab-lac 'LAKH' flag text1 .
PERFORM SPELLAMOUNT USING ITAB-LAC 'LACS' FLAG TEXT1 .
endif.
if itab-th ne '00' and itab-th ne space.
perform spellamount using itab-th 'THOUSAND' flag text1 .
endif.
if itab-hun ne '000' and itab-hun ne space..
perform spellamount using itab-hun '' flag text1 .
endif.
if itab-paise ne '.00' and itab-paise ne space .
flag = 1.
perform spellamount using itab-paise 'PAISE' flag text1.
endif.
concatenate text1 'ONLY' into text1 separated by space.
write text1 to text.
endfunction.
&----
*& Form SPELLAMOUNT
&----
form spellamount using amount
unit
flag
text1 .
call function 'SPELL_AMOUNT'
exporting
amount = amount
language = sy-langu
importing
in_words = spell
exceptions
not_found = 1
too_large = 2
others = 3.
if flag = 0.
concatenate text1 spell-word unit into text1 separated by ' ' .
else.
concatenate text1 'AND' unit spell-word into text1 separated by ' '.
endif.
clear spell.
endform. " SPELLAMOUNT
07-25-2008 11:25 AM
07-25-2008 11:27 AM
07-25-2008 11:27 AM
Use SPELL_AMOUNT . But as per Indian format you will need to change in the logik of FM.
Regards
Rajesh
07-25-2008 11:28 AM