DBA Data[Home] [Help]

VIEW: APPS.WIPFV_FLOW_SCHED_COMPS

Source

View Text - Preformatted

SELECT organization_code , organization_name , mfg_order_name , operation_sequence_number , sum(required_quantity) , sum(completed_quantity) , wip_entity_id , component_sequence_id , inventory_item_id , organization_id FROM ( SELECT para.organization_code organization_code , org.name organization_name , ent.wip_entity_name mfg_order_name , expl.operation_seq_num operation_sequence_number , expl.component_quantity * flow.planned_quantity required_quantity , 0 completed_quantity , flow.wip_entity_id wip_entity_id , expl.component_sequence_id component_sequence_id , expl.component_item_id inventory_item_id , flow.organization_id FROM mtl_parameters para , hr_all_organization_units org , wip_entities ent , wip_flow_schedules flow , mtl_system_items sys , bom_inventory_components comp , bom_explosions expl , bom_bill_of_materials bbm WHERE sys.planning_make_buy_code = 1 and bbm.organization_id = sys.organization_id and comp.component_item_id = sys.inventory_item_id and comp.component_item_id = expl.component_item_id and comp.bill_sequence_id = expl.bill_sequence_id and bbm.organization_id = flow.organization_id and bbm.assembly_item_id = flow.primary_item_id and ( NVL(bbm.alternate_bom_designator, 'ABD756fhh466') = NVL(flow.alternate_bom_designator, 'ABD756fhh466') or ( bbm.alternate_bom_designator is null and not exists (select null from bom_bill_of_materials bbm1 where bbm1.alternate_bom_designator = flow.alternate_bom_designator and bbm1.organization_id = bbm.organization_id and bbm1.assembly_item_id = bbm.assembly_item_id)) ) and bbm.common_bill_sequence_id = expl.bill_sequence_id and expl.assembly_item_id is not null and expl.effectivity_date <= trunc(flow.scheduled_start_date) and expl.disable_date > trunc(flow.scheduled_start_date) and expl.explosion_type = 'ALL' and flow.wip_entity_id = ent.wip_entity_id and para.organization_id = flow.organization_id and org.organization_id = flow.organization_id and '_SEC:flow.organization_id' IS NOT NULL UNION ALL SELECT para.organization_code organization_code , org.name organization_name , ent.wip_entity_name mfg_order_name , mtl.operation_seq_num operation_sequence_number , 0 required_quantity , (mtl.transaction_quantity * -1) completed_quantity , flow.wip_entity_id wip_entity_id , comp.component_sequence_id component_sequence_id , mtl.inventory_item_id inventory_item_id , flow.organization_id organization_id FROM mtl_parameters para , hr_all_organization_units org , bom_inventory_components comp , mtl_system_items sys , mtl_material_transactions mtl , wip_entities ent , wip_flow_schedules flow WHERE flow.wip_entity_id = ent.wip_entity_id and mtl.transaction_source_id = ent.wip_entity_id and mtl.transaction_action_id in (1,27) and comp.bill_sequence_id(+) = mtl.common_bom_seq_id and comp.operation_seq_num(+) = mtl.operation_seq_num and comp.component_item_id(+) = mtl.inventory_item_id and sys.inventory_item_id = mtl.inventory_item_id and sys.organization_id = mtl.organization_id and para.organization_id = mtl.organization_id and org.organization_id = mtl.organization_id AND '_SEC:mtl.organization_id' IS NOT NULL ) GROUP BY organization_code , organization_name , mfg_order_name , operation_sequence_number , wip_entity_id , component_sequence_id , inventory_item_id , organization_id WITH READ ONLY
View Text - HTML Formatted

SELECT ORGANIZATION_CODE
, ORGANIZATION_NAME
, MFG_ORDER_NAME
, OPERATION_SEQUENCE_NUMBER
, SUM(REQUIRED_QUANTITY)
, SUM(COMPLETED_QUANTITY)
, WIP_ENTITY_ID
, COMPONENT_SEQUENCE_ID
, INVENTORY_ITEM_ID
, ORGANIZATION_ID
FROM ( SELECT PARA.ORGANIZATION_CODE ORGANIZATION_CODE
, ORG.NAME ORGANIZATION_NAME
, ENT.WIP_ENTITY_NAME MFG_ORDER_NAME
, EXPL.OPERATION_SEQ_NUM OPERATION_SEQUENCE_NUMBER
, EXPL.COMPONENT_QUANTITY * FLOW.PLANNED_QUANTITY REQUIRED_QUANTITY
, 0 COMPLETED_QUANTITY
, FLOW.WIP_ENTITY_ID WIP_ENTITY_ID
, EXPL.COMPONENT_SEQUENCE_ID COMPONENT_SEQUENCE_ID
, EXPL.COMPONENT_ITEM_ID INVENTORY_ITEM_ID
, FLOW.ORGANIZATION_ID
FROM MTL_PARAMETERS PARA
, HR_ALL_ORGANIZATION_UNITS ORG
, WIP_ENTITIES ENT
, WIP_FLOW_SCHEDULES FLOW
, MTL_SYSTEM_ITEMS SYS
, BOM_INVENTORY_COMPONENTS COMP
, BOM_EXPLOSIONS EXPL
, BOM_BILL_OF_MATERIALS BBM
WHERE SYS.PLANNING_MAKE_BUY_CODE = 1
AND BBM.ORGANIZATION_ID = SYS.ORGANIZATION_ID
AND COMP.COMPONENT_ITEM_ID = SYS.INVENTORY_ITEM_ID
AND COMP.COMPONENT_ITEM_ID = EXPL.COMPONENT_ITEM_ID
AND COMP.BILL_SEQUENCE_ID = EXPL.BILL_SEQUENCE_ID
AND BBM.ORGANIZATION_ID = FLOW.ORGANIZATION_ID
AND BBM.ASSEMBLY_ITEM_ID = FLOW.PRIMARY_ITEM_ID
AND ( NVL(BBM.ALTERNATE_BOM_DESIGNATOR
, 'ABD756FHH466') = NVL(FLOW.ALTERNATE_BOM_DESIGNATOR
, 'ABD756FHH466') OR ( BBM.ALTERNATE_BOM_DESIGNATOR IS NULL
AND NOT EXISTS (SELECT NULL
FROM BOM_BILL_OF_MATERIALS BBM1
WHERE BBM1.ALTERNATE_BOM_DESIGNATOR = FLOW.ALTERNATE_BOM_DESIGNATOR
AND BBM1.ORGANIZATION_ID = BBM.ORGANIZATION_ID
AND BBM1.ASSEMBLY_ITEM_ID = BBM.ASSEMBLY_ITEM_ID)) )
AND BBM.COMMON_BILL_SEQUENCE_ID = EXPL.BILL_SEQUENCE_ID
AND EXPL.ASSEMBLY_ITEM_ID IS NOT NULL
AND EXPL.EFFECTIVITY_DATE <= TRUNC(FLOW.SCHEDULED_START_DATE)
AND EXPL.DISABLE_DATE > TRUNC(FLOW.SCHEDULED_START_DATE)
AND EXPL.EXPLOSION_TYPE = 'ALL'
AND FLOW.WIP_ENTITY_ID = ENT.WIP_ENTITY_ID
AND PARA.ORGANIZATION_ID = FLOW.ORGANIZATION_ID
AND ORG.ORGANIZATION_ID = FLOW.ORGANIZATION_ID
AND '_SEC:FLOW.ORGANIZATION_ID' IS NOT NULL UNION ALL SELECT PARA.ORGANIZATION_CODE ORGANIZATION_CODE
, ORG.NAME ORGANIZATION_NAME
, ENT.WIP_ENTITY_NAME MFG_ORDER_NAME
, MTL.OPERATION_SEQ_NUM OPERATION_SEQUENCE_NUMBER
, 0 REQUIRED_QUANTITY
, (MTL.TRANSACTION_QUANTITY * -1) COMPLETED_QUANTITY
, FLOW.WIP_ENTITY_ID WIP_ENTITY_ID
, COMP.COMPONENT_SEQUENCE_ID COMPONENT_SEQUENCE_ID
, MTL.INVENTORY_ITEM_ID INVENTORY_ITEM_ID
, FLOW.ORGANIZATION_ID ORGANIZATION_ID
FROM MTL_PARAMETERS PARA
, HR_ALL_ORGANIZATION_UNITS ORG
, BOM_INVENTORY_COMPONENTS COMP
, MTL_SYSTEM_ITEMS SYS
, MTL_MATERIAL_TRANSACTIONS MTL
, WIP_ENTITIES ENT
, WIP_FLOW_SCHEDULES FLOW
WHERE FLOW.WIP_ENTITY_ID = ENT.WIP_ENTITY_ID
AND MTL.TRANSACTION_SOURCE_ID = ENT.WIP_ENTITY_ID
AND MTL.TRANSACTION_ACTION_ID IN (1
, 27)
AND COMP.BILL_SEQUENCE_ID(+) = MTL.COMMON_BOM_SEQ_ID
AND COMP.OPERATION_SEQ_NUM(+) = MTL.OPERATION_SEQ_NUM
AND COMP.COMPONENT_ITEM_ID(+) = MTL.INVENTORY_ITEM_ID
AND SYS.INVENTORY_ITEM_ID = MTL.INVENTORY_ITEM_ID
AND SYS.ORGANIZATION_ID = MTL.ORGANIZATION_ID
AND PARA.ORGANIZATION_ID = MTL.ORGANIZATION_ID
AND ORG.ORGANIZATION_ID = MTL.ORGANIZATION_ID
AND '_SEC:MTL.ORGANIZATION_ID' IS NOT NULL ) GROUP BY ORGANIZATION_CODE
, ORGANIZATION_NAME
, MFG_ORDER_NAME
, OPERATION_SEQUENCE_NUMBER
, WIP_ENTITY_ID
, COMPONENT_SEQUENCE_ID
, INVENTORY_ITEM_ID
, ORGANIZATION_ID WITH READ ONLY