CREATE OR REPLACE FORCE VIEW "V_DT430_DT472" ("DATUM_KAL", "PR", "VG", "RESS",
   "KOA", "OE_RESS", "DATE_CREATION", "DATE_MODIFY", "RWDU", "USER_CREATION", 
   "USER_MODIFY", "OWNER_LICENSE", "OSC", "OWNER", "group", "any", "BEL_IST", 
   "POS", "ABR_DATUM", "SAP_STATE") AS 
  SELECT DATUM_KAL,
PR,
VG,
RESS,
KoA,
OE_RESS,
date_creation,
date_modify,
rwdu,
user_creation,
user_modify,
owner_license,
osc,
owner,
"group",
"any",
bel_ist_472   AS BEL_Ist,
cast(pos_472 as Number(10)) AS Pos,
abr_datum_472 AS ABR_DATUM,
cast(sap_state_472 AS Number(10)) as SAP_STATE
FROM
(SELECT DI000997 AS DATUM_KAL,
  DI001390       AS PR,
  DI001391       AS VG,
  DI001392       AS RESS,
  DI001393       AS KoA,
  DI009063       AS OE_RESS,
  DI001401       AS date_creation,
  DI001402       AS date_modify,
  DI001403       AS rwdu,
  DI001404       AS user_creation,
  DI001405       AS user_modify,
  DI001406       AS owner_license,
  DI000596       AS osc,
  DI001407       AS owner,
  DI001408       AS "group",
  DI001409       AS "any"
FROM DT430,
  DT466
WHERE DI000475 IN
  (SELECT DI003107 FROM dt452 WHERE di003109=150
  )
)
LEFT JOIN
(SELECT DI001519 DATUM_472,
  DI001395 PR_472,
  DI001516 VG_472,
  DI001517 RESS_472,
  SUM(DI001510) bel_ist_472,
  MAX(NVL(DI001400,0)) pos_472,
  MAX(NVL(SAP_STATE,0)) sap_state_472,
  MAX(DI002673) abr_datum_472
FROM DT472
GROUP BY DI001519,
  DI001395,
  DI001516,
  DI001517
)
ON DATUM_472 =DATUM_KAL
AND PR_472   =PR
AND VG_472   =VG
AND RESS_472 =RESS