Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2009 at 06:38 AM

    Use Cursors with Packing Size

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2009 at 06:40 AM

    Hi Amit,

    Try this.

    SELECT * INTO table ITAB

    FROM EKKO

    WHERE EBLEN IN S_EBLEN.

    UP TO 1000 ROWS.

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2009 at 06:42 AM

    Hi,

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

    Regards,

    Raj Gupta

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 06, 2009 at 07:51 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 06, 2009 at 08:24 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 04, 2009 at 02:54 AM

    answered

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.