‎2007 Jan 14 7:50 PM
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
‎2007 Jan 14 7:56 PM
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
‎2007 Jan 15 2:15 AM
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
‎2007 Jan 15 2:20 AM
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
‎2007 Jan 15 12:05 PM
syntactically its correct,but u have used 'to table itab' instead of 'into table itab'....
‎2007 Jan 15 12:19 PM
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>
‎2007 Jan 16 7:26 AM
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.