on 2024 Apr 04 2:05 PM
Dear Community Members,
I am trying to produce MRP Data by using following query. However, the output shows all same values. Can you please tell me what is wrong with the query, if anything wrong with the joins? Also I need to calculate Supply and Demand. How should I do this?
SELECT
T0.[StartDate],
T0.[EndDate],
T0.[MsnCode],
T0.[Descr],
T1.[ItemCode],
T2.[ItemName],
T1.[DueDate],
T1.[OrderType],
SUM(T1.[Quantity]) as Quantity_ORCM,
SUM(T4.[Quantity]) AS Quantity_MSN,
SUM(T1.[Price]) AS Price,
SUM(T3.[Initial]) AS Initial,
SUM(T3.[InStock]) AS InStock,
SUM(T3.[OutStock]) AS OutStock,
SUM(T3.[Final]) AS Final,
T1.[Warehouse]
FROM
OMSN T0
LEFT JOIN
ORCM T1 ON T0.[AbsEntry] = T1.[ObjAbs]
LEFT JOIN
MSN2 T3 ON T3.[AbsEntry] = T0.[AbsEntry]
LEFT JOIN
MSN3 T4 ON T4.[AbsEntry] = T0.[AbsEntry]
LEFT JOIN
OITM T2 ON T1.[ItemCode] = T2.[ItemCode]
WHERE
T0.[Descr] = 'Bernhard'
AND T0.[MsnCode] = 'Planung'
AND T1.[ItemCode] = '48.4310.1399'
AND T0.[HldaysPurc] = 'Y'
AND T0.[GrpPeriods] = 'M'
GROUP BY
T1.[ItemCode],
T2.[ItemName],
T0.[StartDate],
T0.[EndDate],
T0.[MsnCode],
T0.[Descr],
T1.[DueDate],
T1.[OrderType],
T1.[Warehouse]
Request clarification before answering.
| User | Count |
|---|---|
| 35 | |
| 18 | |
| 14 | |
| 13 | |
| 9 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.