Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

select query

Former Member
0 Kudos

Dear Frens,

I have a requirement where in which i need to select some 1000 records at once from a master DB table.

For that, i know we can use 'cursor' which implicitly takes care of the index DB pointer, which allows to read 1000 then 1000 records,so on sequentially.

In case of a RFC call, i should not use cursor.

Hence the option that i have left is use some condition in select query to fetch 1000 records.

This is the select query :

select distinct addrnumber from ADRC

into corresponding fields of table sel_tab

up to 1000 rows

where addrnumber GE ls_addrnumber

order by addrnumber.

here ls_addrnumber stores last read Addrnumber.

This query can select 1000 records at once. But the problem i have is that, the database is always cannot be in a sorted manner. Hence the condition which i have used above to fetch next 1000 records will not be fruitful, there is a change of missing some records.

Can anybody have any better solution. As i said earlier, i cannot use cursors.

Reply asap,.

WIth Best regards,



Former Member
0 Kudos


Try using package size.


Sriram Ponna.

0 Kudos

I cannot use package size and up to rows serves the same purpose to restrict the number of enties. i cannot use package size in my case as it needs endselect. But the problem is with the condtion which selects next set of records.

0 Kudos


Either u have to modify table with one more ref field update that field while u r selecting set of 1000 records .


Take bunch records in Internal table and pass set of 1000 records in to another internal table for processing then delete these records from first internal table. That way u can proceed.

Regards ,


Former Member
0 Kudos

solved by myself.