Featured post

General Ledger Revaluation

General Ledger Revaluation Account balances denominated in foreign currencies are adjusted through the revaluation procedure. Revaluat...

Thursday, 28 September 2017

Query To Get PO Number, Invoice Number and Receipt Number With one of the Input

Query To Get PO Number, Invoice Number and Receipt Number With one of the Input

SELECT distinct pha.segment1 po_number
       ,aia.invoice_num invoice_number
       ,rsh.receipt_num receipt_number
  FROM po_headers_all pha
       ,po_distributions_all pda
       ,ap_invoice_distributions_all aid
       ,ap_invoices_all aia
       ,rcv_shipment_lines rsl
       ,rcv_shipment_headers rsh
 WHERE pha.po_header_id=pda.po_header_id
   AND aid.po_distribution_id=pda.po_distribution_id
   AND aia.invoice_id=aid.invoice_id
   AND rsl.po_header_id=pha.po_header_id
   AND rsl.shipment_header_id=rsh.shipment_header_id
   AND pha.segment1=nvl(:P_PO_NUM,pha.segment1)
   AND aia.invoice_num=nvl(:P_INVOICE_NUM,aia.invoice_num)
   AND rsh.receipt_num=nvl(:P_RECEIPT_NUM,rsh.receipt_num)
 order by 2
;

Sunday, 17 September 2017

Invoice Matching functionality

Invoice Matching functionality

To answer some common questions surrounding Invoice Matching functionality.
Questions and Answers

I Am Very Confused By Invoice Matching And Don't Really Understand It. Where Can I Find An Overview Of The Process To Help Me Get Started?

A: Please review Doc ID 1441364.1 - which is a white paper on Invoice Matching that includes screenshots and helps you understand the basics. The Payables User Guide also contains a lot of more detailed specific information on this topic.

How Can I Find Out Which Invoices Are Matched To A Purchase Order?
A: In Payables, run the Matching Detail Report from Other > Request > Run.
This report will show you detail of how an invoice, purchase order, or receipt was matched. This report is especially helpful when an invoice is on hold and you are trying determine why the hold was placed.


What Reports Are Available To Check If A Credit Memo Is Matched To An Invoice?
A: In Payables, run the Credit Memo Matching Report from Other > Request > Run


Why Can An Invoice Be Matched To A PO Without A Receipt Being Needed?
A: If the match option on PO shipment is set to Purchase Order then the invoice can be matched directly to the PO. However, if the PO is setup with 3-way matching, then after invoice validation, if a tolerance is defined then a QTY REC hold will be placed on the invoice which will need a receipt to be entered in order for the hold to be released. See Doc ID 433545.1 for more information.

Why Does The PO Number Disappear From The Invoice Header After Matching To A PO?
A: When you are using the match button you never know how many times to how many PO's or receipts users are going to match the invoice to, hence, we do not store the PO number at the header level. See Doc ID 738788.1 for more information.


When Entering An Invoice, The Match Button Becomes Disabled When The Line Item Is Selected. Users Are Unable To Match An Invoice To A Purchase Order Or Receipt Without This Option Enabled. Is This correct?
A: This is standard functionality but once users are done adding/updating in the Lines tab, if the General Tab is selected again, the Match button will be available.

When Matching A PO To An Invoice, The Match Basis Is Not As Expected. How Does This Field Relate To The PO Line Type?
A: Match Basis will be either Quantity or Amount. The value of this field is based on the value basis of the purchase order line's type. See Doc ID 428303.1 for more information.

How Do You Match An Invoice To A PO With Two Lines, One With Match Level Receipt (3-Way), And One With Match Level PO (2-Way)?
A: First match the invoice to the PO setup with match level receipt. Then requery the invoice and match the second line to the PO. See Doc ID 181736.1 for more information.
Why Can Users Not Drilldown To A PO From The Invoice During Matching Without Encountering A 'Function Not Available For This Responsibility' Message?
A: This is due to incorrect menu setup. The submenu AP_PO_VIEW_PURCHASE_ORDERS_GUI needs to be added to the menu for the responsibility used to perform the match. See Doc ID 1350427.1 for more information.

Does The Purchase Order Number Get Populated On Freight, Miscellaneous And Tax Lines When Using The Allocations Window?
A: The purchase order number will not get populated on freight, miscellaneous and nonrecoverable tax lines. PO information is populated for recoverable tax lines.

Why Does Matching An Invoice To PO Default The Accrual Account To The Invoice Distributions?
A: If Accrue on Receipt is selected (checked) on the shipment line to which the invoice is matched, then the functionality is to default the PO accrual account on the invoice distributions. The PO Charge Account will default to the invoice distributions only if Accrue on Receipt is not checked. This is intended functionality.

After Matching An Invoice To A PO, The Distribution Shows As The PO Charge Account But We Were Expecting To See The Accrual Account Displayed. What Happened?
A: If the Accrue on Receipt option is set to Yes for the shipment, then the Accrual Account will be used on the Invoice Distribution. Shipments for inventory items will always be set to Accrue on Receipt. There is no way to change that. In other words the PO matched distributions for inventory items will always have the PO Accrual account as the Distribution account. Shipments for Expense items can be set to Accrue at Period End. In that case the Charge account defined on the PO distribution will be used as the distribution account. The system works as designed.

How Do I Remove A Final Matching Hold, So I Can Pay The Invoice?
A: This hold is in effect because the invoice was matched to a PO shipment that has a status of Final Closed. In 11.5.10 and above, there is no way to manually remove the hold, reverse distributions or cancel the invoice.

What Do The Codes For The Final Match Flag Mean?
A: After you match an invoice to a purchase order, you can look at the AP_INVOICE_DISTRIBUTIONS_ALL table and observe different codes in the FINAL_MATCH_FLAG column. The FINAL_MATCH_FLAG has the following quickcodes:

1. N - No. The PO shipment line has not been matched.
2. Y - Yes. The PO shipment line has been matched, and one of the invoices for this PO has been final matched. When a PO is final matched to an invoice, all other invoices matched to that PO are updated, too. So, you cannot tell from this flag, which invoice was final matched.
3. D - Done. The PO shipment line is closed. You cannot invoice this distribution line.

What Does Final Match Do?
A: When you final match an invoice to a PO, you can never match another invoice to that PO. The PO lines that have been final matched are permanently closed. In 11.5.10 and above, invoices matched to a Finally Closed PO cannot be updated or canceled.


How Does Descriptive Flexfield Information From The PO Line Get To AP During Invoice Matching?
A: Enable the Transfer PO Descriptive Flexfield Information Payables Option. With this enabled, descriptive flexfield information will automatically transfer from the purchase order distribution to the invoice distribution when match an invoice to a purchase order is done. The flexfield structure for purchase order distributions and invoice distributions should be same. Note, for ERS invoices, PO will always populate the flexfield information in the AP Invoice Interface tables, so AP will always import these value irrespective of this setup.

How Does The RCV_TRANSACTION_ID Column Get Populated In The AP_INVOICE_DISTRIBUTIONS_ALL Table?
A: The RCV_TRANSACTION_ID column is only populated when the Invoice Match Option is set to Receipt on the PO Shipment line.

It Is Possible To Match A Purchase Order To An Invoice Even If Receiving Date Is Earlier Than Invoicing Date. In Practice, It Is Illogical That You Pay Before Receiving. Does Oracle Allow Us To HOLD Invoices In Which 'INVOICING DATE' Is Earlier Than 'RECEIVING DATE'?
A: There is no such Standard seeded hold for this. If you want to make a hold on this case, you have to create and apply manual holds. See Doc ID 1427975.1 for more information.

Why Do I Get An Invoice Price Variance (IPV) Line When I Match An Invoice To A PO With Nonrecoverable Tax?
A: Nonrecoverable taxes are considered part of the "landed" cost of the items purchased
when the non recoverable tax is not already included in the purchase order. See Doc ID 281505.1 for more information.

Unable To Match To A Specific Distribution On A Release. How Can This Be Fixed?
A: Enable the Allow Distribution Level Matching Payables Option, if you want to allow matching to purchase order distributions. If you enable this option, you can match an invoice to one or more purchase order distributions. If you do not enable this option, Payables only allows you to match an invoice to a purchase order shipment.

Purchasing Encumbrances Are Not Reversed By Invoice Matching. Why Is This?
A: If PO Encumbrance Type and Invoice Encumbrance Type are the same, AP will encumber only for variances. Only when the Accounting Entries have been created for AP, would the encumbrance be relieved. Once the 'Create Accounting Entries' process is run, encumbrance is relieved. This is the standard functionality and as per design.

There Are Differences Between The PO And Invoice Billed/Received/Invoiced Quantities. They Should
Have The Same Values If Viewed In Payables Or Purchasing. What Could Be The Problem?
A: This is a classic data corruption issue. Run the MasterGDF diagnostic Doc ID 1360390.1 for your invoice to determine if you are experiencing any corruption for that invoice and find the solution for your specific situation.




User Discards Invoice Lines On PO Matched Invoice And Cancels The Invoice, However, The PO Still Shows An Amount Billed. This Means The PO Cannot Be Cancelled Due To Mismatch Between The AP And PO Tables. Why Is This Happening?
A: This is a data corruption issue. Run the MasterGDF diagnostic Doc ID 1360390.1 for your invoice to determine if you are experiencing any corruption for that invoice and find the solution for your specific situation.

Unable To Validate Matched Invoice And Unable To Cancel Invoice. How Can This Invoice Be Processed?
A: The chances are very high that this specific invoice has some data corruption. Run the MasterGDF diagnostic Doc ID 1360390.1 for your invoice to determine if you are experiencing any corruption for that invoice and find the solution for your specific situation.

Invoice That Was Matched To Receipt, Discarded And Rematched Has Doubled Matching Amounts. Unable To Cancel The Invoice And Line Cannot Be Discarded As This Would Result In Negative Quantities On The PO. What Is The Problem?
A: This is a data corruption issue. Run the MasterGDF diagnostic Doc ID 1360390.1 for your invoice to determine if you are experiencing any corruption for that invoice and find the solution for your specific situation.


Attempting To Match To A PO That Was Previously Matched And Unmatched, Incorrectly Shows Negative Value For Billed Quantity. What Is The Problem?
A: This is a data corruption issue. Run the MasterGDF diagnostic Doc ID 1360390.1 for your invoice to determine if you are experiencing any corruption for that invoice and find the solution for your specific situation.

Create Adjusting Documents (APXCADIP) Program Is Not Creating PPA Invoices When The PO# Parameter Is Not Provided. There Are Four Parameters: PO#, Supplier, Supplier Site And Resubmit Interface Import And None Of These Are Mandatory Yet The Program Does Not Create The Invoice For The Standard PO That References The Global Blanket Purchase Agreements (GBPA) That Got Updated If The PO# Is Not Entered. Why Is This?
A: The Purchase Order for which the price is to be adjusted must be specified so that the application knows which PO should be adjusted. An ER was logged to allow a global Blanket PO agreement number to be entered as a parameter so that all POs linked to this would be updated. See Doc ID 1378388.1 for more information.

Is It Possible To Enter A Different Tax Classification Code For The Return Tax Code During A Price Correction?
A: No different taxes in the original transaction and price correction is not feasible because a price correction will alter the item price on the original invoice, without changing the total quantity billed. Accordingly, the matching portion of tax (either positive or negative) needs to be the same tax as on the original invoice. If you want to rematch the item with different price and tax, you will need to discard the originally matched item line, so its tax will be reversed, and rematch the shipment, this time with the correct price and tax.

How Does The Create Debit Memo From RTS Functionality Work?
A: Review the instructions found in Doc ID 185867.1 for more information.

Automatic Debit Memo Creation Failed When Creating a RTS Transaction.  What Could Be Wrong?
A: For an Automatic Debit Memo to be created in AP, the following must be true:

The supplier site has to be marked to allow RTS transactions.
There must be an original invoice already in AP for the item being returned.
The PO and the original Invoice must be to the same Supplier Site.
The Supplier Site must be marked as both a Pay Site and a Purchasing Site.
The return quantity cannot cause the quantity invoiced to go negative.
The return quantity must be equal to or less than the quantity invoiced.
The Create Debit Memo checkbox must also be turned on in the Receipt form.
The return must be to the Supplier, and not to Receiving.

If the debit memo is not created automatically, you should create the debit memo manually in the Payables application.

Debit Memo Created For A RTS Transaction Has Terms From The Supplier Site.  Is This Correct?
A: The payment terms for a supplier site default to the invoices you enter for the site except in the following circumstances:

You enter a PO Default or QuickMatch invoice in the Invoice Workbench, in which case the terms default from the purchase order.
You import an invoice record that has payment terms specified on the record, or the import process can derive terms from purchase order matching. You can override the default payment terms on any invoice.So, the debit memo is correctly picking up payment term from the supplier site.

Create Debit Memo From RTS Transaction Is Not Created When The RCV: Processing Mode Profile Option Is Set To Online.  Why?
A: When the system profile option, RCV: Processing Mode is set to Online, no Debit Memo is created in Payables. Set the option to Immediate so the debit memo will be generated in Payables.

Create Debit Memo From RTS Errors AP_CANNOT_ASSIGN_DOC_SEQ.  What Is The Problem?
A: Ensure that the seeded Document Category is the one assigned to the set of books for successful creation of automatic / RTS Debit memos

Price Hold Not Released When Entering Credit Memo.  How Can This Be Released?
A: Use one of the following methods to resolve this issue:

Match the credit memo to the PO with price correction enabled and the related invoice selected.
Match the credit memo to the invoice which is matched to the PO in question and validate both the invoice and the credit memo.

Tuesday, 12 September 2017

Mapping Between PO Tables And General Ledger Tables - R12


Table relationships between PO tables and rcv_transactions and rcv_receiving_sub_ledger remain
the same as in R11i.

The following reference fields are used to capture and keep PO information in RCV_RECEIVING_SUB_LEDGER

REFERENCE1
Source (PO or REQ)

REFERENCE2
PO Header ID or Requisition Header ID (from po_headers_all.po_header_id or
po_requisition_headers_all.requisition_header_id)

REFERENCE3
Distribution ID (from po_distributions_all.po_distribution_id or
po_req_distributions_all.distribution_id)

REFERENCE4
Purchase Order or Requisition number (from po_headers_all.segment1 or
po_requistion_headers_all.segment1)

REFERENCE5
(Autocreated Purchase Orders only) Backing requisition number (from
po_requisition_headers_all.segment1)

RCV_TRANSACTION_ID Receiving transaction unique identifier (from rcv_transactions.transactions_id)

The receiving package that populates this table is RCV_CreateAccounting_PVT (RCVVACCB.pls)

Release 11i Mapping Ref Note.461103.1 - Mapping Between PO Tables And General Ledger Tables

XLA_TABLES

SLA-Subledger Accounting, has introduced new SLA tables :

* XLA_AE_HEADERS
* XLA_AE_LINES
* XLA_DISTRIBUTION_LINKS

RCV_RECEIVING_SUB_LEDGER is not directly linked to table GL_JE_LINES, instead it is linked through the subledger tables :

* XLA_AE_HEADERS
* XLA_AE_LINES
* XLA_DISTRIBUTION_LINKS

Accounting entries in RCV_RECEIVING_SUB_LEDGER can be retrieved using SLA tables and GL_IMPORT_REFERENCES table after running Create Accounting.

RCV_RECEIVING_SUB_LEDGER is linked to XLA Tables by RCV_SUB_LEDGER_ID

Run the sql below to get RCV_SUB_LEDGER_ID:
Select RCV_SUB_LEDGER_ID from rcv_receiving_sub_ledger where rcv_transaction_id in
(select transaction_id from rcv_transactions where po_header_id =&&po_header_id);

XLA_DISTRIBUTION_LINKS stores the link between transactions and subledger journal entry lines. The tables XLA_DISTRIBUTION_LINKS and RCV_RECEIVING_SUB_LEDGER are linked by

* SOURCE_DISTRIBUTION_ID_NUM_1 = RCV_SUB_LEDGER_ID
* SOURCE_DISTRIBUTION_TYPE = 'RCV_RECEIVING_SUB_LEDGER'

For example:
Select *
FROM XLA_DISTRIBUTION_LINKS XDL
where XDL.SOURCE_DISTRIBUTION_ID_NUM_1 IN (' <>')
And SOURCE_DISTRIBUTION_TYPE = 'RCV_RECEIVING_SUB_LEDGER'
And APPLICATION_ID = 707;

Select * from rcv_receiving_sub_ledger
where rcv_sub_ledger_id in
(select source_dIstribution_id_num_1
FROM XLA_DISTRIBUTION_LINKS
where SOURCE_DISTRIBUTION_TYPE ='RCV_RECEIVING_SUB_LEDGER'
and APPLICATION_ID=707)

Link the PO Distibution, Receipts, Receiving Subledger and XLA Distributions

select rt.po_header_id, pd.po_distribution_id,
rt.transaction_id, rrsl.rcv_sub_ledger_id,
xdl.ae_header_id,xdl.SOURCE_DISTRIBUTION_ID_NUM_1,
xdl.SOURCE_DISTRIBUTION_TYPE
from rcv_receiving_sub_ledger rrsl, rcv_transactions rt,
po_distributions_all pd, xla_distribution_links xdl
where pd.po_distribution_id = rt.PO_DISTRIBUTION_ID
and rt.transaction_id = rrsl.rcv_transaction_id
and rt.PO_DISTRIBUTION_ID = rrsl.reference3
and rrsl.rcv_sub_ledger_id = xdl.SOURCE_DISTRIBUTION_ID_NUM_1
and xdl.SOURCE_DISTRIBUTION_TYPE = 'RCV_RECEIVING_SUB_LEDGER'
and xdl.APPLICATION_ID=707;

The tables PO_BC_DISTRIBUTIONS and XLA_AE_HEADERS are linked with the column 'event_id'.

The tables XLA_AE_HEADERS and GL_BC_PACKETS are linked with the column 'ae_header_id'.

XLA_DISTRIBUTION_LINKS and GL_BC_PACKETS are linked by 'source_distribution_type' and 'source_distribution_id_num_1' . On Reserving and Approving the PO, Encumbrance entries get generated in table GL_BC_PACKETS with column 'source_distribution_type' as po_distributions_all and column 'source_distribution_id_num_1' as po_distribution_id.

The tables XLA_AE_HEADERS and XLA_AE_LINES are linked with the column 'ae_header_id'.

The tables XLA_DISTRIBUTION_LINKS and MTL_TRANSACTION_ACCOUNTS are linked by

* source_distribution_id_num_1 = inv_sub_ledger_id
* source_distribution_type = MTL_TRANSACTION_ACCOUNTS

GL_TABLES

XLA_AE_LINES table is mapped to GL_IMPORT_REFERENCES table with the
'gl_sl_link_id' and 'gl_sl_link_table' columns. The linking columns
between GL_IMPORT_REFERENCES and GL_JE_LINES tables are 'je_header_id' and 'je_line_num. '

DATA COLLECTION SQL SCRIPTS

DATA FROM PO TABLES
======================

1.
SELECT * FROM PO_HEADERS_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID

2.
SELECT * FROM PO_LINES_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID

3.
SELECT * FROM PO_LINE_LOCATIONS_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID

3a.
SELECT * FROM po_line_locations_archive_all
WHERE PO_HEADER_ID = &&po_header_id

4.
SELECT * FROM PO_DISTRIBUTIONS_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID

5.
SELECT * FROM PO_RELEASES_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID;

RECEIVING AND DELIVERY DATA
===========================

select * from rcv_transactions where po_header_id in ()

select * from mtl_material_transactions where rcv_transaction_id in ()

DATA FROM RECEIVING,INVENTORY TABLES and AP TABLES
==================================================

SELECT * FROM RCV_SHIPMENT_HEADERS
WHERE SHIPMENT_HEADER_ID IN
(SELECT SHIPMENT_HEADER_ID FROM RCV_SHIPMENT_LINES
WHERE PO_HEADER_ID =&&PO_HEADER_ID );

SELECT * FROM RCV_SHIPMENT_LINES
WHERE PO_HEADER_ID =&&PO_HEADER_ID;

SELECT * FROM RCV_TRANSACTIONS
WHERE PO_HEADER_ID =&&PO_HEADER_ID;

SELECT * FROM RCV_ACCOUNTING_EVENTS
WHERE PO_HEADER_ID =&&PO_HEADER_ID;

SELECT * FROM RCV_RECEIVING_SUB_LEDGER
WHERE RCV_TRANSACTION_ID IN
(SELECT TRANSACTION_ID FROM RCV_TRANSACTIONS
WHERE PO_HEADER_ID =&&PO_HEADER_ID);

SELECT * FROM RCV_SUB_LEDGER_DETAILS
WHERE RCV_TRANSACTION_ID IN
(SELECT TRANSACTION_ID FROM RCV_TRANSACTIONS
WHERE PO_HEADER_ID =&&PO_HEADER_ID);

SELECT * FROM MTL_MATERIAL_TRANSACTIONS
WHERE TRANSACTION_SOURCE_ID = &&PO_HEADER_ID;

SELECT * FROM MTL_TRANSACTION_ACCOUNTS
WHERE TRANSACTION_ID IN
( SELECT TRANSACTION_ID FROM MTL_MATERIAL_TRANSACTIONS
WHERE TRANSACTION_SOURCE_ID = &&PO_HEADER_ID )

SELECT * FROM AP_INVOICE_DISTRIBUTIONS_ALL
WHERE PO_DISTRIBUTION_ID IN
(SELECT PO_DISTRIBUTION_ID FROM PO_DISTRIBUTIONS_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID );

SELECT * FROM AP_INVOICES_ALL
WHERE INVOICE_ID IN
(SELECT INVOICE_ID FROM AP_INVOICE_DISTRIBUTIONS_ALL
WHERE PO_DISTRIBUTION_ID IN
( SELECT PO_DISTRIBUTION_ID FROM PO_DISTRIBUTIONS_ALL
WHERE PO_HEADER_ID =&&PO_HEADER_ID ));

RECEIVING TRANSACTIONS/RRLS and XLA TABLES
===========================================

RCV
-----
Select * FROM RCV_TRANSACTIONS
where TRANSACTION_ID IN
( Select rcv_transaction_id from rcv_receIving_sub_ledger
where rcv_sub_ledger_id in
(select source_dIstribution_id_num_1
from XLA_DISTRIBUTION_LINKS
where SOURCE_DISTRIBUTION_TYPE ='RCV_RECEIVING_SUB_LEDGER'
and APPLICATION_ID=707))

RRSL
---
Select * from rcv_receIving_sub_ledger
where rcv_sub_ledger_id in
(select source_dIstribution_id_num_1
FROM XLA_DISTRIBUTION_LINKS
where SOURCE_DISTRIBUTION_TYPE ='RCV_RECEIVING_SUB_LEDGER'
and APPLICATION_ID=707)

select * from xla_ae_headers where ae_header_id in ()

select * from xla_ae_lines where ae_header_id in ()

select * from xla_distribution_links where ae_header_id in ()

select * from xla_distribution_links where source_distribution_type = 'RCV_RECEIVING_SUB_LEDGER' and source_distribution_id_num_1 in ()

XLA and MTL TABLES
---
SELECT * FROM MTL_MATERIAL_TRASNACTIONS
WHERE TRANSACTION_ID=&TXN_ID

SELECT * FROM MTL_TRANSACTION_ACCOUNTS
WHERE TRASNACTION_ID=&TXN_ID

SELECT * FROM XLA_TRASNACTION_ENTITIES
WHERE TRANSACTION_NUMBER=&TXN_ID
(SOURCE_ID_INT_1 also represnets txn_id)

SELECT * FROM XLA_EVENTS
WHERE ENTITY_ID IN (
SELECT ENTITY_ID FROM XLA_TRANSACTION_ENTITIES
WHERE TRANSACTION_NUMBER=&TXN_ID)

SELECT * FROM XLA_DISTRIBUTION_LINKS
WHERE EVENT_ID IN
(SELECT EVENT_ID FROM XLA_EVENTS
WHERE ENTITY_ID IN (
SELECT ENTITY_ID FROM XLA_TRANSACTION_ENTITIES
WHERE TRANSACTION_NUMBER=&TXN_ID))

SELECT * FROM XLA_AE_HEADERS
WHERE EVENT_ID IN
(SELECT EVENT_ID FROM XLA_EVENTS
WHERE ENTITY_ID IN (
SELECT ENTITY_ID FROM XLA_TRANSACTION_ENTITIES
WHERE TRANSACTION_NUMBER=&TXN_ID))

SELECT * FROM XLA_AE_LINES
WHERE AE_HEADER_ID IN
(SELECT AE_HEADER_ID FROM XLA_AE_HEADERS
WHERE EVENT_ID IN

select * from rcv_transactions where po_header_id in ()
select * from mtl_material_transactions where rcv_transaction_id in ()
select * from xla_distribution_links where source_distribution_type = 'MTL_TRANSACTION_ACCOUNTS' and source_distribution_id_num_1 in ()