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: 

How to select first several records from a database table by using select?

former_member207732
Participant
0 Kudos

Hi,

I want to select first 100 records from a database table by using select clause. How to write it?

Thanks a lot!

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
select *
       from mara
       up to 100 rows     
       into table itab.

try this ..

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos
select *
       from mara
       up to 100 rows     
       into table itab.

try this ..

Former Member
0 Kudos

hai long!

well select statement is used to retrive

records from the database.

following is the syntax to be used.

1) select * into corresponding fields of itab from basetable where condition.

endselect.

ex: select * into corresponding fields of itab from mara

where matnr >= '1' and matnr <= '100'.

append itab.

endselect.

select * is a loop statement.it will execute till matnr is less than or equal to 100.

note: you can also mention the required field names in the select statement otherwise it will select all the field from table mara.

note: itab means your internal table name.

hope you got the required thing.if it really solved u r problem then award me the suitable points.<b></b>