Query on AME Approval for Purchase requisition
We are in 12.1.3. Planning to build a rule in AME for Purchase Requisition approval - Pickup the requester's Supervisor and send the Approval to Requester's Supervisor. We are using the below dynamic SQL for creating the approval Group.
select 'PER:'|| paf.supervisor_id
from po_requisition_headers_all poh,
po_requisition_lines_all pol,
per_all_people_f ppf,
per_all_assignments_f paf
where pol.requisition_header_id = poh.requisition_header_id
and poh.requisition_header_id = :transactionId
and pol.line_num = (select min(line_num)
FROM po_requisition_lines_all
where requisition_header_id = :transactionId)
and ppf.person_id = pol.to_person_id