DROP VIEW LD0VLU10;
CREATE VIEW LD0VLU10
      AS SELECT * 
      FROM LD0P0U10 KART
      WHERE EXISTS(SELECT 'X'
            FROM LD0V1AJD AJD
            WHERE AJD.VYNAMN = 'KARTLÄGGN'
            AND KART.ORGID = AJD.JFRDTA3
            AND KART.ORGENHNR LIKE AJD.JFRDTA10)
	  OR EXISTS (SELECT * FROM LD0P0U12 U12 
						JOIN LD0V1AJD AJD 
						ON AJD.JFRDTA3=U12.ORGID 
						AND U12.ANSVARIGORG LIKE AJD.JFRDTA10
						AND U12.INSKRIVNINGSNR=KART.INSKRIVNINGSNR 
						AND AJD.VYNAMN = 'KARTLÄGGN'
            )
WITH CHECK OPTION;