Skip to Content

SELECT IN SELECT CODE WITH INNER JOIN

hi expert,

i need to get output of (plant, plant name, material, sku, description, descriptiob, loc, stock qty, avg cost, last recv.

please correct my code, because i can't get all the column with this code:

SELECT A~WERKS
C~NAME1
A~MATNR
E~BISMT
B~MAKTX
A~LGORT
SUM( CLABS ) AS SUM_CLABS
INTO TABLE T_COMB
(SELECT CASE WHEN LBKUM = 0 THEN 0 ELSE ROUND(((SALK3 * 100) / LBKUM),0)
FROM MBEW
WHERE BWKEY = A~WERKS
AND MATNR = A~MATNR) AS AVGCOST
(SELECT MAX( BUDAT_MKPF ) AS BUDAT_MKPF
FROM MSEG AS D
WHERE D~WERKS = A~WERKS
AND D~MATNR = A~MATNR
AND BWART = '101') LAST_RECV
FROM MCHB AS A
INNER JOIN MAKT AS B
ON A~MATNR = B~MATNR
INNER JOIN T001W AS C
ON A~WERKS = C~WERKS
INNER JOIN MARA AS E
ON A~MATNR = E~MATNR
WHERE A~WERKS IN ('2297','21B7')
AND LGORT = 'WR02'
AND MTART NOT IN ('ZNS','ZNV','ZSR')
GROUP BY A~WERKS C~NAME1 A~MATNR E~BISMT B~MAKTX A~LGORT
ORDER BY A~WERKS A~MATNR

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.