SELECT
MS.Contract Site
,MS.Part_No
,IP.Description "Part Descripiton"
,IP.PART_STATUS "Part Status"
,MS.Alternative_No
,MS.ENG_CHG_LEVEL
,MS.EFF_PHASE_IN_DATE
,MS.Component_Part
,IPC.Description "Component Description"
,IPC.PART_STATUS "Component Status"
,PP.STAT_GRP
,PP.CF$_PURCHASE_PART_CAT_1 "Purchase Cat1"
,PP.CF$_PURCHASE_PART_CAT_2 "Purchase Cat2"
,PP.CF$_PURCHASE_PART_CAT_3 "Purchase Cat3"
,MS.QTY_PER_ASSEMBLY
,MS.CONSUMPTION_ITEM

FROM
MANUF_STRUCTURE MS 
inner join Purchase_Part_cfv PP on MS.Component_Part=PP.Part_No and MS.Contract=PP.Contract
inner join Inventory_Part IP on MS.Part_No=IP.Part_No and MS.Contract=IP.Contract
inner join Inventory_Part IPC on MS.Component_Part=IPC.Part_No and MS.Contract=IPC.Contract

WHERE
MS.EFF_PHASE_OUT_DATE is null
and IP.PART_STATUS in ('A','Q','D')
and MS.BOM_TYPE_DB in ('M')
and MS.CONTRACT LIKE '%&Site%'

and Report_SYS.Parse_Parameter(MS.Component_Part , Upper('&[-C-BL]Component_Part')) = 'TRUE'

and PP.STAT_GRP like NVL('&Purchase_Group','%')
and PP.CF$_PURCHASE_PART_CAT_1 like NVL('&Purchase_Cat1','%')
and PP.CF$_PURCHASE_PART_CAT_2 like NVL('&Purchase_Cat2','%')
and PP.CF$_PURCHASE_PART_CAT_3 like NVL('&Purchase_Cat3','%')

Order By 
MS.Contract
,PP.CF$_PURCHASE_PART_CAT_1
,PP.CF$_PURCHASE_PART_CAT_2
,MS.Part_No