CREATE VIEW "SBODEMODE"."B1_FolioNumbersView" ( "FolSeries", "FolNumFrom", "FolNumTo", "ObjType", "DocEntry", "DocNum", "DocDate", "DocSubType", "PTICode", "Letter", "CANCELED" ) AS (((((((((((SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."OINV" T0) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."ORIN" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."ODLN" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."ORDN" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."OWTR" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."OPCH" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."ORPC" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."OPDN" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", T0."DocSubType", T0."PTICode", T0."Letter", T0."CANCELED" FROM  "SBODEMODE"."ORPD" T0)) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", '--' AS "DocSubType", T0."PTICode", T0."Letter", 'N' AS "CANCELED" FROM  "SBODEMODE"."OFTR" T0  WHERE T0."DocStatus" <> ('C' ))) UNION ALL (SELECT T0."FolSeries", T0."FolNumFrom", T0."FolNumTo", T0."ObjType", T0."DocEntry", T0."DocNum", T0."DocDate", '--' AS "DocSubType", T0."PTICode", T0."Letter", 'Y' AS "CANCELED" FROM  "SBODEMODE"."OFTR" T0  WHERE T0."DocStatus" = ('C' ))) WITH READ ONLY