Skip to Main Content

E-Business Suite

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Link missing between AP Invoice tables and XLE Tables

BommiJun 12 2019 — edited Feb 9 2021

Hi Experts,

We are using R12.2.3

We created an invoice and invoice details are as below

pastedImage_0.png

After invoice is created I done create accounting using 'Actions' button, but selected as Create Accounting > Final. So, by this data will be moved to SLA tables, but not to GL. The distribution details are as below

pastedImage_2.png

After the accounting is done as I said before, the accounting details are as below (totally 6 lines)

pastedImage_4.png

So, we are trying to fetch the accounting details using a query. I used the query as below, but it is not working Can anyone please help me on how to achieve this

select DISTINCT

    _**poh.segment1 po\_number, poh.comments description,**_

            _**poh.creation\_date po\_date, ai.invoice\_num invoice\_number,**_

            _**ai.invoice\_date invoice\_date,**_

            _**ai.invoice\_amount invoice\_amount,**_

            _**xel.accounting\_class\_code accounting\_class,**_

            _**xel.accounting\_date,**_

            _**xel.entered\_dr, xel.entered\_cr, xel.accounted\_cr,**_

            _**xel.accounted\_dr, xel.currency\_code,**_

            _**xel.currency\_conversion\_date, xel.gain\_or\_loss\_flag**_

from ap_invoices_all ai,ap_invoice_lines_all ail,ap_invoice_distributions_all apid,po_headers_all poh

    _**,xla.xla\_transaction\_entities xte,xla\_ae\_headers xeh,xla\_ae\_lines xel,xla.xla\_events xe**_

-- ,xla.xla_distribution_links xdl

where 1=1

and ai.quick_po_header_id IS NULL

and ai.invoice_num='11Jun2019-Inv1'

and ai.invoice_id=ail.invoice_id

and ail.po_header_id=poh.po_header_id(+)

and ai.invoice_id=apid.invoice_id

--AND poh.segment1 = NVL(:P_PO_NUMBER,poh.segment1) --Lexi Param as 2=2

--AND trunc(poh.creation_date) between NVL(:P_PO_DATE_FROM,trunc(poh.creation_date)) and NVL(:P_PO_DATE_TO,trunc(poh.creation_date)) --Lexi Param as 2=2

AND NVL (xte.source_id_int_1, -99) = ai.invoice_id

AND xte.ledger_id = ai.set_of_books_id

AND xte.application_id = 200

AND xte.entity_code = 'AP_INVOICES'

AND xeh.application_id = 200

AND xte.entity_id = xeh.entity_id

AND xel.application_id = 200

AND xel.ae_header_id = xeh.ae_header_id

and xel.ae_line_num(+)=ail.line_number

AND xe.application_id = 200

and xte.entity_id=xe.entity_id

and xeh.event_id=xe.event_id

--and xeh.ae_header_id=xdl.ae_header_id

--and xeh.event_id = xdl.event_id

--and xte.application_id = xdl.application_id

--and xel.ae_line_num=xdl.ae_line_num

--and xdl.source_distribution_id_num_1=apid.invoice_distribution_id

--and xdl.applied_to_dist_id_num_1=apid.invoice_distribution_id

--order by ai.invoice_num,ail.line_number

;

Thanks in Advance,

Bommi

Comments
Post Details
Added on Jun 12 2019
13 comments
2,556 views