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.
cancel
Showing results for 
Search instead for 
Did you mean: 

select * from mara from row 1 up to row2

Former Member
0 Kudos

Hi All

I want to fetch records from MARA table in packets.

Like select matnr

matkl from MARA into table itab

from row1 up to row2.

Here Row1 and row2 are variables n could have values like 10000 to 20000.

Please suggest me any idea here which i can use here to get records in packets without using do..enndo or select ..endselect.

5 REPLIES 5

Former Member
0 Kudos

Create ranges and pass the range of values in the low and high values and use the select statement as below.

Let us suppose you have created range r_range

r_range-low = '100000'

r_range-high = '200000'.

r_range-options = 'BT'.

r_range-sign = 'I'.

select matne from mara into table where matnr in r_range.

rewars points if useful,

Thanks,

Nageswar

0 Kudos

But here i dont know the material numbers. We have only rows number.

Edited by: Amit Kumar on Jan 22, 2008 6:00 PM

Former Member
0 Kudos

Hi,

Do like this

SELECT matnr matkl

FROM mara

INTO TABLE it_mara PACKAGE SIZE 50.

Regards,

Satish

0 Kudos

yeah that way ic an read the size in packages but is it possible to asign the starting point of read in the query. I mean if i want to read from 10000th record to 15000 then wher we will set the cursor directly to to 10000th record without know the material number.

0 Kudos

If you read data in packages of 5000, then the last record of the second packet will have the first record of the data that you want you want. The rest of the data will be in the third packet (less the last record). There is no way that I know of to go directly to the 10,000th record.

Rob