‎2008 May 20 9:22 AM
Hi,
Can anybody tell me why this SELECT doesn't run
Thanks
SELECT cuobj stdpd maabc
INTO marc-cuobj
marc-stdpd
marc-maabc
FROM MARC
UP TO 1 ROWS
WHERE matnr = P_MATNR.
ENDSELECT.
‎2008 May 20 9:26 AM
hi,
correct:
...
INTO (marc-cuobj,
marc-stdpd,
marc-maabc)
...
hope this helps
ec
‎2008 May 20 9:26 AM
hi,
correct:
...
INTO (marc-cuobj,
marc-stdpd,
marc-maabc)
...
hope this helps
ec
‎2008 May 20 9:27 AM
Hi Vahed,
check with this.
SELECT cuobj stdpd maabc
INTO (marc-cuobj, marc-stdpd, marc-maabc)
FROM MARC
UP TO 1 ROWS
WHERE matnr = P_MATNR.
ENDSELECT.
Also did u defined marc in tables???
TABLES: marc.
if not then u have define or u have to take local variables.
I Sugest to use select single.
Thanks,
Vinod.
Edited by: Vinod Kumar Vemuru on May 20, 2008 1:58 PM
‎2008 May 20 9:33 AM
Hi Why select single, as long as I know select up to 1 row is faster.
/Kamran
‎2008 May 20 9:38 AM
Hi Vahed,
I do agree that select up to 1 rows is faster. But only disadvantage is it will hit the data base twise. But with select single it will be once. So i feel its better not to create more network trafic for the sake of fastness of our report. What ever performance u gained in getting data will be lost in hitting the database twice.
thanks,
Vinod.
‎2008 May 20 9:27 AM
SELECT cuobj stdpd maabc
INTO (marc-cuobj,
marc-stdpd,
marc-maabc)
FROM MARC
UP TO 1 ROWS
WHERE matnr = P_MATNR.
ENDSELECT.
You are missing brackets.
‎2008 May 20 9:28 AM
Hi,
Create one internal table and put ur fields i.e. marc-cuobj marc-stdpd marc-maabc into that internal table.
Then select the fields into an internal tabel.
or u have to create the local variable and put the corresponding fields into that.
SELECT cuobj stdpd maabc
INTO ( lv_cuobj , lv_stdpd , lv_maabc)
FROM MARC
UP TO 1 ROWS
WHERE matnr = P_MATNR.
ENDSELECT.
‎2008 May 20 9:31 AM
Hi,
You r extracting data from Standard DDIC table MARC to Internal table MARC.
How can it b possible? Program will show error "redefining the table". So change the internal table name and the program will run fine.....
reward if useful.
Thanks.
‎2008 May 20 9:35 AM
‎2008 May 20 4:27 PM
there is no internal table at all. I fetch the data in a memory and it works properly.
Thanks