Request Clarification on PAAPIMPB_PKG (Doc ID 2259028.1)

Last updated on APRIL 25, 2017

Applies to:

Oracle Project Costing - Version 12.1.3 and later
Information in this document applies to any platform.

Goal

Customer requested clarification on the following:

PO_Distributions_all PO has no joins in this update statement in the PAAPIMP_PKG
UPDATE ap_prepay_app_dists dist
  SET dist.pa_addition_flag = 'O',
  request_id = G_REQUEST_ID,
  last_update_date = SYSDATE,
  last_updated_by = G_USER_ID,
  last_update_login = G_USER_ID,
  program_id = G_PROG_ID,
  program_application_id = G_PROG_APPL_ID,
  program_update_date = SYSDATE
 WHERE NVL (dist.pa_addition_flag, 'N') = 'N'
  AND dist.amount <> 0
  AND EXISTS
  (SELECT /*+ no_unnest */
  inv.invoice_id
  FROM AP_INVOICES_ALL inv,
  PO_VENDORS vend,
  PO_Distributions_all PO,
  AP_Invoice_Distributions_all aid, --STD INV DIST LINE
  AP_Invoice_Distributions_all aid2 -- PREPAY APPL DIST LINE
  WHERE aid.invoice_id = inv.invoice_id
  AND inv.vendor_id = vend.vendor_id
  AND inv.org_id = G_ORG_ID
  AND aid.invoice_distribution_id = dist.invoice_distribution_id -- Std inv line
  AND aid2.invoice_id = aid.invoice_id
  AND aid2.invoice_distribution_id = dist.prepay_app_distribution_id --Prepay appl line
  --AND aid2.line_type_lookup_code in ( 'PREPAY', 'NONREC_TAX') -- bug#5514129
  AND aid.line_type_lookup_code <> 'REC_TAX' -- bug#5514129
  AND aid2.prepay_distribution_id IS NOT NULL
  AND aid2.pa_addition_flag IN ('N', 'E') --to avoid any historical data to be processed as Payments
  -- pa-addition-flag E to pull in rec tax across which prepay appl is prorated
  AND aid2.posted_flag = 'Y'
  AND aid.project_id = G_PROJECT_ID
 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms