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
438
select addrnumber name1 street str_suppl1 city1 region post_code1 country countrycode tel_number 
from adrc join t005t on adrc-country = t005t-land1 into table itab3 for all entries in itab1 where addrnumber = itab1-adrnr 
and t005t-spras = sy-langu.

Error is Field "ADRC-COUNTRY" unknown.

I know the field exists so not sure how to resolve this

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
415
select addrnumber name1 street str_suppl1 city1 region
         post_code1 country countrycode tel_number 
                from adrc 
                     inner join t005t
                          on adrc~country = t005t~land1      "<- Use ~
                                 into table itab3
                                         for all entries in itab1 
                                             where adrc~addrnumber = itab1-adrnr   "<- Use ~
                                                 and t005t~spras = sy-langu.     "<- Use ~

Assuming all of your field names are correct, you need to use the ~ when defining the join and referencing the fields in the WHERE clause, you only need to do this when working with joins.

Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
416
select addrnumber name1 street str_suppl1 city1 region
         post_code1 country countrycode tel_number 
                from adrc 
                     inner join t005t
                          on adrc~country = t005t~land1      "<- Use ~
                                 into table itab3
                                         for all entries in itab1 
                                             where adrc~addrnumber = itab1-adrnr   "<- Use ~
                                                 and t005t~spras = sy-langu.     "<- Use ~

Assuming all of your field names are correct, you need to use the ~ when defining the join and referencing the fields in the WHERE clause, you only need to do this when working with joins.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
415

Hi,

Please try this.


select addrnumber name1 street str_suppl1 city1 region post_code1 country countrycode tel_number 
from adrc inner join t005t on adrc~country = t005t~land1 
into table itab3 
for all entries in itab1 
where adrc~addrnumber = itab1-adrnr 
  and t005t~spras = sy-langu.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
415

Hi Megan,

As per mentioned above solutions

<b>instead of adrc-country = t005t-land1

mentioned adrccountry = t005tland.</b>

Then it wioll work.

Hope this helps you.

Regards,

Kumar.