Application Development 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: 

Problem with LEFT OUTER JOIN

Former Member
0 Kudos

Hi,

I am trying run the following query -

SELECT RSECTAB~MANDT into (RSECTABMANDT)

FROM RSECTAB LEFT OUTER JOIN RSPSP ON RSECTABMANDT = RSPSPMANDT LEFT OUTER JOIN RSADD ON RSPSPMANDT = RSADDMANDT.

I get this -

Error

ABAP Query failed to execute with the following error Unable to compare with "RSPSP~MANDT". A table can be joined with a maximum of one other table using LEFT OUTER JOIN..

What does this error mean?

Thanks,

Sheetal

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi, you can change original code like following:

SELECT RSECTAB~MANDT into (RSECTABMANDT)

FROM <b>RSPSP</b>

LEFT OUTER JOIN <b>RSECTAB</b> ON RSECTABMANDT = RSPSPMANDT

LEFT OUTER JOIN RSADD ON RSPSPMANDT = RSADDMANDT.

the left outer join can only from same table, E.G.

left outer join B to A

left outer join C to A

but can't

left outer join A to B

left outer join B to C

Only the inner join can do like above.

And another point is (RSECTABMANDT), what's it means? a workarea? if it is a workarea, you forget a SINGLE before RSECTAB~MANDT.

Hope it will be helpful

Thanks a lot

4 REPLIES 4

Former Member
0 Kudos

That you cannot have more than two tables in this select statement with outer join Try with two tables and see if you get this error.

Former Member
0 Kudos

You can not join the tables with "mandt" field.mandt field tells about the client number.

you have to use another field (Index or key) in the tables for join.

Yad

0 Kudos

correction in the above statement:

mandt field is not a client number, but you can not join with that fields.

Thanks,

Yad

Former Member
0 Kudos

Hi, you can change original code like following:

SELECT RSECTAB~MANDT into (RSECTABMANDT)

FROM <b>RSPSP</b>

LEFT OUTER JOIN <b>RSECTAB</b> ON RSECTABMANDT = RSPSPMANDT

LEFT OUTER JOIN RSADD ON RSPSPMANDT = RSADDMANDT.

the left outer join can only from same table, E.G.

left outer join B to A

left outer join C to A

but can't

left outer join A to B

left outer join B to C

Only the inner join can do like above.

And another point is (RSECTABMANDT), what's it means? a workarea? if it is a workarea, you forget a SINGLE before RSECTAB~MANDT.

Hope it will be helpful

Thanks a lot