‎2008 May 20 8:38 AM
Hi all
I have a report as mentioned below.But i want to select only the first 2 record from the table without using control-break statments.Please help.
Vijay
‎2008 May 20 9:47 AM
In a relational database no "first" record exists. first second last is only relevant if you do a sorting. Just using package size or up to n rows is not sufficient, you need a sort to tell if you need the two actual values (sorting by date) or whatever. Without having a sort in the select clause you can not assure what values are the first ones.
‎2008 May 20 8:41 AM
Hi,
Use PACKAGE SIZE.
SELECT *
INTO TABLE (internal table)
FROM (Standard table)
PACKAGE SIZE 2
WHERE (Condition).
ENDSELECT.Regards
Kannaiah
‎2008 May 20 8:45 AM
‎2008 May 20 9:33 AM
Hi,
Use like this
select * from mara into it_mara
up to 1 rows
where matnr = '000000000100000174'.
append it_mara.
endselect.
If its useful reward points
‎2008 May 20 9:47 AM
In a relational database no "first" record exists. first second last is only relevant if you do a sorting. Just using package size or up to n rows is not sufficient, you need a sort to tell if you need the two actual values (sorting by date) or whatever. Without having a sort in the select clause you can not assure what values are the first ones.