Skip to Content
0
Jan 04, 2019 at 05:22 PM

SAP B1 Warehouse with Lagerort Query

145 Views

Hello,

I have a Problem. If Lagerplatz (T3.[U_appBinLocation]) is null i want to take Lagerplatz from 01 Warehouse. I couldn't find it. Can you help me?

Thank you.

SELECT T0.[TaxDate], T0.[DocNum], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T3.[U_appBinLocation], T3.[OnHand], T1.[WhsCode]
FROM [dbo].[ORDR]  T0 
INNER JOIN [dbo].[RDR1]  T1 ON T0.[DocEntry] = T1.[DocEntry] 
INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode] 
INNER JOIN OITW T3 ON T2.[ItemCode] = T3.[ItemCode] 
WHERE T0.[TaxDate] >= [%0] AND T0.[TaxDate] <= [%1] AND T3.WhsCode = '02' AND T3.WhsCode NOT LIKE '%%RMA%%' AND T1.WhsCode NOT LIKE '%%01%%' AND T0.[GroupNum] = 4 
GROUP BY T0.[TaxDate], T0.[DocNum], T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T3.[U_appBinLocation], T3.[OnHand], T1.[WhsCode]

Attachments

example.png (92.7 kB)