Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

function module to convert amount in thousand and lacks

Former Member
0 Kudos

Hi

Can anybody tell me the functional module to convert amount in thousand and lacks .

Regards

Kamal

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hiii

use SPELL_AMOUNT FM.

regards

twinkal

5 REPLIES 5

former_member262988
Active Contributor
0 Kudos

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

Former Member
0 Kudos

hiii

use SPELL_AMOUNT FM.

regards

twinkal

Former Member
0 Kudos

Use FM 'SPELL_AMOUNT' or

' HR_IN_CHG_INR_WRDS '

Regards,

Shailaja

Former Member
0 Kudos

Use SPELL_AMOUNT . But as per Indian format you will need to change in the logik of FM.

Regards

Rajesh

Former Member
0 Kudos

This message was moderated.