Wednesday, 15 February 2012

Script to find out which invoices are related to which purchase orders in Oracle Apps EBS R12

You have to join PO HEADERS to PO LINES to get to PO_LINE_LOCATIONS which gets you to PO_DISTRIBUTIONS. From there you can get to AP_INVOICE_DISTRIBUTIONS and then finally you can read and join on the INVOICE.

Here is the map with the real tables:

PO HEADERS_ALL > PO LINES_ALL > PO_LINE_LOCATIONS_ALL > PO_DISTRIBUTIONS_ALL > AP_INVOICE_DISTRIBUTIONS_ALL > AP_INVOICES_ALL


Your basic tables and joins are here:
AP.AP_INVOICE_DISTRIBUTIONS_ALL AID,
AP.AP_INVOICES_ALL AI,
PO.PO_DISTRIBUTIONS_ALL PDA,
PO.PO_HEADERS_ALL PHA,
PO.PO_LINES_ALL PLA,
PO.PO_LINE_LOCATIONS_ALL PLLA
WHERE
PHA.PO_HEADER_ID = PLA.PO_HEADER_ID
AND   PLA.PO_LINE_ID = PLLA.PO_LINE_ID
AND   PLLA.LINE_LOCATION_ID = PDA.LINE_LOCATION_ID
AND   PDA.PO_DISTRIBUTION_ID = AID.PO_DISTRIBUTION_ID
AND   AID.INVOICE_ID = AI.INVOICE_ID



No comments:

Post a Comment

How to change Employee Number Generation from Manual to Automatic in Oracle HRMS (When attempting to apply for a job in iRecruitment)

When attempting to apply for a job in iRecruitment, the following error occurs: ERROR: You must enter an Application Number. Solution: How t...