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 with Join

Former Member
0 Likes
1,227

Please tell me how i should correct this:

select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on atdid = btdid and

<b> a~NOT_EXT_VISIBLE = 'X' and</b>

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.

The error is:

You cannot compare with "'X'". Each comparison in the ON condition must contain a field from the RH table.

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
905

Hi,

where condition is missing.

select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on atdid = btdid where

a~NOT_EXT_VISIBLE = 'X' and

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.

reward if useful

regards,

ANJI

Message was edited by:

Anji Reddy Vangala

Read only

former_member632991
Active Contributor
0 Likes
905

Hi,

instead of on use where

select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on atdid = btdid

*<b>and</b>

<b>where</b>

a~NOT_EXT_VISIBLE = 'X' and

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.

Regards,

Sonika

Read only

Former Member
905

Hi..,

compare it in WHERE clause..

<b>select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on atdid = btdid

where NOT_EXT_VISIBLE = 'X' and

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.</b>

<u>** IN 'ON' clause u can compare onli the table fields which are included in JOIN..</u>

regards,

sai ramesh

Read only

0 Likes
905

hey kiret,

Please try

select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on ( atdid = btdid )

where a~NOT_EXT_VISIBLE = 'X' and

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.

you should not use and after the join condition, instead use the where condition.

Please reward points if the answer provides any help.

Regards,

Neha

Read only

Former Member
0 Likes
905

hi,

select atdid btdtext into corresponding fields of table i_text from scmgtextid as a

inner join ttxit as b on atdid = btdid <b>where</b> aNOT_EXT_VISIBLE = 'X' and btdobject = 'SCMG_CASE' and b~tdspras = sy-langu.

regards,

bharat.

Read only

Former Member
0 Likes
905

Hi Kiret,

When you use ON clause on Joins the the left hand and right hand fields should be of tables used in Join condition but not with variables/constant values.

Use the rest of the part in WHERE condition.

Check this code.

select atdid btdtext

into corresponding fields of table i_text

from scmgtextid as a

inner join ttxit as b

on atdid = btdid

<b>WHERE</b>

a~NOT_EXT_VISIBLE = 'X' and

b~tdobject = 'SCMG_CASE' and

b~tdspras = sy-langu.

Thanks,

Vinay