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: 

Retrieving the records

Former Member
0 Kudos

Hi,

Plz let me know How to retrieve the first 5 records of cutomer master from the database

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Use select .. Upto 5 Rows

or

Select all the data into an ITAB

select * from KNA1 into table ITAB.

sort ITAB by KUnnr.

then move the first 5 Records into another ITAB1.

then use that ITAB1 for your use.

Reward points for useful Answers

Regards

Anji

5 REPLIES 5

Former Member
0 Kudos

Hi

Use select .. Upto 5 Rows

or

Select all the data into an ITAB

select * from KNA1 into table ITAB.

sort ITAB by KUnnr.

then move the first 5 Records into another ITAB1.

then use that ITAB1 for your use.

Reward points for useful Answers

Regards

Anji

Former Member
0 Kudos

Hi,

Use,

select upto 5 rows

Reward if useful!

Former Member
0 Kudos

REPORT ZGS_TEST1 .

data : it_kna1 like kna1 occurs 0 with header line.

select * from kna1 into table it_kna1 up to 5 rows.

Reward points to get 1 point yourself,

Aleem.

Former Member
0 Kudos

select *

from kna1

into table IATB

up to 5 rows.

Regards.

Omkar.

Former Member
0 Kudos

If you need only first five records,then use select upto 5 rows.

If you want the five records on the sorting order of any field,select all the records in to internaltable ,sort that internal table on the basis ofthat field then move first 5 records in to another internal table.

reward if useful.

sastry.