Problem in select query.
Hi ABAP gurus,
What is the problem with this query.
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 .
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?
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.