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

Why the select doesn't run?

Former Member
0 Likes
2,704

Hi

I have the following select in a function containing in a function group.

SELECT SINGLE makt-maktx FROM makt WHERE makt-matnr = matnum.

I have declare in the topinclude Tables: makt but I still get the syntax message:

Unknown column name "MAKT-MAKTX". not determined until runtime, you cannot specify a field list.

Can anybody help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,861

hi,

do this way ..

SELECT SINGLE maktx FROM makt into makt-maktx WHERE matnr = matnum.

9 REPLIES 9
Read only

Former Member
0 Likes
1,862

hi,

do this way ..

SELECT SINGLE maktx FROM makt into makt-maktx WHERE matnr = matnum.

Read only

0 Likes
1,861

Thanks it helped but why do I need an "INTO" I just wanted to select and than with an Write makt-makty display it on the screen

Read only

0 Likes
1,861

u have to populate into work area( that u define) or header of your table to display.

if u do not want to write into, write:

SELECT SINGLE *

FROM makt

WHERE matnr = matnum.

regards,

madhumitha

Read only

0 Likes
1,861

you need some work are to store the value to display it

Read only

0 Likes
1,861

Hi Vahed,

Since you are selecting only single field MAKTX from MAKT table. So the value has to be placed into a variable. So is why we are using into statement. But if you want to select a record with all the fields then ...do this way ..



SELECT SINGLE * FROM makt into makt WHERE matnr = matnum. 

Regards,

Santosh

Read only

0 Likes
1,861

hi check this...

tables: makt .

data: begin of itab1 occurs 0,

matnr like mara-matnr,

maktx like makt-maktx,

end of itab1 .

select-options:s_matnr for makt-matnr.

select single matnr maktx from makt

into itab1

where matnr in s_matnr .

append itab1 .

loop at itab1 .

write:/ itab1-matnr,

itab1-maktx.

endloop.

regards,

venkat.

Read only

Former Member
0 Likes
1,861

Hi,

Try this way :

SELECT SINGLE maktx FROM makt WHERE matnr = matnum.

Regards,

Nicolas

Read only

Former Member
0 Likes
1,861

hye vahed,

It is not advisable using Tables statement. It is obselete now.

Follow the below sequence.

data: wa type makt.

SELECT SINGLE wa-maktx FROM makt WHERE makt-matnr = matnum.

...

Hope this helps, reward if helpful.

Thanks,

Imran.

Read only

0 Likes
1,861

sorry,

I have written the above postly wrongly.

data: wa type makt.

SELECT SINGLE maktx

into wa-maktx

FROM makt

WHERE makt-matnr = matnum.

Thanks,

Imran.