Application Development and Automation 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: 
Read only

Internal table does not long enough...

Former Member
0 Likes
1,930

Hi experts;

I have a problem with internal table .

data: itab like zbc_table1 occurs 0 with header line..

select * from zbc_table1 to table itab.

when i execute the program there is a error says: itab not long enough

How can i solve the problem?

Thanks

6 REPLIES 6
Read only

Former Member
0 Likes
899

yoru declaration doesnt seem right . Try this.

data: Begin of itab occurs 0, " By default it is created with header line.

include zbc_table1,

end of itab.

- This will work.

- Guru

Reward points for helpful answers

PS - Please mark the thread as answered and close the thread if your problem is solved

Message was edited by:

Guruprasad Moorthy

Read only

Former Member
0 Likes
899

HI,

I dont find any problem with your code, except the select stmt:

select * from zbc_table1 <b>into</b> table itab.

If this does not work, try "into corresponding fields of table itab".

Regards

Subramanian

Read only

Former Member
0 Likes
899

Hi,

I believe this error would have come in the SQL.

Check this example..In the internal table ITAB there is only one field MATNR..But in the select I used *. Then I got the syntax error "Itab" not long enough..

DATA: BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

SELECT * FROM MARA INTO TABLE ITAB.

To fix the error..

Give the fields that you have listed in the internal table OR use INTO CORRESPONDING FIELDS OF.

Solution

-


SELECT MATNR FROM MARA INTO TABLE ITAB.

OR

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB.

Thanks,

Naren

Read only

Former Member
0 Likes
899

syntactically its correct,but u have used 'to table itab' instead of 'into table itab'....

Read only

Former Member
0 Likes
899

data: itab like zbc_table1 occurs 0 with header line..

select * from zbc_table1 <b>to(replace with into</b> table itab.

so...it will be <b>select * from zbc_table1 into table itab</b>

Read only

Former Member
0 Likes
899

data: itab like zbc_table1 occurs 0 with header line..

select * from zbc_table1 <b>INTO</b> table itab.

Thats all i think its over. Please close it.