‎2008 Jun 05 12:20 PM
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,
Satish
‎2008 Jun 05 12:22 PM
‎2008 Jun 05 12:31 PM
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.
‎2008 Jun 05 12:55 PM
hi,
Either u have to modify table with one more ref field update that field while u r selecting set of 1000 records .
OR
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 ,
Swarup
‎2008 Jun 09 7:07 AM