Search Results mrpbv_plan_pegs




Overview

MRPBV_PLAN_PEGS is an APPS-owned read-only view within the Oracle E-Business Suite Master Scheduling/MRP (MRP) module. Its role is to expose pegging information from the planning engine in a reporting-friendly, oracle-internal-decode-free format. Pegging establishes the relationship between a supply and the demand it satisfies, and this view surfaces that relationship across a full planning run, allowing planners and integration developers to trace how a given supply order is linked to downstream demand. Unlike the underlying raw pegging table, the view resolves lookup codes into human-readable meanings and applies a security predicate on ORGANIZATION_ID. The view is defined WITH READ ONLY, meaning it cannot be used as a target for DML statements and is intended strictly for query and reporting access.

Underlying Base Objects

The view is defined over two documented base objects: MFG_LOOKUPS (a VIEW) and MRP_FULL_PEGGING (exposed through a SYNONYM). MFG_LOOKUPS is joined twice. The first join (LKUP) resolves the supply type by matching LOOKUP_TYPE = 'MRP_ORDER_TYPE' against the pegging row's SUPPLY_TYPE. The second join (LKUP2) derives a lookup type from the END_ORIGINATION_TYPE value using a DECODE expression. Where END_ORIGINATION_TYPE equals 1, 3, or 25, the type is set to 'MRP_PLANNED_ORDER_DEMAND'; for all other values it resolves to 'MRP_DEMAND_ORIGINATION'. This resolved lookup type is then matched against LKUP2.LOOKUP_TYPE, and the LOOKUP_CODE is matched against END_ORIGINATION_TYPE. Both MFG_LOOKUPS joins are outer joins, so pegging rows remain visible even when no matching lookup meaning exists. The primary fact source is MRP_FULL_PEGGING, the full pegging table that stores supply-to-demand linkages generated by the planning process across the entire plan horizon. The view's WHERE clause enforces a multi-org security predicate expressed as '_SEC:PEG.ORGANIZATION_ID' IS NOT NULL, which restricts results according to the organization security profile of the querying user.

Key Columns

Common Use Cases and Queries

The view supports pegging analysis where a planner or integration needs to trace supply back to originating demand, resolve the demand origination category, and restrict results by organization. A typical query joins the view to inventory item master data and filters by organization and item.

  • Retrieve pegging rows for a specific organization and item within a plan.
  • Identify the end origination type of the demand driving a supply order.
  • Walk the PEGGING_ID/PREV_PEGGING_ID chain to reconstruct a full pegging path.
  • Report allocated quantities against supply and demand dates for a planning run.

Sample SQL:

  • SELECT ORGANIZATION_ID, INVENTORY_ITEM_ID, SUPPLY_TYPE, DEMAND_QUANTITY, SUPPLY_QUANTITY, SUPPLY_DATE, DEMAND_DATE FROM APPS.MRPBV_PLAN_PEGS WHERE ORGANIZATION_ID = :org AND INVENTORY_ITEM_ID = :item;
  • SELECT PEGGING_ID, PREV_PEGGING_ID, END_PEGGING_ID, END_ORIGINATION_TYPE FROM APPS.MRPBV_PLAN_PEGS WHERE END_PEGGING_ID = :end_peg ORDER BY PEGGING_ID;

Because the view is read only and enforces organization security, queries must run under a valid organization-enabled responsibility, and results are automatically scoped to the organiz