Consulta para obter detalhes do histórico de aprovação da requisição de PO

SELECT

  pah.action_code ,

  pah.object_id ,

  pah.action_date ,

  pah.sequence_num,

  pah.creation_date ,

  prha.segment1 req_num ,

  prha.wf_item_key ,

  prha.authorization_status ,

  fu.description ,

  papf.full_name hr_full_name ,

  papf.employee_number emp_no ,

  pj.NAME job

FROM

  po.po_action_history pah ,

  po.po_requisition_headers_all prha ,

  applsys.fnd_user fu ,

  hr.per_all_people_f papf ,

  hr.per_all_assignments_f paaf ,

  hr.per_jobs pj

WHERE

  object_id           = prha.requisition_header_id

AND pah.employee_id   = fu.employee_id

AND fu.employee_id    = papf.person_id

AND papf.person_id    = paaf.person_id

AND paaf.job_id       = pj.job_id

AND paaf.primary_flag = ‘Y’

AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date

AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date

AND pah.object_type_code = ‘REQUISITION’

AND prha.segment1        =’301000201234′

  –AND pah.action_code = ‘APPROVE’a

ORDER BY pah.sequence_num;

Deixe uma resposta

Pular para a barra de ferramentas