Results for “init_rec_gt_tables”

8 results




AI-generated from documented ETRM metadata — verify critical details on the linked pages.

Overview

ZX_PO_REC_PKG is an Oracle E-Business Tax (EBTax) package body in the APPS schema that supports tax recovery processing for Oracle Purchasing documents. Its principal responsibility is to derive, stage, and persist tax recovery rate information for purchase order distributions so that recoverable and non-recoverable portions of tax can be accurately accounted for during requisition, purchase order, and receipt processing. The package operates against records in PO_DISTRIBUTIONS_ALL, PO_LINE_LOCATIONS_ALL, PO_LINES_ALL, and PO_HEADERS_ALL, correlating each distribution with the applicable tax code, vendor, vendor site, item, inventory organization, ledger, and chart of accounts. It uses the recovery rule and recovery rate configuration stored in EBTax (via ZX tax recovery rules and rates) to determine the recoverable percentage for each distribution line.

The package header comment (zxpotrxpoprecb.pls 120.14.12020000.2, dated 2012/07/23) indicates it has been maintained through the 12.1.1 and 12.2.x release streams. A characteristic design element is the use of PL/SQL associative array (“tab”) collections declared at package level—for example po_header_id_tbl, po_line_id_tbl, po_dist_id_tbl, tax_code_id_tbl, trx_date_tbl, code_combination_id_tbl, vendor_id_tbl, and the various tax recovery rule/rate tables—which allow the package to batch-fetch and cache distribution attributes before performing recovery calculations. The constant C_LINES_PER_INSERT (5000) reflects a bulk-processing pattern in which rows are processed in bounded batches.

Key Procedures and Functions

  • GET_REC_INFO — The core data-gathering routine. It accepts a ROWID range (p_start_rowid, p_end_rowid) that delimits the portion of PO distributions to process, and opens an ordered, nested-loops cursor joining PO_HEADERS_ALL, PO_LINES_ALL, PO_LINE_LOCATIONS_ALL, PO_DISTRIBUTIONS_ALL, AP_TAX_CODES_ALL / AR_TAX_GROUP_CODES_ALL, and vendor information. It extracts the distribution identifiers, tax code, transaction date, code combination, vendor and vendor site, item and inventory organization, chart of accounts, and the applicable tax recovery rule and rate. The cursor uses hints such as ORDERED, NO_EXPAND, USE_NL, and ROWID access on PO_HEADERS_ALL, together with indexed access paths against FINANCIALS_SYSTEM_PARAMS_ALL.
  • INSERT_REC_INFO — Persists the computed tax recovery information into the staging table ZX_PO_REC_DIST, populating the package's cached collection values row by row.
  • INIT_REC_GT_TABLES — Initializes the package-level global temporary/collection tables before a processing run, ensuring that stale data from prior invocations does not affect the current calculation.

The metadata documents five procedures/functions in total; the additional entry points follow the same initialization, retrieval, and insertion pattern used by the three named routines above.

Tables Accessed

  • PO_DISTRIBUTIONS_ALL, PO_LINE_LOCATIONS_ALL, PO_LINES_ALL, PO_HEADERS_ALL — Source Purchasing documents supplying distribution, line, shipment, and header attributes.
  • AP_TAX_CODES_ALL, AR_TAX_GROUP_CODES_ALL — Tax code and tax group lookups used to resolve the applicable tax identifier per distribution.
  • ZX_RATES_B — Tax rate definitions used when deriving the recovery rate.
  • ZX_PO_REC_DIST — Target staging table receiving computed recovery information.
  • GL_LEDGERS, FINANCIALS_SYSTEM_PARAMS_ALL — Ledger and financials system parameter lookups that establish the accounting context; these are the objects most closely associated with the user's search term “gl_ledgers_u2”, an index on GL_LEDGERS used for efficient ledger retrieval.
  • XLA_UPGRADE_DATES — Subledger accounting upgrade date reference.
  • ZX_VALIDATION_ERRORS_GT — Global temporary table for capturing validation errors encountered during processing.
  • PLITBLM — Standard Oracle EBS utility package used for bulk DML and array manipulation.

Usage Notes

ZX_PO_REC_PKG is an internal EBTax processing package rather than a public API. It is invoked during tax recovery calculation for purchasing transactions, typically from concurrent programs and from other EBTax packages that orchestrate recovery processing; the ETRM metadata notes that it is referenced by two other packages. Direct custom invocation is not recommended, as the package relies on package-level global state and rowid-range batching that assume a controlled calling sequence. Developers integrating with EBTax tax recovery should use the supported EBTax APIs and configuration tables rather than calling ZX_PO_REC_PKG directly; where diagnostic work requires it, the rowid-range parameters of GET_REC_INFO make the package amenable to controlled, bounded test execution.