‎2007 Sep 20 8:54 AM
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.
‎2007 Sep 20 8:56 AM
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
‎2007 Sep 20 8:58 AM
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
‎2007 Sep 20 8:59 AM
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.
‎2007 Sep 20 9:20 AM
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
‎2007 Sep 20 9:26 AM
select * from mara
where spart = 'PA'
and not ( zatacd = space )
order by matnr.
Regards
vasu
‎2007 Sep 20 9:27 AM
hai,
u should write query like this .
table ebeln.
select single * from ekpo where ebeln = ponumber.
try this it will work.
‎2007 Sep 20 9:28 AM
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