--Bill Of materials Extract Queries
SELECT
m.organization_id,
m.segment1 assembly_item,
b.alternate_bom_designator,
--m.REVISION,
--b.assembly_item_id,
--b.bill_sequence_id assembly_bom_seqid,
c.item_num item_seq,
c.operation_seq_num,
m1.segment1 component_item,
c.component_quantity,
c.component_yield_factor,
(SELECT meaning FROM fnd_lookup_values WHERE lookup_type='WIP_SUPPLY'AND language ='US'AND lookup_code =c.wip_supply_type)supply_type,
c.supply_subinventory,
(SELECT segment1 FROM apps.mtl_item_locations WHERE organization_id = 1657 AND inventory_location_id =c.supply_locator_id)supply_locator,
c.check_atp,
c.component_remarks comments,
--c.component_item_id,
--c.bill_sequence_id component_bom_seqid
b.creation_date
FROM apps.bom_bill_of_materials b,
apps.mtl_system_items m,
apps.bom_inventory_components c,
apps.mtl_system_items m1
WHERE b.organization_id = 1657
AND b.assembly_item_id = m.inventory_item_id
AND c.component_item_id = m1.inventory_item_id
AND m1.organization_id = m.organization_id
AND c.bill_sequence_id = b.bill_sequence_id
--AND m.planning_make_buy_code = 1
AND m.enabled_flag = 'Y'
AND m.organization_id = b.organization_id
--AND m.segment1='A196298000'
AND to_date(trunc(b.creation_date))='02-SEP-14'
ORDER BY 2;
SELECT
m.organization_id,
m.segment1 assembly_item,
b.alternate_bom_designator,
--m.REVISION,
--b.assembly_item_id,
--b.bill_sequence_id assembly_bom_seqid,
c.item_num item_seq,
c.operation_seq_num,
m1.segment1 component_item,
c.component_quantity,
c.component_yield_factor,
(SELECT meaning FROM fnd_lookup_values WHERE lookup_type='WIP_SUPPLY'AND language ='US'AND lookup_code =c.wip_supply_type)supply_type,
c.supply_subinventory,
(SELECT segment1 FROM apps.mtl_item_locations WHERE organization_id = 1657 AND inventory_location_id =c.supply_locator_id)supply_locator,
c.check_atp,
c.component_remarks comments,
--c.component_item_id,
--c.bill_sequence_id component_bom_seqid
b.creation_date
FROM apps.bom_bill_of_materials b,
apps.mtl_system_items m,
apps.bom_inventory_components c,
apps.mtl_system_items m1
WHERE b.organization_id = 1657
AND b.assembly_item_id = m.inventory_item_id
AND c.component_item_id = m1.inventory_item_id
AND m1.organization_id = m.organization_id
AND c.bill_sequence_id = b.bill_sequence_id
--AND m.planning_make_buy_code = 1
AND m.enabled_flag = 'Y'
AND m.organization_id = b.organization_id
--AND m.segment1='A196298000'
AND to_date(trunc(b.creation_date))='02-SEP-14'
ORDER BY 2;