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

how to select specific number of rows from database table

I want to select particular number of rows , say for example I want to select top 500 rows from table without any conditions or filter...

Is it possible in SAP select query ??

In oracle we have the option of selecting TOP 'n' rows from a database table..

Do we have such option in SAP? can we select certain number of rows alone from a table???

any help wud greatly be appreicated !!!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Nov 23, 2007 at 01:18 PM

    Hi,

    Yes, it is ppossible.

    You can use SELECT statement with UP TO 500 ROWS.

    SELECT <field> 
    INTO TABLE <internal table> 
    FROM <table> 
    UP TO 500 ROWS. 
    

    Regards,

    Ferry Lianto

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ramya,

      Do in this way

          SELECT matnr FROM marc INTO TABLE xmarc
            PACKAGE SIZE 5000 UP TO p_count ROWS
              WHERE matnr IN s_matnr.
            PERFORM process_package.
          ENDSELECT.

      <b>Reward Points for helpful answers</b>

      Regards,

      Satish

  • Posted on Nov 23, 2007 at 01:46 PM

    Hi,

    Yes, it is possible.

    You can use SELECT statement with PACKAGE SIZE as Satish suggested earlier.

    Regards,

    Ferry Lianto

    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.