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

fetching records in block

Former Member
0 Likes
2,216

hi guruz,

i have requirement something like that in a table more than 3 lakh record are there.

i want to fetch records in a block of 1000 . how can i achive this.

i already implemented one way that fetch all records (3 lakhs) one time , and process those in internal table .

But selecting 3lakhs records at one time abap application server giving timeout error.

some cofigraution required or what.

please guide me.

warm regards.

hi guruz,

i have requirement something like that in a table more than 3 lakh record are there.

i want to fetch records in a block of 1000 . how can i achive this.

i already implemented one way that fetch all records (3 lakhs) one time , and process those in internal table .

But selecting 3lakhs records at one time abap application server giving timeout error.

some cofigraution required or what.

please guide me.

warm regards.

9 REPLIES 9
Read only

Former Member
0 Likes
1,667

use select upto 1000 rows...

Read only

0 Likes
1,667

SELECT UP TO 1000 entries will not work because it will give you the first 1000 but you wont be able to fetch subsequent 1000 entiries.

Read only

Former Member
0 Likes
1,667

Are these 3Lakh records coming as successful data or you are filtering at a later stage?

Is there no way to restrict the number of entries by using any Where conditions?

Even if you process in chunks of 1000, program will give you a TIME OUT error because eventually you intend to process 3 Lakh entries.

Read only

Former Member
0 Likes
1,667

can u send the code,

or are you using lots of looping statements or are you using append statement then there will be a timeout error.

Read only

Former Member
0 Likes
1,667

what's the table structure ?

Dont you have identification to septrate records like ordrnum .. etc ..

if possible an another feild' can be inserted in the table with index number of record this speeds the processing some time if we dont have proper primary key

Read only

Former Member
0 Likes
1,667

Hi Pawan ,

You will have to use Oracle Hints to select the data in blocks of 1000 , please refer to some document on oracle hints .

But that would also not help the tim out , because when you use that it basically acts as select endselct statement and the system might again give a tim out error , so my suggestion would be to try to optamize your select starement .

Regards ,

Arun

Read only

Former Member
0 Likes
1,667

Hi..

Even if you try fetching records in block of 1000's.. you anyway..need 3 lakh record.. it would go for runtime error..then also....

So.. i guess either you reduce teh number of records to be selected.. or .. run the program in background....

Read only

Former Member
0 Likes
1,667

Hi,

what about doing it package by package ( 1 package = 1000 rows) and process the int. table as you like:

DATA: itab TYPE STANDARD TABLE OF SCARR WITH NON-UNIQUE 
                 DEFAULT KEY INITIAL SIZE 10. 
FIELD-SYMBOLS: <FS> TYPE scarr. 

SELECT * INTO TABLE itab PACKAGE SIZE 1000 FROM scarr. 
  LOOP AT itab ASSIGNING <FS>. 
            ... process it
  ENDLOOP. 
ENDSELECT.

Set the package size high enough that you have not many additional selects

(10.000 or 50.000 should be also ok).

Please be aware that the int. table is only defined inside the SELECT / ENDSELECT.

bye

yk

Read only

Former Member
0 Likes
1,667

In this example, four columns of the result set are read into four individually specified columns of a structure. Unlike in the previous example, the runtime environment does not compare names here.

DATA wa TYPE spfli.

SELECT carrid connid cityfrom cityto

FROM spfli ... INTO|APPENDING [CORRESPONDING FIELDS OF] TABLE itab [PACKAGE SIZE n]

INTO ENDSELECT.

PACKAGE SIZE n >>>>>>>>>>>>>>.Imp keyword for you