Wednesday, 6 July 2016

Query to find BOM Components

44 comments
/*********************************************************
*PURPOSE: Query to find BOM Components *
 *AUTHOR: Amar Alam *
**********************************************************/

SELECT msi.segment1 "Parent material coding",
       msi.description "Parent item description",
       msi1.segment1 "Sub item code",
       msi1.description "Sub item description"
  FROM mtl_system_items_b msi,
       bom_bill_of_materials bom,
       bom_inventory_components bic,
       mtl_system_items_b msi1
 WHERE     1 = 1
       AND msi.organization_id = 91
       AND msi.inventory_item_id = bom.assembly_item_id
       AND msi.organization_id = bom.organization_id
       AND bom.organization_id = 91
       AND bom.alternate_bom_designator IS NULL
       AND bom.bill_sequence_id = bic.bill_sequence_id
       AND bic.disable_date IS NULL
       AND bic.component_item_id = msi1.inventory_item_id
       AND msi1.organization_id = 91
       AND msi.segment1 IN ('00603141A48R')         -- Parent Item
--   AND msi1.segment1 in ('MD150') -- The child

Thanks
Amar Alam

Query to find Item Cost in Oracle Apps

18 comments
/*********************************************************
*PURPOSE: Query to find Item Cost *
*AUTHOR: Amar Alam *
 **********************************************************/

SELECT msi.segment1 "ITEM_NAME",
       msi.inventory_item_id,
       cic.item_cost,
       mp.organization_code,
       mp.organization_id,
       cct.cost_type,
       cct.description,
       cic.tl_material,
       cic.tl_material_overhead,
       cic.material_cost,
       cic.material_overhead_cost,
       cic.tl_item_cost,
       cic.unburdened_cost,
       cic.burden_cost
  FROM cst_cost_types cct,
       cst_item_costs cic,
       mtl_system_items_b msi,
       mtl_parameters mp
 WHERE     cct.cost_type_id = cic.cost_type_id
       AND cic.inventory_item_id = msi.inventory_item_id
       AND cic.organization_id = msi.organization_id
       AND msi.organization_id = mp.organization_id
       AND msi.inventory_item_id = 5014
       AND mp.organization_id = 93
       AND cct.cost_type IN  ('Frozen','Pending','C16')

Thanks
Amar Alam