Application Development and Automation 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: 
Read only

SPELL_AMOUNT function module

Former Member
0 Likes
1,935

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,517

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

Read only

0 Likes
1,517

Hi,

Can u explain me the use of FILLER in the spell_amount FM.

Thanks in advance,

Kiran

Read only

0 Likes
1,517

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.

Read only

Former Member
0 Likes
1,517

USe FM HR_IN_CHG_INR_WRDS

Read only

Former Member
0 Likes
1,517

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

Read only

GauthamV
Active Contributor
0 Likes
1,517

hi,

use this function module.

HR_IN_CHG_INR_WRDS

Read only

Former Member
0 Likes
1,517

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