PO Last Approver

select
po.segment1 po_number,
v.segment1 vendor_number,
v.vendor_name,
po.creation_date,
a.action_date,
u.user_name

from
po_headers_all po,
(select object_id,action_date, employee_id from
(select a1.object_id,a1.object_type_code,a1.action_code,a1.employee_id,a1.action_date

from
po_action_history_v a1,
(select max(sequence_num) sequence_num,object_id,object_type_code from po_action_history_v group by object_id,object_type_code) a2
where a1.object_id=a2.object_id and a1.object_type_code=a2.object_type_code and a1.sequence_num=a2.sequence_num)
where object_type_code like 'PO' and action_code like 'APPROVE') a,
po_vendors v,
fnd_user u

where
po.po_header_id=a.object_id
and v.vendor_id=po.vendor_id
and u.employee_id=a.employee_id
order by
po.creation_date desc

No comments:

Post a Comment