AP(Payables) invoice related important table
Invoice AP_BATCHES_ALL SELECT * FROM AP_BATCHES_ALL WHERE batch_id IN ( SELECT batch_id FROM AP_INVOICES_ALL WHERE invoice_id = :P_INVOICE_ID ); AP_INVOICES_ALL SELECT DISTINCT ai.*, fnd_flex_ext.get_segs('SQLGL','GL#', '101' , ai.accts_pay_code_combination_id ) "Accts Pay Account" FROM AP_INVOICES_ALL ai WHERE invoice_id = :P_INVOICE_ID ORDER BY ai.invoice_id ASC; AP_INVOICE_LINES_ALL SELECT * FROM AP_INVOICE_LINES_ALL WHERE invoice_id = :P_INVOICE_ID; AP_INVOICE_DISTRIBUTIONS_ALL SELECT aid.*, fnd_flex_ext.get_segs('SQLGL','GL#', '101' , aid.accts_pay_code_combination_id) "Accts Pay Account", fnd_flex_ext.get_segs('SQLGL','GL#', '101' , aid.dist_code_combination_id) "Dist Account" FROM AP_INVOICE_DISTRIBUTIONS_ALL aid WHERE aid.invoice_id = :P_INVOICE_ID ORDER BY aid.invoice_id, aid...