‎2008 Apr 22 10:45 AM
hi,
I am using FM SPELL_AMOUNT to convert from numeric to word, but when i run the driver program, i get an exception TYPE CONFLICT WHEN CALLING FUNCTION MODULE.
Following is the syntax of function module call:-
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = wa-seatnum
*CURRENCY = ' '
*FILLER = ' '
LANGUAGE = 'EN'
IMPORTING
IN_WORDS = word
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
Please help
Regards
‎2008 Apr 22 10:48 AM
Hi,
Like any function module, the data type of your variables need to match the definition in the function module. So, either wa-seatnum or word need to be changed to have the same defintion as the function module.
The short dump will tell you which field is incorrect.
Regards,
Nick
‎2008 Apr 22 10:48 AM
Hi,
Like any function module, the data type of your variables need to match the definition in the function module. So, either wa-seatnum or word need to be changed to have the same defintion as the function module.
The short dump will tell you which field is incorrect.
Regards,
Nick
‎2008 Apr 22 10:52 AM
Hi Dhiraj,
Please check the type declarations of the fields which r passed to the parameters of the Function modules
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = wa-seatnum
*CURRENCY = ' '
*FILLER = ' '
LANGUAGE = 'EN'
IMPORTING
IN_WORDS = word
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
please try this
DATA: result TYPE vbak-netwr,
words TYPE spell.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = result
currency = wa_tabl-waerk
filler = ' '
language = sy-langu
IMPORTING
in_words = words
EXCEPTIONS
not_found = 1
too_large = 2.reward if helpful
raam
‎2008 Apr 22 10:56 AM
HI,
Use the Function Module SPELL_AMOUNT to convert the integer into text.
DATA v_int TYPE i VALUE '1000'.
DATA words LIKE SPELL.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = v_int
LANGUAGE = SY-LANGU
IMPORTING
IN_WORDS = words
.
WRITE words-word.
Regards,
Shiva.