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

select.........upto 1 rows syntax

Former Member
0 Likes
20,705

plz sent the syantax select..........upto 1 rows

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,476

select *

from mara

up to 1 rows

into w_mara.

endselect.

6 REPLIES 6
Read only

Former Member
0 Likes
8,477

select *

from mara

up to 1 rows

into w_mara.

endselect.

Read only

0 Likes
8,476

tables: mara.

select-options:

s_matnr for mara-matnr.

select *

from mara

up to 1 rows

into mara

where matnr in s_matnr.

endselect.

It's with where clause....

reward if helpful...

Read only

Former Member
0 Likes
8,476

Hi,

select * from kna1 up to 1 row where field1 = 'xxx' and field2 = 'yyyy'

* here you need to mention all the primary keys in the select to get the exact record

http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm

regards

Sudheer

Read only

Former Member
0 Likes
8,476

Hi,

SELECT..... FROM <dbtab> [CLIENT SPECIFIED] [BYPASSING BUFFER]

[UP TO <n> ROWS].........

ENDSELECT.

SELECT * FROM MARA INTO ITAB UP TO 20 ROWS WHEER ABC = BCD.

rgds,

prajith

Read only

former_member189631
Active Contributor
0 Likes
8,476

narenra,

Use this,

SELECT * FROM TABLE-NAME UP TO 1 ROWS INTO ITAB.

Regards,

Ramganesan K.

Read only

Former Member
0 Likes
8,476

Hi,

it will give the same result as select single *.

for select single * u need not write endselect.

the syntax for this is

select * from <db table> up to 1 rows.

endselect.

regards,

bharat chowdary.