I am trying to extract Buyer's information from PO_AGENTS table in R12. Below is the query
FROM po_agents pa, per_all_people_f papf, hr_all_organization_units haou
WHERE pa.agent_id = papf.person_id
AND papf.business_group_id = haou.business_group_id
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
AND papf.effective_end_date > SYSDATE
AND haou.business_group_id = 83 -- CURRENT
Here, I am using business_group_id from per_all_people_f because the organization_id I require is not available in per_all_assignments_f table. But this query does not return data specific to my organization. Which joins do I need to add to get the data?
Is there any other way I can join po_agents or per_all_people_f with hr_all_organization_units?