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

Former Member
0 Likes
1,358

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.

5 REPLIES 5
Read only

Former Member
0 Likes
1,012

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

Read only

Former Member
0 Likes
1,012

chk the program <b>RF_SPELL</b>

but this FM is used to give the amount in words

Read only

Former Member
0 Likes
1,012

spell_amount function module is used to write the given number in words

Read only

Former Member
0 Likes
1,012

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'.

Read only

Former Member
0 Likes
1,012

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