DROP VIEW LD0V0CREQUESTDOCUMENTS
;
CREATE VIEW LD0V0CREQUESTDOCUMENTS
AS 
SELECT T41.DRUBRIK DOCUMENTNAME, 
       T41.PUBLISH_DATE PUBLISHDATE, 
       T41.AGARNR OWNERID,
       T41.DOKUMENTNR DOCUMENTID,
       T41.DDATUM CREATEDDATE,
       I.NAMN CASEWORKER,    
	   J.NAMN ORGANISATION,
       Y.RESPOND_DATE RESPONDDATE,
	   Q01_1.XNUM32 XNUM32
FROM LD0V0T41 T41
INNER JOIN LD0V0Q01 Q01_1 ON T41.DOKTYP = Q01_1.KOD AND Q01_1.KODTYP = 'TYPDOK'
LEFT OUTER JOIN LD0V0I I ON T41.PUBLISH_HANDL = I.HAND
LEFT OUTER JOIN LD0V0J01 J ON T41.PUBLISH_ORGENHNR = J.ORGENHNR
LEFT OUTER JOIN LD0V0H Y ON T41.AGARNR = Y.AKTUALNR
;