04-24-2008 6:37 AM
Hi,
I am running a sapscript and calling a subroutine through it. I want to convert the numeric to words. Therefore i am using function module SPELL_AMOUNT. While executing the driver program i am getting an exception ILLEGAL_TABLE_STATEMENT while execution of the FM SPELL_AMOUNT.
Can anybody please help know what does this exception mean and what can i do to correct it?
Following is the code of the subroutine.
PROGRAM ZDHSUBPOOL.
FORM NUM_TO_WORD TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
Tables zdhboardingpass.
DATA : SEAT_NUM TYPE zdhboardingpass-seatnum,
words LIKE spell.
READ TABLE IN_PAR WITH KEY NAME = 'SEATNUM'.
SEAT_NUM = IN_PAR-VALUE.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
AMOUNT = SEAT_NUM
*CURRENCY = ' '
*FILLER = ' '
LANGUAGE = sy-langu
IMPORTING
IN_WORDS = words
EXCEPTIONS
NOT_FOUND = 1
TOO_LARGE = 2
OTHERS = 3.
OUT_PAR-value = words-word.
MODIFY OUT_PAR.
ENDFORM.
Regards,
Dhiraj
04-24-2008 6:42 AM
Hi,
Check the read statement,whether you are getting the values in the workarea.
Regards,
Raj.
04-24-2008 6:47 AM
Hi,
Use
MODIFY OUT_PAR index 1
or
LOOP AT OUT_PAR.
OUT_PAR-value = words-word
modify out_par. "This will work only if this is inside
loop/endloop.
ENDLOOP.
Thanks and regards,
S. Chandra Mouli.