SELECT DOC.EP_APPRAISAL_ID ,TYP.LANGUAGE_CD ,TYP.EP_REVW_DESCR ,TMP.DESCR ,%Coalesce (CASE WHEN DOC.EP_REVIEW_STATUS ='PA' THEN XLAT.XLATLONGNAME ||' '||XLAT1.XLATSHORTNAME END, CASE WHEN DOC.EP_REVIEW_STATUS ='TP' THEN ( SELECT %Sql(HR_LONG_TO_CHAR254, HR_SSTEXT_TEXT) FROM PS_HR_SSTEXT_LANG TEX WHERE TEX.OBJECTOWNERID='HEP' AND TYP.LANGUAGE_CD = TEX.LANGUAGE_CD AND %EffdtCheck(HR_SSTEXT_LANG TEX1,TEX,%CurrentDateIn) AND ((TEX.HR_SSTEXT_SUB_ID = ' ' AND TYP2.EP_DOC_USAGE_IND='P') OR (TEX.HR_SSTEXT_SUB_ID = 'D' AND TYP2.EP_DOC_USAGE_IND='D')) AND TEX.TEXT_ID = 'TP_DOC_SUB_STATUS' AND TEX.HR_SSTEXT_KEY1=' ' AND TEX.HR_SSTEXT_KEY2=' ' AND TEX.HR_SSTEXT_KEY3=' ' AND TEX.HR_SSTEXT_KEY4=' ' AND TEX.HR_SSTEXT_KEY5 = DOC.EP_TP_SUB_STATUS AND TEX.HR_SSTEXT_KEY6 =' ') END, CASE WHEN DOC.EP_REVIEW_STATUS <>'PA' AND DOC.EP_REVIEW_STATUS <>'TP' THEN XLAT.XLATLONGNAME END) FROM PS_EP_APPR DOC , PS_EP_REVWTYP_LANG TYP , PS_EP_TMPLDEF_LANG TMP , PSXLATITEMLANG XLAT , PSXLATITEMLANG XLAT1 , PS_EP_REVW_TYP_TBL TYP2 WHERE DOC.EP_REVIEW_STATUS NOT IN ('CA','NS') AND TYP.EP_REVIEW_TYPE = DOC.EP_REVIEW_TYPE AND %EffdtCheck(EP_REVW_TYP_TBL TYP1,TYP,%CurrentDateIn) AND TMP.EP_REVIEW_TYPE = DOC.EP_REVIEW_TYPE AND DOC.EP_TEMPLATE_ID = TMP.EP_TEMPLATE_ID AND %EffdtCheck(EP_TMPL_DEFN TMP1,TMP,%CurrentDateIn) AND DOC.EP_REVIEW_STATUS=XLAT.FIELDVALUE AND XLAT.FIELDNAME='EP_REVIEW_STATUS' AND %EffdtCheck(PSXLATITEM XLATA,XLAT,%CurrentDateIn) AND DOC.EP_APPROVAL_STATUS=XLAT1.FIELDVALUE AND XLAT1.FIELDNAME='EP_APPROVAL_STATUS' AND %EffdtCheck(PSXLATITEM XLAT1A,XLAT1,%CurrentDateIn) AND TYP.EP_REVIEW_TYPE = TYP2.EP_REVIEW_TYPE AND TYP.EFFDT = TYP2.EFFDT AND TYP.LANGUAGE_CD = TMP.LANGUAGE_CD AND TYP.LANGUAGE_CD = XLAT.LANGUAGE_CD AND TYP.LANGUAGE_CD = XLAT1.LANGUAGE_CD
|