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

Reading Huge Table

Former Member
0 Likes
1,323

Hi Experts,

I need to read a table with large number of records ( > 800 K )

sometimes, the system will terminate the my report because it is taking too much time to read

from the table, I am reading all the records and I store them in an internal table (not smart!)

now I am thinking of just reading a record by record and process each record, to process each record I need to read again from another table. I tried to use cursor to read record by record but I got runtime error I guess because I am reading again from the database (another table).

is there a way to read a table sequentially, where in each time I read 500 records, store them in internal table and process them, then I read the next 500 records and do the same until I read all records in the table ?

Thanks a lot

8 REPLIES 8
Read only

Former Member
0 Likes
1,222

This message was moderated.

Read only

0 Likes
1,222

Thanks avinash,

Package Size might help to solve the problem, so if I specified 500 as the package size, 500 records will be stored in the internal table , how can I get the next 500 records until I process all the records ?

Thanks

Read only

Former Member
0 Likes
1,222

Hi Misbah,

Can u tell me on basis of which field are you reading the table.

Read only

0 Likes
1,222

Hi Sumit,

I am reading all the fields, basically I need to extract all the records (all fields too) in this huge table and also I need to use the key to read related data from other tables too. finally each record with all its related data will be stored in a text file (one file per record).

Read only

0 Likes
1,222

Hi ,

Dont use nested loops, select endselect statement that will take more time so

take all the required fields into a structure and select from the table it will work the best.

Regards ,

Rajesh S.

Read only

0 Likes
1,222

Hi,

If you always want to read the entire database table with all its fields, then you should run the report in background to avoid the timeout. Otherwise there is no way out but to restrict the database selection by using where clause in your select statment.

regards,

Advait

Read only

0 Likes
1,222

thanks everyone for your answers.

just before I close this, I want to make sure of one thing. I am reading some ABAP helps related to this.

and I am wondering can I use something like this to copy data from a database table to an internal table ?

INSERT LINES OF <itab1> [FROM <n1>] [TO <n 2>] INTO TABLE <itab2>.

or this is possible only to copy data from one internal table to another.

Thanks

Read only

Former Member
0 Likes
1,222

Hi,

If you are always extracting data from the dable then you run report in background mode and avoid timeout problem.

regards,

Md.MahaboobKhan