Search Results cst_margin_temp_pk




Overview

CST_MARGIN_TEMP is a table owned by the BOM schema within Oracle E-Business Suite, classified under the Bills of Material product family. Per the Oracle ETRM documentation, it is described as a "Margin analysis summary table for reporting purposes." Despite its name suggesting a temporary (GTT-style) construct, the object is documented as a persistent, VALID table in both Oracle EBS 12.1.1 and 12.2.2, and is referenced through a formal primary key constraint, CST_MARGIN_TEMP_PK. The table consolidates order, invoice, and cost-of-goods-sold information to support margin reporting and analysis, drawing together shipping, billing, returns (RMA), and receivables data into a single denormalized reporting structure.

From a Data Vault modeling perspective, the mined foreign key structure suggests this table behaves as a link entity. It records associations between sales orders (SO_HEADERS_ALL, SO_LINES_ALL), receivables transactions (RA_CUSTOMER_TRX_ALL, RA_CUSTOMER_TRX_LINES_ALL), order types, legal entities, and RMA lines, rather than acting purely as a descriptive satellite. Analysts should treat it as a transient or staging-style aggregate populated for a given build rather than a durable transaction-of-record table.

Key Information Stored

The documented schema contains 76 columns in the 12.1.1 model. The most operationally significant are summarized below.

Business-key candidates for uniqueness center on the combination of BUILD_ID plus the order/invoice identifiers (for example, HEADER_ID, LINE_ID, CUSTOMER_TRX_LINE_ID), although the documented primary key remains the surrogate BUILD_ID.

Common Use Cases and Queries

The principal use case is gross margin reporting by period, customer, item, channel, or legal entity. A typical aggregation groups the financial measures across period buckets:

  • Summarize margin by month: SELECT period_name_month, SUM(invoiced_amount), SUM(cogs_amount), SUM(margin) FROM bom.cst_margin_temp WHERE build_id = :p_build GROUP BY period_name_month;
  • Margin by customer class or sales channel to evaluate profitability segmentation.
  • Reconcile invoiced amounts against RA_CUSTOMER_TRX_LINES_ALL for a given CUSTOMER_TRX_LINE_ID, and against SO_LINES_ALL for order-side quantity and pricing checks.
  • Return/RMA impact analysis by joining RMA_LINE_ID to JAI_OM_OE_RMA_LINES to isolate credit-driven margin erosion.
  • Item-level margin trends using INVENTORY_ITEM_ID and ORGANIZATION_ID across PERIOD_SEQ markers for ranking or exception reporting.

Queries should always constrain on BUILD_ID, since the table is populated in discrete builds and may retain multiple generations of data.

Related Objects

  • SO_HEADERS_ALL — joined via HEADER_ID.
  • SO_LINES_ALL — joined via LINE_ID and PARENT_LINE_ID.
  • RA_CUSTOMER_TRX_ALL — joined via CUSTOMER_TRX_ID.
  • RA_CUSTOMER_TRX_LINES_ALL — joined via CUSTOMER_TRX_LINE_ID.
  • FV_LEGAL_ENTITIES — joined via LEGAL_ENTITY_ID.
  • SO_ORDER_TYPES_115_ALL — joined via ORDER_TYPE_ID.
  • JAI_OM_OE_RMA_LINES — joined via RMA_LINE_ID for return analysis.

These relationships confirm CST_MARGIN_TEMP as a cross-functional reporting bridge linking order management, receivables, and cost accounting data within the Oracle EBS margin analysis process.