DROP VIEW LD0V3T41
;
CREATE VIEW LD0V3T41
AS SELECT * FROM LD0P0T41 T41
WHERE EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 21)
   OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 22)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 23)
   OR EXISTS (SELECT 'X' FROM LD0V0H H 
		WHERE H.AKTUALNR = T41.AGARNR AND
		      T41.AGARTYP = 20)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
   		WHERE L.RESURSNR = T41.AGARNR AND
		      T41.AGARTYP = 38)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
		WHERE L.UPPDRNR = T41.AGARNR AND
		      T41.AGARTYP = 25)
   OR EXISTS (SELECT 'X' FROM LD0V0A700 A700 
		WHERE A700.FLYKTNR = T41.AGARNR AND
		      T41.AGARTYP = 40)
   OR EXISTS (SELECT 'X' FROM LD0V0B B 
		WHERE B.AKTNR = T41.AGARNR AND
		      T41.AGARTYP = 39)
   OR EXISTS (SELECT 'X' FROM LD0V0E30 E30 
		WHERE E30.ATERLNR = T41.AGARNR AND
		      T41.AGARTYP = 44)
   OR EXISTS (SELECT 'X' FROM LD0V0U10 U10 
		WHERE U10.INSKRIVNINGSNR = T41.AGARNR AND
		      T41.AGARTYP=30)
   OR EXISTS (SELECT 'X' FROM LD0V0N90 N90 
		WHERE N90.UPPDRAGNR = T41.AGARNR AND
		      T41.AGARTYP=46)
   OR EXISTS (SELECT 'X' FROM LD0V0N900 N900 
		WHERE N900.UPPDRAGIFONR = T41.AGARNR AND
		      T41.AGARTYP=63)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
		WHERE L.RESURSNR = T41.AGARNR AND
			  T41.AGARTYP = 47)
   OR EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 42)
   OR EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 51)
   OR EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 52)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 53)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 41)
   OR EXISTS (SELECT 'X' FROM LD0V0B B 
		WHERE B.AKTNR = T41.AGARNR AND
		      T41.AGARTYP = 45)
   OR EXISTS (SELECT 'X' FROM LD0V0H H 
		WHERE H.AKTUALNR = T41.AGARNR AND
		      T41.AGARTYP = 60)
   OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 61)
   OR EXISTS (SELECT 'X' FROM LD0V0U01 U01
		WHERE U01.KARTLAGGNR = T41.AGARNR AND
		      T41.AGARTYP = 62)
   OR EXISTS (SELECT 'X' FROM LD0V0U90 U90 
		WHERE U90.LNUPPDRAGNR = T41.AGARNR AND
		      T41.AGARTYP=48);
