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

select * from kna1 into table itab FROM 30 ROWS up to 500 rows>>possible?

Hi all,

IS it possible to specify to select data from a specified number of records, for instance from row 30 to 500?

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 17, 2008 at 11:03 AM

    yes it's possible for this open ABAP editor and write SELECT and press F1 and look for select -cond and where log_exp.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 11:06 AM

    you can try like this...

    DATA : itab LIKE STANDARD TABLE OF ekpo WITH HEADER LINE.
    
    SELECT * INTO itab FROM ekpo.
      IF sy-dbcnt GE 30 AND sy-dbcnt LE 500.
        APPEND itab.
      ENDIF.
    ENDSELECT.
    
    

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In that case what i think can be done atmost is:

      SELECT * INTO itab FROM ekpo.

      IF sy-dbcnt GE 30 AND sy-dbcnt LE 500.

      APPEND itab.

      ENDIF.

      if sy-dbcnt eq 500.

      exit.

      endif.

      ENDSELECT.

      so it will stop after 500th record

      Reward points if useful, get back in case of query...

      Cheers!!!

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 11:08 AM

    Hi,

    YES. You can do that.

    You can limit the number of records by UP TO n ROWS addition also.

    Regards,

    Renjith Michael.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 11:15 AM

    I think you are not clear about your question? rows 30 to 500 means Sorted by key fields of the table, right? like the output which is displayed in se11?

    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.