Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem in select query.

Hi ABAP gurus,

What is the problem with this query.

SELECT A~MATNR

A~MTART

B~werks

c~lgort

c~labst

INTO CORRESPONDING FIELDS OF IT_MAT

FROM mara AS A

left outer JOIN marc AS B ON aMATNR = BMATNR

left outer join mard as c on bmatnr = cmatnr and cwerks = bwerks

WHERE a~MATNR IN S_MATNR .

ENDSELECT.

It is giving me an error saying that table can be joined with max of one other table using left outer join

My requirement involves joining of these three tables this way to pick all those material numbers

which are in the material range s_matnr and have all werks related from marc and all storage locations

related to werks.

How to do it?

Nik

Tags:
replied

Hi Nik,

Left outer join does not work on three tables like this.

But You can write left outer join as follows....

mara left outer join marc on mara-matnr = marc-matnr

mara left outer join mard on mara-matnr = mard-matnr

or what best you can do is to make use of views.

Try doing it with above mentioned.

Regards,

suruchi

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question