‎2007 May 07 9:55 PM
HI,
Can any one help me with following code.? Please fix the errors in the code.
DATA : MONEY TYPE I,
VALUE LIKE SY-WAERS,
LANG LIKE SY-LANGU,
IN_LETTERS LIKE SPELL.
MONEY = 1000.
CALL FUNCTION 'SPELL AMOUNT'
EXPORTING
AMOUNT = MONEY
IMPORTING
IN_WORDS = IN_LETTERS
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3
IF SY-SUBRC <> 0
ENDIF.
WRITE : / AMOUNT, VALUE, IN_LETTERS.
‎2007 May 07 10:00 PM
I guess data type for MONEY should be N.
Please check and confirm.
Regards,
Amey
‎2007 May 07 10:10 PM
Hi,
Check this..
DATA : money TYPE p DECIMALS 2,
in_letters LIKE spell.
money = '1000.00'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = money
IMPORTING
in_words = in_letters
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
WRITE : / in_letters-WORD.
Thanks,
Naren
‎2007 May 07 10:11 PM
Hi,
Please try this.
DATA: MONEY LIKE PAYR-RWBTR,
VALUE LIKE SY-WAERS,
LANG LIKE SY-LANGU,
IN_LETTERS LIKE SPELL.
MONEY = 1000.
VALUE = SY-WAERS.
LANG = SY-LANGU.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = MONEY
CURRENCY = VALUE
LANGUAGE = LANG
IMPORTING
IN_WORDS = IN_LETTERS
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
WRITE : / MONEY, VALUE, IN_LETTERS-WORD.
Regards,
Ferry Lianto
‎2007 May 08 1:40 AM
The output I am getting is One Thousand.
I would like to have output as One thousand dollars.
VALUE = SY-WAERS.
‎2007 May 08 1:41 AM
The output I am getting is One Thousand.
I would like to have output as One thousand dollars.
VALUE = SY-WAERS. What does this statement do
‎2007 May 07 10:15 PM
Try:
DATA : money TYPE i,
value LIKE sy-waers,
lang LIKE sy-langu,
in_letters LIKE spell.
money = 1000.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = money
IMPORTING
in_words = in_letters
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
WRITE : / money, value, in_letters-word.
Rob
‎2007 May 08 3:42 AM
Hi,
Try this code.Now it is not showing any error.Reward points by clicking the star on the left of reply,if it helps.
DATA : MONEY TYPE I,
VALUE LIKE SY-WAERS,
LANG LIKE SY-LANGU,
IN_LETTERS TYPE SPELL.
MONEY = 1000.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = MONEY
IMPORTING
IN_WORDS = IN_LETTERS
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3<b>.</b>
IF SY-SUBRC <> 0<b>.</b>
ENDIF.
WRITE : / <b>MONEY</b>, VALUE, <b>IN_LETTERS-word</b>.