CREATE MATERIALIZED VIEW "V_ITEXT_Q2B" ("I_NR", "SPRACHCODE")
BUILD IMMEDIATE
USING INDEX 
REFRESH FORCE ON DEMAND
USING DEFAULT LOCAL ROLLBACK SEGMENT
USING ENFORCED CONSTRAINTS DISABLE QUERY REWRITE
AS SELECT di001538 I_NR,
di001550 SPRACHCODE
FROM dt435
INNER JOIN dt405
ON di001538     = di001588
OR di001538     = di001594
OR di001538     = di057816
WHERE DI000123 IN
( SELECT MOD_ID FROM V_MODULE_LIST_39_UEREL MU
)
UNION
SELECT di001538 I_NR,
di001550 SPRACHCODE
FROM dt435
INNER JOIN dt410
ON di001538 = di001589
OR di001538 = di029710
INNER JOIN dt406
ON dt406.di000969=dt410.di000198
WHERE DI000970  IN
( SELECT MOD_ID FROM V_MODULE_LIST_39_UEREL MU
)
UNION
SELECT di001538 I_NR,
di001550 SPRACHCODE
FROM dt435
INNER JOIN dt411
ON di001538 = di010200
OR di001538 = di040918
OR di001538 = di056920
INNER JOIN dt410
ON dt410.di000198=dt411.di000306
INNER JOIN dt406
ON dt406.di000969=dt410.di000198
WHERE DI000970  IN
( SELECT MOD_ID FROM V_MODULE_LIST_39_UEREL MU
)
UNION
SELECT di001538,
di001550 SPRACHCODE
FROM dt440
INNER JOIN dt412
ON di000364 = di000238
INNER JOIN dt435
ON di001538     = di001591
OR di001538     = di007566
WHERE di000286 IN
(SELECT di000238
FROM dt412
INNER JOIN dt411
ON dt411.di000213=dt412.di000238
INNER JOIN dt410
ON dt410.di000198=dt411.di000306
INNER JOIN dt406
ON dt406.di000969=dt410.di000198
WHERE DI000970  IN
  ( SELECT MOD_ID FROM V_MODULE_LIST_39_UEREL MU
  )
)
UNION
SELECT di001538 I_NR,
di001550 SPRACHCODE
FROM dt435
INNER JOIN dt412
ON di001538 = di001591
OR di001538 = di007566
INNER JOIN dt411
ON dt411.di000213=dt412.di000238
INNER JOIN dt410
ON dt410.di000198=dt411.di000306
INNER JOIN dt406
ON dt406.di000969=dt410.di000198
WHERE DI000970  IN
( SELECT MOD_ID FROM V_MODULE_LIST_39_UEREL MU
)
UNION
SELECT di001538 I_NR,
di001550 SPRACHCODE
FROM dt435
WHERE di023517 IN
(SELECT DISTINCT di000238
FROM dt412
INNER JOIN dt415
ON DI000265        =DI000239
WHERE di001700     ='15'
AND dt415.DI000266 = 'Q2B'
)
AND di023516 NOT IN ('405','410','411','412','440');/
