Search Results sales_account




Overview

ONT_PRT_CST_MARGIN_SUMMARY_V is a reporting view owned by the APPS schema within the Oracle E-Business Suite Order Management (ONT) product. Its purpose is to expose order-level profitability information by joining order management context (orders, lines, customers, sales representatives, and invoice references) with cost and margin data derived from the Cost Management (CST) schema. The view name carries the "PRT" designation commonly associated with Oracle's Profitability Manager and margin analysis features, indicating that it is intended as a supporting reporting object rather than a transactional entity.

The view presents a flattened, denormalized result set suitable for ad hoc queries, custom reports, Oracle Discoverer worksheets, Oracle Business Intelligence Publisher data models, and interface extracts. Because it is a view rather than a table, it stores no data itself; all content is materialized at query time from the underlying margin summary tables and a controlling build record.

Underlying Base Objects

The documented ETRM metadata lists two referenced base objects, both resolved as synonyms in the APPS schema:

  • CST_MARGIN_SUMMARY — the primary fact source supplying order lines, invoice lines, quantities, cost of goods sold, margin amounts, and margin percentages.
  • CST_MARGIN_BUILD — the build or run header that identifies a margin collection process instance and its date boundaries.

The view is defined as SELECT ... FROM CST_MARGIN_SUMMARY CMS, CST_MARGIN_BUILD CMB with the join condition CMS.BUILD_ID = CMB.BUILD_ID, restricted further by CMS.GL_DATE >= CMB.TO_DATE - 90 and a subquery that retains only the most recent build (CMS.BUILD_ID = (SELECT MAX(CMS.BUILD_ID) FROM CST_MARGIN_SUMMARY)). This construction ties every returned row to the latest margin build and limits the returned general ledger dates to a trailing ninety-day window, keeping result sets current and manageable.

Key Columns

The view exposes a broad set of identifiers, descriptors, and measures. Significant columns include:

Common Use Cases and Queries

Typical scenarios include margin analysis by customer, item, sales representative, or channel; reconciliation of invoiced revenue against cost of goods sold; and drill-down from order line to invoice and credit memo. A representative query retrieving the highest-margin lines for the most recent build is:

SELECT order_number, line_number, inventory_item_id,
       sold_to_customer_name, invoiced_amount,
       cogs_amount, margin, margin_pct
  FROM apps.ont_prt_cst_margin_summary_v
 WHERE margin_pct IS NOT NULL
 ORDER BY margin_pct DESC;

Because the view already filters to the latest build and a ninety-day GL window, callers do not need to add build selection logic. Queries intended for historical comparison should instead target CST_MARGIN_SUMMARY directly with an explicit BUILD_ID, since ONT_PRT_CST_MARGIN_SUMMARY_V always resolves to the most recent build. Users should also expect the view to be relatively expensive when queried without predicates, and should constrain by ORDER_NUMBER, CUSTOMER_ID, or GL_DATE where possible.