Joining between PO and AP tables Oracle Apps R12

 SQL Query To find the PO Vendor Name from the Purchase Order 

select ASP.* from PO_HEADERS_ALL PHA,AP_SUPPLIERS ASP
WHERE PHA.VENDOR_ID=ASP.VENDOR_ID 
AND PHA.SEGMENT1=:PO_NUMBER
AND PHA.ORG_ID=:ORG_ID


SQL Query To find the PO Vendor SITE from the Purchase Order 


select ASSA.* 
from PO_HEADERS_ALL PHA,
AP_SUPPLIER_SITES_ALL ASSA
WHERE PHA.VENDOR_SITE_ID=ASSA.VENDOR_SITE_ID
AND PHA.SEGMENT1=:PO_NUMBER
AND PHA.ORG_ID=:ORG_ID


SQL Query To find the PO Matching AP Invoice Numbers from the Purchase Order


select * 
from ap_invoice_lines_all aila,
ap_invoices_all aia,
po_headers_all pha
where aila.po_header_id=pha.po_header_id
and aila.invoice_id=aia.invoice_id
and pha.segment1=:PO_NUMBER