Get the correct PO Number for an Invoice Number
Content
Hi,
We had some consultants in they wrote a large piece of SQL, of which the below is a small part. It's looking to get the correct PO number for a specific invoice number. Specifically the code in bold
XTE = XLA_TRANSACTION_ENTITIES
(CASEWHENGJH.JE_SOURCE IN('Purchasing', 'Payables')THEN(SELECT DISTINCTPHA.SEGMENT1FROMAP_INVOICES_ALL AIA, PO_HEADERS_ALL PHAWHEREAIA.PO_HEADER_ID = PHA.PO_HEADER_IDAND AIA.PO_HEADER_ID IS NOT NULLAND AIA.INVOICE_NUM = XTE.TRANSACTION_NUMBERAND AIA.INVOICE_ID = XTE.SOURCE_ID_INT_1)WHENGJH.JE_SOURCE IN
1