Search Results report_primary_key




Overview

The APPS.AP_EXPENSE_REPORT_HISTORY_V view is a Payables (AP) reporting object that consolidates expense report history for display within Oracle Internet Expenses (OIE). Its central purpose is to expose a unified, query-ready record set describing expense reports, their associated invoices, payment status, and the amounts owed to employees and corporate credit card providers. The view reconciles data held in the expense report header tables with the corresponding invoice and payment schedule records, so that an expense report can be tracked end to end from submission through invoicing and payment.

Its Status is VALID and its Owner/Schema is APPS, meaning it is a standard seeded database object rather than a custom one. It is designed for read access from reporting and self-service layers, particularly the Expense Report History page in OIE, which relies on this view as its data source. Because it selects from both expense and Payables tables, it abstracts the join logic required to present a single history row per expense report, shielding callers from needing to navigate the underlying base objects themselves.

Underlying Base Objects

The view draws its columns from a documented set of base objects. Expense report context is sourced from AP_EXPENSE_REPORT_HEADERS (via synonym). Invoice and payment detail originate from AP_INVOICES and AP_PAYMENT_SCHEDULES, with AP_LOOKUP_CODES supplying status and displayed-field values. Person and employee data are resolved through PER_PEOPLE_X, HR_PERSON_NAME, HR_GENERAL, HR_SECURITY, and FND_GLOBAL, while currency formatting and amount display are handled by the FND_CURRENCY_CACHE and ICX_AP_INVOICES_PKG packages. Additional logic comes from AP_WEB_DB_HR_INT_PKG, AP_WEB_OA_ACTIVE_PKG, and PO_VENDORS.

Join behavior explains key semantics. The view uses NVL over invoice and header amounts, so a report may still display amounts where an invoice is not yet fully available. The DOCUMENT_TYPE literal value 'INVOICE' signals that history rows correspond to invoice documents.

Key Columns

Common Use Cases and Queries

A frequent scenario is retrieving a single expense report by its report primary key, then inspecting its invoicing and payment status:

  • SELECT report_primary_key, report_header_id, invoice_num, gross_amount, status FROM ap_expense_report_history_v WHERE report_primary_key = :invoice_id;
  • SELECT report_primary_key, invoice_num, amount_remaining, due_date FROM ap_expense_report_history_v WHERE source = 'WEBEXPENSE';
  • SELECT report_primary_key, employee_id, full_name, invoice_amount FROM ap_expense_report_history_v WHERE status = 'PAID';

These queries support expense audit, payment reconciliation, and self-service history pages. In each, REPORT_PRIMARY_KEY remains the reliable selector for a targeted record.