Application Development and Automation 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: 
Read only

select top n

Former Member
0 Likes
20,740

Hello,

I was wondering if it was possible to limit the amount of lines selected from a table.

I tried select top n, as it works in SQL, but SAP doesn 't support this syntax..

Is this doesn't work, is there any other way to limit the amount of data selected ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
6,942

Hi,

Use select upto n rows

Select * from MARA into table ITAB UPTO 10 rows.

select top 10 rows in table.

Regards

SAB

Hello,

I was wondering if it was possible to limit the amount of lines selected from a table.

I tried select top n, as it works in SQL, but SAP doesn 't support this syntax..

Is this doesn't work, is there any other way to limit the amount of data selected ?

4 REPLIES 4
Read only

suresh_datti
Active Contributor
0 Likes
6,942

use the SELECT UP to n ROWS option.

~Suresh

Read only

Former Member
0 Likes
6,943

Hi,

Use select upto n rows

Select * from MARA into table ITAB UPTO 10 rows.

select top 10 rows in table.

Regards

SAB

Read only

Former Member
0 Likes
6,942

Hi everyone,

thanks for the answers. It is noted in my documentation.

points awarded !

Read only

0 Likes
6,942

I have a similiar question: is there some keyword equivalent to the SQL LIMIT keyword?

I need to retrieve an arbitrary range of rows (rows from row no. a to row no. b, a <b ) to implement result set paging.