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

Entries from database table

Former Member
0 Likes
523

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.

3 REPLIES 3
Read only

Former Member
0 Likes
504

Hi Praveena,

Can you try

SELECT * from DBtable....

<b>if sy-subrc = 0.

exit.

endif.

ENDSELECT.</b>

Reward points if useful.

Regards,

Atish

Read only

Former Member
0 Likes
504

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.

Read only

Former Member
0 Likes
504

Hello Praveena,

Try this method.

Select * from dbtable into wa_tab.

if sy-subrc = 0.

exit.

endif.

endselect.

Rgds,

Naren