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

doubt in spell_amount?

Former Member
0 Likes
1,270

hi all

how to use the function module spell_amount..what should i export and import?

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = <b>?</b>

CURRENCY = <b>?</b>

  • FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = <b>?</b>

  • EXCEPTIONS

  • NOT_FOUND = 1

  • TOO_LARGE = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,241

Hi

Export parameters are the amount, has to be written in words, and the currency, in import parameter you'll have the amount in words.

Try this:

TABLES SPELL.

PARAMETERS: P_AMOUNT LIKE BSEG-WRBTR,
            P_WAERS  LIKE T001-WAERS.


CALL FUNCTION 'SPELL_AMOUNT'
     EXPORTING
          AMOUNT    = P_AMOUNT
          CURRENCY  = P_WAERS
          LANGUAGE  = SY-LANGU
     IMPORTING
          IN_WORDS  = SPELL
     EXCEPTIONS
          NOT_FOUND = 1
          TOO_LARGE = 2
          OTHERS    = 3.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE: 'Integer part:', SPELL-WORD,
       'Decimal part:', SPELL-DECWORD.

Max

hi all

how to use the function module spell_amount..what should i export and import?

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = <b>?</b>

CURRENCY = <b>?</b>

  • FILLER = ' '

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = <b>?</b>

  • EXCEPTIONS

  • NOT_FOUND = 1

  • TOO_LARGE = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

9 REPLIES 9
Read only

Former Member
0 Likes
1,241

Hi..,

This spell_amount function module gives the amount (that u have entered) in words,,,,

if u give the amount as 50,320.00

and currency INR

language EN

then the importing parameter contains the text ...

<b>Fifty Thousand Three hundred and twenty rupees.</b>

regards,

sai ramesh

Read only

Former Member
0 Likes
1,242

Hi

Export parameters are the amount, has to be written in words, and the currency, in import parameter you'll have the amount in words.

Try this:

TABLES SPELL.

PARAMETERS: P_AMOUNT LIKE BSEG-WRBTR,
            P_WAERS  LIKE T001-WAERS.


CALL FUNCTION 'SPELL_AMOUNT'
     EXPORTING
          AMOUNT    = P_AMOUNT
          CURRENCY  = P_WAERS
          LANGUAGE  = SY-LANGU
     IMPORTING
          IN_WORDS  = SPELL
     EXCEPTIONS
          NOT_FOUND = 1
          TOO_LARGE = 2
          OTHERS    = 3.

IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


WRITE: 'Integer part:', SPELL-WORD,
       'Decimal part:', SPELL-DECWORD.

Max

Read only

Former Member
0 Likes
1,241

check the program <b>RF_SPELL</b>

Read only

Former Member
0 Likes
1,241

SPELL_AMOUNT is a function that return an amount in words. The exporting parameters are amount (in numbers), currency (currency of wanted country) and filler (character wanted to out).

The IMPORTING parameter is in_words (a structure filled with the amount in words).

I did learn this yesterday...

It's a simple explanation... I hope this has helped you...

Alexis Sanchez

ABAP Trainee

Valencia, Venezuela

Read only

Former Member
0 Likes
1,241

Read only

Former Member
0 Likes
1,241

hi Asha

try this

call function 'SPELL_AMOUNT'

exporting

amount = w_amount

importing

in_words = w_text

exceptions

not_found = 1

too_large = 2

others = 3

there w_amount should be like SPELL-NUMBER

and w_text should be type SPELL

data : w_amount like SPELL-NUMBER

data : w_text type SPELL

Rewards If Useful.

Read only

0 Likes
1,241

hi

but if i try like this no output is displayed.....

cheers

asha

Read only

0 Likes
1,241

WHAT IS THE CASE DEAR....

Read only

0 Likes
1,241

Hi...

Try this...

DATA: p_amnt like spell-number, " Amount in numbers (input)

p_words type spell. " Amount in text (output)

p_amnt = 150000.

CALL FUNCTION 'SPELL_AMOUNT'

EXPORTING

AMOUNT = p_amnt

CURRENCY = 'VEB'

FILLER = '*' " It's the character to fill blanks

LANGUAGE = SY-LANGU

IMPORTING

IN_WORDS = p_word " It's amount in words

EXCEPTIONS

NOT_FOUND = 1

TOO_LARGE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

¡¡¡WARNING!!!

The two last digits are the decimal part.

-

-


>>>> The output for ES languaje is MIL QUINIENTOS**************************

-

-


>>>> The output for EN languaje is ONE THOUSAND FIVE HUNDRED***************

Good luck

Alexis Sanchez
ABAP Trainee
Valencia, Venezuela