Hi Everybody,
I've a problem building a query in Sap BO:
I'm trying to check if date of delivery in each row of the Sales order has been respected looking at the delivery date in delivery.
This is the query I built:
SELECT T0.DocNum, T0.U_CAUS, T1.ItemCode,T1.ShipDate, T2.ShipDate, CASE WHEN (T2.ShipDate <> T1.ShipDate) THEN 'DIFFERENT' ELSE ' ' END as 'SCOSTAMENTO' FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN RDR1 T2 ON T1.DocEntry = T2.TrgetEntry INNER JOIN ORDR T3 ON T2.DocEntry = T3.DocEntry WHERE T0.DocDate > '01/01/08' AND T1.ShipDate IS NOT NULL GROUP BY T0.DocNum, T0.U_CAUS, T1.ItemCode,T1.ShipDate, T2.ShipDate, CASE WHEN (T2.ShipDate <> T1.ShipDate) THEN 'DIVERSO' ELSE ' ' END
Problem is that, in sales order, where I've more than one delivery date for different codes, SAP gives me multiple results.
I thought to concatenate T1.DocEntry with T1.ItemCode and T2.TrgetEntry with T2.ItemCode and then link them with LEFT OUTER JOIN. Do you think is good? If so, can you help me with the sintiax of this function? Is ther a better way?
Thanks in advance
Edited by: Philip Eller on May 13, 2008 8:48 AM
Edited by: Philip Eller on May 27, 2008 11:32 AM*