DBA Data[Home] [Help]

VIEW: APPS.MSD_DP_PLANNING_PERCENTAGES_V

Source

View Text - Preformatted

SELECT pctg.demand_plan_id, pctg.dp_scenario_id, pctg.COMPONENT_SEQUENCE_ID, bomc.component_sequence_id, bom.BILL_SEQUENCE_ID, bom.SR_INSTANCE_ID, decode(mdp.use_org_specific_bom_flag, 'N', -1, bom.ORGANIZATION_ID), bomc.INVENTORY_ITEM_ID, bom.ASSEMBLY_ITEM_ID, pctg.DATE_TO, pctg.DATE_FROM, pctg.PLANNING_FACTOR, pctg.plan_percent_type from msc_boms bom, msc_bom_components bomc, msd_dp_scenarios mdc, msd_dp_planning_percentages pctg, MSC_ITEM_ID_LID ilid1, MSC_ITEM_ID_LID ilid2, msd_demand_plans mdp, msc_apps_instances mai WHERE bom.sr_instance_id = bomc.sr_instance_id and bom.plan_id = -1 and bom.bill_sequence_id = bomc.bill_sequence_id and bomc.plan_id = -1 and bomc.sr_instance_id = ilid1.sr_instance_id and bomc.inventory_item_id = ilid2.inventory_item_id and bomc.sr_instance_id = ilid1.sr_instance_id and bomc.using_assembly_id = ilid1.inventory_item_id and bomc.sr_instance_id = ilid2.sr_instance_id and bomc.organization_id = decode(mdp.use_org_specific_bom_flag, 'Y', to_number(decode(ltrim( pctg.sr_organization_pk, '.0123456789'), null, pctg.sr_organization_pk, -1)) , mai.validation_org_id) and to_number(decode(ltrim( pctg.instance, '.0123456789'), null, pctg.instance, -1))= ilid1.sr_instance_id and to_number(decode(ltrim(pctg.instance, '.0123456789'), null, pctg.instance, -1)) = ilid2.sr_instance_id and to_number(decode(ltrim( pctg.SR_COMPONENT_ITEM_PK, '.0123456789'), null,pctg.SR_COMPONENT_ITEM_PK, -1)) = ilid2.sr_inventory_item_id and to_number(decode(ltrim( pctg.sr_assembly_item_pk, '.0123456789'), null, pctg.sr_assembly_item_pk, -1)) = ilid1.sr_inventory_item_id and ( pctg.date_from between bomc.EFFECTIVITY_DATE and nvl(bomc.disable_date,pctg.date_from)) and bom.alternate_bom_designator is null and pctg.plan_percent_type = '1' and mdc.last_revision = pctg.revision and mdc.scenario_id = pctg.dp_scenario_id and mdc.demand_plan_id = pctg.demand_plan_id and pctg.instance = mai.instance_id and mdp.demand_plan_id = mdc.demand_plan_id and mai.instance_id = pctg.instance
View Text - HTML Formatted

SELECT PCTG.DEMAND_PLAN_ID
, PCTG.DP_SCENARIO_ID
, PCTG.COMPONENT_SEQUENCE_ID
, BOMC.COMPONENT_SEQUENCE_ID
, BOM.BILL_SEQUENCE_ID
, BOM.SR_INSTANCE_ID
, DECODE(MDP.USE_ORG_SPECIFIC_BOM_FLAG
, 'N'
, -1
, BOM.ORGANIZATION_ID)
, BOMC.INVENTORY_ITEM_ID
, BOM.ASSEMBLY_ITEM_ID
, PCTG.DATE_TO
, PCTG.DATE_FROM
, PCTG.PLANNING_FACTOR
, PCTG.PLAN_PERCENT_TYPE
FROM MSC_BOMS BOM
, MSC_BOM_COMPONENTS BOMC
, MSD_DP_SCENARIOS MDC
, MSD_DP_PLANNING_PERCENTAGES PCTG
, MSC_ITEM_ID_LID ILID1
, MSC_ITEM_ID_LID ILID2
, MSD_DEMAND_PLANS MDP
, MSC_APPS_INSTANCES MAI
WHERE BOM.SR_INSTANCE_ID = BOMC.SR_INSTANCE_ID
AND BOM.PLAN_ID = -1
AND BOM.BILL_SEQUENCE_ID = BOMC.BILL_SEQUENCE_ID
AND BOMC.PLAN_ID = -1
AND BOMC.SR_INSTANCE_ID = ILID1.SR_INSTANCE_ID
AND BOMC.INVENTORY_ITEM_ID = ILID2.INVENTORY_ITEM_ID
AND BOMC.SR_INSTANCE_ID = ILID1.SR_INSTANCE_ID
AND BOMC.USING_ASSEMBLY_ID = ILID1.INVENTORY_ITEM_ID
AND BOMC.SR_INSTANCE_ID = ILID2.SR_INSTANCE_ID
AND BOMC.ORGANIZATION_ID = DECODE(MDP.USE_ORG_SPECIFIC_BOM_FLAG
, 'Y'
, TO_NUMBER(DECODE(LTRIM( PCTG.SR_ORGANIZATION_PK
, '.0123456789')
, NULL
, PCTG.SR_ORGANIZATION_PK
, -1))
, MAI.VALIDATION_ORG_ID)
AND TO_NUMBER(DECODE(LTRIM( PCTG.INSTANCE
, '.0123456789')
, NULL
, PCTG.INSTANCE
, -1))= ILID1.SR_INSTANCE_ID
AND TO_NUMBER(DECODE(LTRIM(PCTG.INSTANCE
, '.0123456789')
, NULL
, PCTG.INSTANCE
, -1)) = ILID2.SR_INSTANCE_ID
AND TO_NUMBER(DECODE(LTRIM( PCTG.SR_COMPONENT_ITEM_PK
, '.0123456789')
, NULL
, PCTG.SR_COMPONENT_ITEM_PK
, -1)) = ILID2.SR_INVENTORY_ITEM_ID
AND TO_NUMBER(DECODE(LTRIM( PCTG.SR_ASSEMBLY_ITEM_PK
, '.0123456789')
, NULL
, PCTG.SR_ASSEMBLY_ITEM_PK
, -1)) = ILID1.SR_INVENTORY_ITEM_ID
AND ( PCTG.DATE_FROM BETWEEN BOMC.EFFECTIVITY_DATE
AND NVL(BOMC.DISABLE_DATE
, PCTG.DATE_FROM))
AND BOM.ALTERNATE_BOM_DESIGNATOR IS NULL
AND PCTG.PLAN_PERCENT_TYPE = '1'
AND MDC.LAST_REVISION = PCTG.REVISION
AND MDC.SCENARIO_ID = PCTG.DP_SCENARIO_ID
AND MDC.DEMAND_PLAN_ID = PCTG.DEMAND_PLAN_ID
AND PCTG.INSTANCE = MAI.INSTANCE_ID
AND MDP.DEMAND_PLAN_ID = MDC.DEMAND_PLAN_ID
AND MAI.INSTANCE_ID = PCTG.INSTANCE