2007 Jul 09 1:46 PM
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.
2007 Jul 09 1:48 PM
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
2007 Jul 09 1:47 PM
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
2007 Jul 09 1:48 PM
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
2007 Jul 09 1:49 PM
2007 Aug 07 2:51 AM
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
2007 Aug 07 2:58 AM
2007 Aug 07 3:40 AM
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.
2007 Aug 07 8:34 AM
hi
but if i try like this no output is displayed.....
cheers
asha
2007 Aug 07 8:38 AM
2007 Aug 08 7:54 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |