Wednesday, November 22, 2023

Query to ger Rrequisition Approval History

Below is the query used to get the latest Requisition Approved details

 --------------------------------------------------------------------------------------------
SELECT POA.ACTION_CODE,
PANF.FULL_NAME,
PRH.Requisition_Number
FROM POR_REQUISITION_HEADERS_ALL PRH,
PO_ACTION_HISTORY POA,
PER_PERSON_NAMES_F panf
WHERE 1 = 1
AND POA.OBJECT_ID = PRH.REQUISITION_HEADER_ID
AND POA.ACTION_CODE = 'APPROVE'
AND POA.PERFORMER_ID <> - 1
AND POA.SEQUENCE_NUM = (
SELECT MAX(SEQUENCE_NUM)
FROM PO_ACTION_HISTORY PAH
WHERE 1 = 1
AND PAH.ACTION_CODE = 'APPROVE'
AND PAH.PERFORMER_ID <> - 1
AND PAH.OBJECT_ID = POA.OBJECT_ID
)
AND POA.PERFORMER_ID = PANF.PERSON_ID
AND SYSDATE BETWEEN panf.effective_start_date
AND panf.effective_end_date
AND panf.NAME_TYPE = 'GLOBAL'
AND PRH.Requisition_Number IN ('REQ1105738','REQ1308571')
 --------------------------------------------------------------------------------------------
                                                           **Thank You**


No comments:

Post a Comment