Application Development 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: 

table_illegal_statment

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

Hi,

Check the read statement,whether you are getting the values in the workarea.

Regards,

Raj.

former_member784222
Active Participant
0 Kudos

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.