CREATE VIEW "SBODEMODE"."B1_WAVGListOfTransactionsView" ( "MessageID", "ItemCode", "TransType", "DocEntry", "DocLineNum", "BaseType", "BaseAbsEnt", "BaseLine", "Quantity", "DocPrice", "Price", "PriceCurr", "TotalLC", "TotalFC", "TotalSC", "DocTotal", "Currency", "DocRate", "LocCode", "BPCardCode", "PrjCode", "AccumType", "ActionType", "System Date", "Effective Posting Date", "Posting Date", "DocNum", "isCrin", "ApplObj", "AppObjAbs", "AppObjLine", "ItmsGrpCod", "TaxOnly", "DiscPrcnt", "PriceRate" ) AS SELECT T0."MessageID", T0."ItemCode", T0."TransType", T0."DocEntry", T0."DocLineNum", T0."BaseType", T0."BaseAbsEnt", T0."BaseLine", T0."Quantity", T0."DocPrice", T0."Price", T0."PriceCurr", T0."TotalLC", T0."TotalFC", T0."TotalSC", T0."DocTotal", T0."Currency", T0."DocRate", T0."LocCode", T0."BPCardCode", T0."PrjCode", T0."AccumType", T0."ActionType", T0."CreateDate" AS "System Date", COALESCE(T1."DocDate", T0."DocDate") AS "Effective Posting Date", T0."DocDate" AS "Posting Date", T2."DocNum", T2."isCrin", T0."ApplObj", T0."AppObjAbs", T0."AppObjLine", T3."ItmsGrpCod", T4."TaxOnly", T2."DiscPrcnt", T0."PriceRate" FROM  "SBODEMODE"."OILM" T0   LEFT OUTER  JOIN "SBODEMODE"."B1_AllDocumentsView_VAWG" T1  ON  TO_CHAR(T0."BaseType") = T1."ObjType"  AND  T0."BaseAbsEnt" = T1."DocEntry"  AND  T0."DocDate" < T1."DocDate"  AND  T1."UseEffDate" = 1    LEFT OUTER  JOIN "SBODEMODE"."B1_AllDocumentsView_VAWG" T2  ON  TO_CHAR(T0."TransType") = T2."ObjType"  AND  T0."DocEntry" = T2."DocEntry"    LEFT OUTER  JOIN "SBODEMODE"."OITM" T3  ON  T0."ItemCode" = T3."ItemCode"    LEFT OUTER  JOIN "SBODEMODE"."B1_MarketingDocumentLinesView" T4  ON  TO_CHAR(T0."TransType") = T4."ObjType"  AND  T0."DocEntry" = T4."DocEntry"  AND  T0."DocLineNum" = T4."LineNum"   WHERE ((T0."TransType" <> (18 )  AND  T0."TransType" <> (19 ) ) OR  ((T0."TransType" = (18 )  OR  T0."TransType" = (19 ) ) AND  (T0."TransType" = (18 )  OR  (T0."TransType" = (19 )  AND  T0."ActionType" <> (6 )  AND  T0."ActionType" <> (11 ) )) AND  T0."AccumType" <> (3 ) )) AND  (T0."TransType" <> (13 )  OR  (T0."TransType" = (13 )  AND  T0."AccumType" <> (4 ) )) AND  (T0."TransType" <> (31 )  OR  (T0."TransType" = (31 )  AND  T0."ActionType" <> (3 )  AND  T0."ActionType" <> (12 ) )) AND  (T0."ActionType" <> (9 )  AND  T0."ActionType" <> (10 )  AND  T0."ActionType" <> (13 )  AND  T0."ActionType" <> (14 )  AND  T0."ActionType" <> (19 )  AND  T0."ActionType" <> (20 ) ) AND  (T0."TransType" <> (69 )  OR  T0."TransType" = (69 )  AND   EXISTS (SELECT U1."DocEntry" FROM  "SBODEMODE"."IPF1" U0  INNER  JOIN "SBODEMODE"."OIPF" U1  ON  U1."DocEntry" = U0."DocEntry"   WHERE U1."DocEntry" = T0."DocEntry"  AND  U0."StockEval" = ('Y' )  AND  U1."Canceled" = ('N' )  AND  U1."Instance" = (0 )  ) ) WITH READ ONLY