CREATE VIEW "SBODEMODE"."B1_SnBReallocDocPathsView" ( "ApplyType", "ApplyEntry", "ApplyLine", "AppSubLine", "DocType", "DocEntry", "DocLine", "DocSubLine" ) AS ((((SELECT T1."BaseType" AS "ApplyType", T1."BaseEntry" AS "ApplyEntry", T1."BaseLine" AS "ApplyLine", -1 AS "AppSubLine", 16 AS "DocType", T0."DocEntry" AS "DocEntry", T0."LineNum" AS "DocLine", -1 AS "DocSubLine" FROM  "SBODEMODE"."RDN1" T0  INNER  JOIN "SBODEMODE"."DLN1" T1  ON  T0."BaseType" = 15  AND  T0."BaseEntry" = T1."DocEntry"  AND  T0."BaseLine" = T1."LineNum") UNION ALL (SELECT T1."BaseType" AS "ApplyType", T1."BaseEntry" AS "ApplyEntry", T1."BaseLine" AS "ApplyLine", -1 AS "AppSubLine", 14 AS "DocType", T0."DocEntry" AS "DocEntry", T0."LineNum" AS "DocLine", -1 AS "DocSubLine" FROM  "SBODEMODE"."RIN1" T0  INNER  JOIN "SBODEMODE"."INV1" T1  ON  T0."BaseType" = 13  AND  T0."BaseEntry" = T1."DocEntry"  AND  T0."BaseLine" = T1."LineNum"   INNER  JOIN "SBODEMODE"."OINV" T2  ON  T1."DocEntry" = T2."DocEntry"  AND  T2."isIns" = 'N')) UNION ALL (SELECT T3."BaseType" AS "ApplyType", T3."BaseEntry" AS "ApplyEntry", T3."BaseLine" AS "ApplyLine", -1 AS "AppSubLine", 14 AS "DocType", T0."DocEntry" AS "DocEntry", T0."LineNum" AS "DocLine", -1 AS "DocSubLine" FROM  "SBODEMODE"."RIN1" T0  INNER  JOIN "SBODEMODE"."INV1" T1  ON  T0."BaseType" = 13  AND  T0."BaseEntry" = T1."DocEntry"  AND  T0."BaseLine" = T1."LineNum"   INNER  JOIN "SBODEMODE"."OINV" T2  ON  T1."DocEntry" = T2."DocEntry"  AND  T2."isIns" = 'N'   INNER  JOIN "SBODEMODE"."DLN1" T3  ON  T1."BaseType" = 15  AND  T1."BaseEntry" = T3."DocEntry"  AND  T1."BaseLine" = T3."LineNum")) UNION ALL (SELECT T1."BaseType" AS "ApplyType", T1."BaseEntry" AS "ApplyEntry", T1."BaseLine" AS "ApplyLine", -1 AS "AppSubLine", 14 AS "DocType", T0."DocEntry" AS "DocEntry", T0."LineNum" AS "DocLine", -1 AS "DocSubLine" FROM  "SBODEMODE"."RIN1" T0  INNER  JOIN "SBODEMODE"."INV1" T1  ON  T0."BaseType" = 13  AND  T0."BaseEntry" = T1."DocEntry"  AND  T0."BaseLine" = T1."LineNum"  AND  T1."BaseType" = 17   INNER  JOIN "SBODEMODE"."OINV" T2  ON  T1."DocEntry" = T2."DocEntry"  AND  T2."isIns" = 'Y'   INNER  JOIN "SBODEMODE"."DLN1" T3  ON  T0."ActBaseEnt" = T3."DocEntry"  AND  T0."ActBaseLn" = T3."LineNum")) WITH READ ONLY