1 2 3 4 5 6 7 8 9 10 11 12 13 14
| SELECT REPLACE(LTRIM(REPLACE(INVENTORY.MATNR, 0, ' ')), ' ', 0) AS MATNR, INVENTORY.WERKS, INVENTORY.LGORT, INVENTORY.CHARG, INVENTORY.SOBKZ, REPLACE(LTRIM(REPLACE(INVENTORY.KUNNR, 0,
' ')), ' ', 0) AS KUNNR, REPLACE(LTRIM(REPLACE(INVENTORY.LIFNR, 0, ' ')), ' ', 0) AS LIFNR, INVENTORY.VBELN, INVENTORY.POSNR, INVENTORY.LABST, INVENTORY.UMLME, INVENTORY.INSME,
INVENTORY.EINME, INVENTORY.SPEME, INVENTORY.RETME, INVENTORY.DLINL, INVENTORY.LGBPE, INVENTORY.KZILL, INVENTORY.KZILQ, INVENTORY.KZILE, INVENTORY.KZILS, INVENTORY.DISKZ,
INVENTORY.[MBEW-VPRSV], INVENTORY.[MBEW-BKLAS], INVENTORY.[MBEW-LAEPR], INVENTORY.[MBEW-BWTTY], INVENTORY.PRICE, INVENTORY.[MBEW-BWTAR], INVENTORY.Total_Value,
INVENTORY.GUID, INVENTORY.Stock_Price, INVENTORY.Stock_Value, INVENTORY.Sum, MATERIAL.FRdes, MATERIAL.ENdes, MATERIAL.DEdes, MATERIAL.ITdes, MATERIAL.ESdes, MATERIAL.PTdes,
MATERIAL.NLdes, MATERIAL.MTART, MATERIAL.MATKL, Material_Detail.EKGRP, Material_Detail.DISPO
FROM INVENTORY
LEFT OUTER JOIN
Material_Detail ON INVENTORY.MATNR = Material_Detail.MATNR AND INVENTORY.WERKS = Material_Detail.WERKS INNER JOIN
Material ON MATERIAL.MATNR = INVENTORY.MATNR
WHERE /*(INVENTORY.WERKS IN (@werks)) AND (ISNULL(INVENTORY.LGORT, 'NULL') IN (@lgort)) AND (REPLACE(LTRIM(REPLACE(INVENTORY.MATNR, 0, ' ')), ' ', 0) = @MATNR) AND (INVENTORY.DATE = @date1) AND
(ISNULL(INVENTORY.SOBKZ, 'NULL') IN (@sobkz)) AND (ISNULL(INVENTORY.DLINL, '2000-01-01') < ISNULL(@date_inventaire, GETDATE())) OR
(INVENTORY.WERKS IN (@werks)) AND (ISNULL(INVENTORY.LGORT, 'NULL') IN (@lgort)) AND*/ (INVENTORY.DATE = '2016-06-27')/* AND (ISNULL(INVENTORY.SOBKZ, 'NULL') IN (@sobkz)) AND
(ISNULL(INVENTORY.DLINL, '2000-01-01') < ISNULL(@date_inventaire, GETDATE())) AND (@MATNR IS NULL)*/ |
Partager