|
|
发表于 2007/10/16 13:45:53
|
显示全部楼层
兄弟你这段程序只是取得是BOM的第一层,贡献我的:分解到无虚拟件的哪一层
Select Aa.Organization_Code 组织
,Aa.Segment1 装配件编码
,Aa.Description 装配件描述
,Msi.Segment1 组件编码
,Msi.Description 组件描述
,Msi.Primary_Uom_Code 单位
,Aa.Component_Quantity 数量
,Aa.Component_Remarks 工位
,Aa.Operation_Seq_Num 工序
,Aa.Supply_Subinventory 供应子库
,Decode(Aa.Wip_Supply_Type, 1, '推式', 2, '装配拉式', 3, '拉式工序', 4, '批量',
5, '供应商', 6, '虚拟件', 7,'基于物料清单', '未定义') 供应方式
,Aa.Level_Num 级别
From Mtl_System_Items_b Msi
,(Select Bom.Organization_Id ,Mp.Organization_Code,Msi.Segment1
,Msi.Description
,Bic.Component_Item_Id
,Bic.Component_Remarks
,Bic.Operation_Seq_Num
,Bic.Component_Quantity
,Bic.Supply_Subinventory
,Bic.Wip_Supply_Type
,Level Level_Num
From Bom_Structures_b Bom
,Bom_Components_b Bic
,Mtl_System_Items_b Msi
,Mtl_Parameters Mp
Where Bom.Bill_Sequence_Id = Bic.Bill_Sequence_Id
And Nvl(Bic.Disable_Date, Sysdate + 1) > Sysdate
And Bom.Organization_Id = Msi.Organization_Id
And Bom.Assembly_Item_Id = Msi.Inventory_Item_Id
And Bom.Organization_Id = Mp.Organization_Id
And Mp.Organization_Code = '&organization_code'
Start With Msi.Segment1 = '&Assembly_Item_Num' Connect By Prior Bic.Component_Item_Id = Bom.Assembly_Item_Id
And Prior Bic.Wip_Supply_Type = 6) Aa
Where Msi.Organization_Id = Aa.Organization_Id
And Msi.Inventory_Item_Id = Aa.Component_Item_Id
And Aa.Wip_Supply_Type <> 6
Order By Aa.Component_Remarks
,Msi.Segment1 |
|