Ap_invoice_distributions_all match the correlated Field
Source: Internet
Author: User
You have found that in ap_invoice_distributions_all, rcv_transaciton_id is null and sometimes has a value. Why? (See po_line_locations_all.
Match_option) Maybe you still remember that when we select a Match on the invoice workbench, sometimes it is a Match PO, sometimes it is a Match receept, in fact this is the reason, of course, the root cause of this matching item is a switch on the shipment of the PO: receip, or Purchase Order. If it is receip, when the PO is matched, you can only select Receipt (after the matching is successfully saved
Rcv_transaciton_id is a value.). Otherwise, only the Purchase Order can be selected for the matching value (after the matching is saved successfully
Rcv_transaciton_id has no valueIn fact, there is a po_distribution_id field in this ap_invoice_distributions_all. No matter whether rcv_transaciton_id is null or not, the po_distribution_id field is always set to a value related to the PO.
Requirement: Query ---- invoice number, receipt number, purchase order number (I always use po_distribution_id as the condition, instead of rcv_transaciton_id) -------------------------------------- select ai. invoice_num,
Rsh. receipt_num,
Ph. segment1,
Aid. distribution_line_number,
Aid. rcv_transaction_id,
Aid. po_distribution_id
From ap_invoices_all ai,
Ap_invoice_distributions_all aid,
Po_distributions_all pd,
Rcv_transactions rt,
Rcv_shipment_lines rsl,
Rcv_shipment_headers rsh,
Po_headers_all ph
Where ai. invoice_id = aid. invoice_id
And aid. set_of_books_id = '& sob'
And aid. period_name = '& period_name'
And aid. po_distribution_id = pd. po_distribution_id
And pd. po_distribution_id = rt. po_distribution_id
And rt. po_distribution_id = rsl. po_distribution_id
And rsl. shipment_line_id = rt. shipment_line_id
And rsh. shipment_header_id = rsl. shipment_header_id
And rt. destination_type_code = 'grouping ing'
And rt. po_header_id = ph. po_header_id
Order by 1, 2 For more information, pls refer to Metalink
ID 181429.1.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.