‎2008 Nov 17 9:02 AM
hi experts,
select single matnr netpr into table it_ekpo from ekpo where matnr = '1234' .
its coming error can u correct me.
‎2008 Nov 17 9:04 AM
‎2008 Nov 17 9:04 AM
Hi,
Do not use Select Single it you want a set of records, just use Select matnr etc into table ....
Select single statment will give u one record (workarea) and not table.
Best Regards.
‎2008 Nov 17 9:07 AM
Dear Ravi
you have selected only single field i'e matnr , but in target you have mentioned it_ekpo that is your internal table...
you have to specify the field ..
you can either declare a variable or pass toit_ekpo-matnr field..
select single matnr into it_ekpo-matnr like this..
‎2008 Nov 17 9:09 AM
hi ravi,
u cant use select single for retreiving multiple records, here is the code below
types: begin of ty_material,
matnr like mara-matnr,
matkl like mara-matkl,
end of ty_material.
data: wa_material type ty_material.
select single matnr matkl from mara into wa_material where matnr = '1234'.
try the above code.
‎2008 Nov 17 9:12 AM
Hi Ravi,
The number of fields you are selecting should be equal to the number of fields in your internal table into which you are selecting the data or else you can also use INTO CORRESSPONDING FIELDS OF table ITAB.
For more details on Select Single.
[http://www.sap-img.com/abap/difference-between-select-single-and-select-upto-one-rows.htm]
To see performance tuning for select statement.
[Select Statement|http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm]
Regards,
Amit.
‎2008 Nov 17 9:14 AM
Hi
Please use as follows and revert back if it works fine.
select single *
into table it_ekpo
from ekpo
where matnr = '1234' .
Please revert
Regards
Winnie
‎2008 Nov 17 9:19 AM
Hi Ravi,
for Select single statment into table is not required that is main problem for your error
remove that table option then it works fine
select single matnr netpr
into it_ekpo
from ekpo
where matnr = '1234' .
‎2008 Nov 17 9:28 AM
hi
use the following code it will solve ur problem
data : wa_ekpo like line of it_ekpo.
select single matnr netpr into corresponding fileds of wa_ekpo from ekpo where matnr = '1234' .
‎2008 Nov 17 9:32 AM
If any of the above solutions is not working, then let us know what is the error you are getting along with your code to declare the internal table.
‎2008 Nov 17 9:56 AM
Hi,
When we use single keyword in select statement..we can not use table keyword in it.
It will give you an error.
Try it like this.
select single matnr netpr
into it_ekpo
from ekpo where matnr = '1234' .
Revert back in case of any query.
Thanks
Rajesh Kumar