‎2008 Dec 25 6:39 AM
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
‎2008 Dec 25 6:48 AM
‎2008 Dec 25 7:22 AM
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
‎2008 Dec 26 12:22 PM
Hi Misbah,
Can u tell me on basis of which field are you reading the table.
‎2008 Dec 26 6:57 PM
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).
‎2008 Dec 27 10:41 AM
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.
‎2008 Dec 27 9:27 PM
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
‎2008 Dec 28 6:57 PM
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
‎2008 Dec 30 5:27 AM
Hi,
If you are always extracting data from the dable then you run report in background mode and avoid timeout problem.
regards,
Md.MahaboobKhan