SQL to review PeopleSoft Forms Approval History in PeopleTools 8.52:
SELECT E.FORM_TYPE,
A.SEQ_NBR,
E.FORM_SUBJECT,
A.EOAWREQUESTOR_ID, -- PERSON WHO SUBMITTED THE WORKFLOW
C.OPRID, -- APPROVER
D.XLATLONGNAME, -- CURRENT APPROVAL STATUS
C.DTTM_CREATED, -- APPROVAL SUBMITTED DATE TIME
C.EOAWDTTM_MODIFIED -- APPROVAL MODIFIED DATE TIME
FROM SYSADM.PS_FORM_AW A,
SYSADM.PS_EOAW_STEPINST B,
SYSADM.PS_EOAW_USERINST C,
SYSADM.PSXLATITEM D,
SYSADM.PS_FORM E
WHERE B.EOAWTHREAD_ID = A.EOAWTHREAD_ID
AND B.EOAWPRCS_ID = A.EOAWPRCS_ID
AND B.EOAWDEFN_ID = A.EOAWDEFN_ID
AND B.EFFDT =
(SELECT MAX(B_ED.EFFDT)
FROM SYSADM.PS_EOAW_STEPINST B_ED
WHERE B.EOAWTHREAD_ID = B_ED.EOAWTHREAD_ID
AND B.EOAWSTEP_INSTANCE = B_ED.EOAWSTEP_INSTANCE
AND B.EOAWPRCS_ID = B_ED.EOAWPRCS_ID
AND B.EOAWDEFN_ID = B_ED.EOAWDEFN_ID
AND B_ED.EFFDT <= SYSDATE
)
AND C.EOAWUSTEP_INST_ID =
(SELECT MAX(C1.EOAWUSTEP_INST_ID)
FROM SYSADM.PS_EOAW_USERINST C1
WHERE C1.EOAWSTEP_INSTANCE = B.EOAWSTEP_INSTANCE
)
AND D.FIELDNAME = 'EOAWSTEP_STATUS'
AND D.FIELDVALUE = C.EOAWSTEP_STATUS
AND D.EFFDT =
(SELECT MAX(D_ED.EFFDT)
FROM SYSADM.PSXLATITEM D_ED
WHERE D.FIELDNAME = D_ED.FIELDNAME
AND D.FIELDVALUE = D_ED.FIELDVALUE
AND D_ED.EFFDT <= SYSDATE
)
AND D.EFF_STATUS = 'A'
AND E.SEQ_NBR = A.SEQ_NBR
ORDER BY E.FORM_TYPE, A.SEQ_NBR, B.EOAWTHREAD_ID, B.EOAWSTEP_INSTANCE;
SELECT E.FORM_TYPE,
A.SEQ_NBR,
E.FORM_SUBJECT,
A.EOAWREQUESTOR_ID, -- PERSON WHO SUBMITTED THE WORKFLOW
C.OPRID, -- APPROVER
D.XLATLONGNAME, -- CURRENT APPROVAL STATUS
C.DTTM_CREATED, -- APPROVAL SUBMITTED DATE TIME
C.EOAWDTTM_MODIFIED -- APPROVAL MODIFIED DATE TIME
FROM SYSADM.PS_FORM_AW A,
SYSADM.PS_EOAW_STEPINST B,
SYSADM.PS_EOAW_USERINST C,
SYSADM.PSXLATITEM D,
SYSADM.PS_FORM E
WHERE B.EOAWTHREAD_ID = A.EOAWTHREAD_ID
AND B.EOAWPRCS_ID = A.EOAWPRCS_ID
AND B.EOAWDEFN_ID = A.EOAWDEFN_ID
AND B.EFFDT =
(SELECT MAX(B_ED.EFFDT)
FROM SYSADM.PS_EOAW_STEPINST B_ED
WHERE B.EOAWTHREAD_ID = B_ED.EOAWTHREAD_ID
AND B.EOAWSTEP_INSTANCE = B_ED.EOAWSTEP_INSTANCE
AND B.EOAWPRCS_ID = B_ED.EOAWPRCS_ID
AND B.EOAWDEFN_ID = B_ED.EOAWDEFN_ID
AND B_ED.EFFDT <= SYSDATE
)
AND C.EOAWUSTEP_INST_ID =
(SELECT MAX(C1.EOAWUSTEP_INST_ID)
FROM SYSADM.PS_EOAW_USERINST C1
WHERE C1.EOAWSTEP_INSTANCE = B.EOAWSTEP_INSTANCE
)
AND D.FIELDNAME = 'EOAWSTEP_STATUS'
AND D.FIELDVALUE = C.EOAWSTEP_STATUS
AND D.EFFDT =
(SELECT MAX(D_ED.EFFDT)
FROM SYSADM.PSXLATITEM D_ED
WHERE D.FIELDNAME = D_ED.FIELDNAME
AND D.FIELDVALUE = D_ED.FIELDVALUE
AND D_ED.EFFDT <= SYSDATE
)
AND D.EFF_STATUS = 'A'
AND E.SEQ_NBR = A.SEQ_NBR
ORDER BY E.FORM_TYPE, A.SEQ_NBR, B.EOAWTHREAD_ID, B.EOAWSTEP_INSTANCE;
No comments:
Post a Comment