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: 

Regarding Select query to select only 1000 records in Internal Table.

Former Member
0 Kudos

Hello Friends,

Please explain me to how to Select only 1000 records from data base table?

For Example

SELECT * INTO TABLE ITAB OR SELECT * INTO ITAB

FROM EKKO FROM EKKO

WHERE EBLEN IN S_EBLEN. WHERE EBLEN IN S_EBLEN

(Currently i am using) UP TO 1000 ROWS.

ENDSELECT. (I do not want to use)

In this case Internal table may be store more then 1000 records. But i want to select first 1000 records.

Please explain me.

Regards

Amit

6 REPLIES 6

Former Member
0 Kudos

Use Cursors with Packing Size

Former Member
0 Kudos

Hi Amit,

Try this.

SELECT * INTO table ITAB

FROM EKKO

WHERE EBLEN IN S_EBLEN.

UP TO 1000 ROWS.

Regards,

Vijay

Former Member
0 Kudos

Hi,

use OPEN CURSOR and CLOSE CURSOR logic and give package size as 1000.

Regards,

Raj Gupta

sridhar_meesala
Active Contributor
0 Kudos

Hi,

TABLES : ekko.

selection-screen begin of block b1 with frame title text_t01.
SELECT-OPTIONS: S_EBELN for ekko-EBELN.
selection-screen end of block b1.

DATA itab TYPE STANDARD TABLE OF ekko.

SELECT *
  FROM ekko
  INTO TABLE itab
  UP TO 1000 ROWS
  WHERE EBELN IN S_EBELN.

Thanks,

Sri.

Former Member
0 Kudos

SELECT * INTO TABLE ITAB OR SELECT * INTO ITAB

FROM EKKO FROM EKKO

WHERE EBLEN IN S_EBLEN. WHERE EBLEN IN S_EBLEN

UP TO 1000 ROWS.

EXIT.

ENDSELECT.

Put in the EXIT statement and you'll get your first 1000 records only.

Former Member
0 Kudos

answered