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

fetch data into internal table

Former Member
0 Likes
1,430

Hi all,

I want to fetch all the opbel records from erdk table into an intrnal table.

Only opbel records.There are 100000000 records in erdk table.

How can I fetch into internal table ? what statement can I use to fetch the data faster keepin performance into consideration ?

Many thanks

4 REPLIES 4
Read only

Former Member
0 Likes
647

hi,

try this

data: itab like erdk occurs 0.

select * from erdk into corresponding fields of itab.

endselect.

Edited by: Rajasekhar Reddy on Jan 24, 2008 10:05 AM

Read only

Former Member
0 Likes
647

Hi,

As far as data fetch is concerned you do the same as follows:

Select * from erdk into table itab

where..... < Your Where Condition if any>.

But as the number of records are very high, first try to put all the primary keys in the where clause and also if possible, try to narrow down the selection criteria by fetching data from some other table or widening the conditions in where clause.

Also try to fetch only thode fields which you actually need.

else your program will give performance problems.

Hope this helps!

Regards,

Lalit

Read only

Former Member
0 Likes
647

Hi,

Data: itab LIKE TABLE OF erdk WITH HEADER LINE.

SELECT * INTO TABLE itab

FROM erdk.

Read only

Former Member
0 Likes
647

gaurav,

Generally when you try to select all records of field OPBEL into to internal table there is chance to go to the report dump.

So better you use package size.Here you will get slect....end select but you can stop the program from dump.

SELECT opbel

INTO APPENDING TABLE ITAB

PACKAGE SIZE 30000.

        • Here if you want to do any validations you can do code here.....

ENDSELECT.

Don't forget to reward if useful...