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 statement

Former Member
0 Likes
1,240

can we write a select statement without an Into clause.

like

select ebeln from ekpo where ebeln = ponumber.

here i do not want to place the selected data to any variable or any internal table.

ca anyone help me in this.

7 REPLIES 7
Read only

former_member404244
Active Contributor
0 Likes
1,073

Hi,

yes u can do it by specify tables statement.

try like this

tables : ekpo.

parameters :p_ebeln like ekpo-ebeln.

select * from ekpo where ebeln = p_ebeln.

endselect.

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,073

without into clause you can write the select clause but you need to declare table work area for that...

tables : ekpo.

select * from ekpo where ebeln = ponumber.

if sy-subrc = 0.

endif.

and here only * (i.e. all fields) is allowed not the individual field name.

regards

shiba dutta

Read only

former_member189059
Active Contributor
0 Likes
1,073

i tried typing that and doing a syntax check and i got this error message

i have no idea why the word 'allowed' appears so many times

Field list without INTO clause is not allowed . allowed. . allowed. .	
allowed. . allowed. allowed. allowed. allowed. allowed.

Read only

Former Member
0 Likes
1,073

Hi Camila,

If your are selecting all the fields then you can write the query without into clause. But when you are select particular field you have to use the into clause.

For eg.

(1)

Tables : EKPO.

SELECT * from EKPO where ebeln = ponumber.

(2).

DATA : L_EBELN TYPE EKPO-EBELN.

SELECT ebeln from ekpo INTO L_EBELNwhere ebeln = ponumber.

Revert back for futher clarifications.

Reward if useful.

Thanks,

Mandeep

mandipsindhu@rediffmail.com

Read only

0 Likes
1,073

select * from mara

where spart = 'PA'

and not ( zatacd = space )

order by matnr.

Regards

vasu

Read only

Former Member
0 Likes
1,073

hai,

u should write query like this .

table ebeln.

select single * from ekpo where ebeln = ponumber.

try this it will work.

Read only

Former Member
0 Likes
1,073

hi

well this statwement which u have written is perfect actually

before this statement we define TABLES statement

like e.g.

tables EKPO .

what it does is create a work area like table EKPO which allow us to transfer data from EKPO into workarea EKPO directly w/o writing any into clause in the select querry...

thnks

Sahil