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 syntax error

Former Member
0 Likes
1,086

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.

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,059

hi,

correct:

...

INTO (marc-cuobj,

marc-stdpd,

marc-maabc)

...

hope this helps

ec

9 REPLIES 9
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,060

hi,

correct:

...

INTO (marc-cuobj,

marc-stdpd,

marc-maabc)

...

hope this helps

ec

Read only

vinod_vemuru2
Active Contributor
0 Likes
1,059

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

Read only

0 Likes
1,059

Hi Why select single, as long as I know select up to 1 row is faster.

/Kamran

Read only

0 Likes
1,059

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.

Read only

Former Member
0 Likes
1,059

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.

Read only

Former Member
0 Likes
1,059

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.

Read only

Former Member
0 Likes
1,059

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.

Read only

0 Likes
1,059

sorry.....required to b in brackets....it will run...

Read only

0 Likes
1,059

there is no internal table at all. I fetch the data in a memory and it works properly.

Thanks