‎2007 Jun 19 2:47 AM
Hi all,
I need to fetch the first record from a data base table. I don't have any primary keys. Infact without using any primary keys i just need to select the first records from the table.
I have used select single and select up to 1 rows (I should not use order by primary), some times it gives me the correct result and sometimes not.
Can you tell me any other way to do it.
Thanks.
Mungala.
‎2007 Jun 19 2:51 AM
Hi Praveena,
Can you try
SELECT * from DBtable....
<b>if sy-subrc = 0.
exit.
endif.
ENDSELECT.</b>
Reward points if useful.
Regards,
Atish
‎2007 Jun 19 2:59 AM
DATA WA_SFLIGHT like SFLIGHT occurs 0 with header line.
SELECT * FROM SFLIGHT INTO table WA_SFLIGHT up to 1 rows
ORDER BY planetype DESCENDING.
‎2007 Jun 19 3:20 AM
Hello Praveena,
Try this method.
Select * from dbtable into wa_tab.
if sy-subrc = 0.
exit.
endif.
endselect.
Rgds,
Naren