楼主: becher

BOM多階報表

[复制链接]
论坛徽章:
2
ERP板块每日发贴之星
日期:2005-04-09 01:01:37ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44
21#
发表于 2004-10-15 13:45 | 只看该作者

patch it

sorry to say :
             start  with    ebimj_kp_bom_explode_imj.start_explosion        (:errbuf,:retcode,null,null,253)

使用道具 举报

回复
论坛徽章:
0
22#
发表于 2005-9-5 14:47 | 只看该作者
kelvinsz ,您好!

   select parent_item,child_item,qty_per,lpad(' ',2*(level-1))|| child_item
from (select c.segment1 as parent_item,d.segment1 as child_item,
b.component_quantity as qty_per
from bom_bill_of_materials a,bom_inventory_components b,
mtl_system_items_b c,mtl_system_items_b d
where a.bill_sequence_id = b.bill_sequence_id
and a.assembly_item_id = c.inventory_item_id
and c.organization_id = ??
and b.component_item_id = d.inventory_item_id
and d.organization_id = ??)
start with parent_item = item
connect by prior child_item = parent_item
运行时报错: '无法连接connect  by ' , 能指出原因吗?谢谢!

使用道具 举报

回复
论坛徽章:
2
23#
发表于 2005-9-6 16:24 | 只看该作者
幫你頂一下哦

使用道具 举报

回复
论坛徽章:
1
ITPUB新首页上线纪念徽章
日期:2007-10-20 08:38:44
24#
发表于 2005-9-12 21:25 | 只看该作者
我也遇到了同样的问题,想请高手们指教,不知道还有没有更详细一点的资料

使用道具 举报

回复
论坛徽章:
0
25#
发表于 2005-9-24 22:28 | 只看该作者
最初由 mengxc 发布
[B]bom 中关键的是父编号和子编号
通过对这两个编码的递归来获取完整的结构。

需要三个临时表。表#T1和#T2,#T3,临时表最少三个字段,父编码、子编码、父含子数

#T3保存最后完整的递归信息。

1、首先应该知道顶,也就是最上边的那条。首先选择出这一条,存在#T1表中
   同时插入到#T3
2、以#T1表为子查询条件查出它的下级数据。 存在临时表#T2中。查询的条件为
    父编码 IN (select 子编码  from #T1)
   将#T2同时插入到#T3
3、删除临时表#T1
4、将临时表#T2的数据导入#T1,删除T2
5、从2过程重复 -进行循环递归。
6、结束条件为临时表#T1的数据为0

除了数据记录为0之外,建议增加循环深度控制,防止出现循环引用,当在那里。

除了关键的3个字段外可以增加其他字段,或者在最后输出进行直接的join [/B]


不知道效率怎么样.我们公司做的BOM 表也是用递归来装载BOM表.但是效率不高.

使用道具 举报

回复
论坛徽章:
0
26#
发表于 2005-9-26 18:58 | 只看该作者
请用递归SQL。网上一堆SQL,搜论坛也行的

使用道具 举报

回复
论坛徽章:
0
27#
发表于 2006-4-13 15:57 | 只看该作者

好标题

我鼎

使用道具 举报

回复
论坛徽章:
0
28#
发表于 2006-4-14 11:54 | 只看该作者
有两种方法,
第一种是调用 bompexpl.explosion_report
再找这个表 BOM_EXPLOSION_TEMP

第二种就是自己写 也需要创建一个表,每次判断临时表里是否有物料可以展开,采用循环调用单阶展开程序,直到所有物料展开。

使用道具 举报

回复
论坛徽章:
26
管理团队2006纪念徽章
日期:2006-04-16 22:44:45马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:18
29#
发表于 2006-4-15 23:42 | 只看该作者
declare  -- Call the procedure
out_code NUMBER;
out_message VARCHAR2(240);
grp_id          number;
session_id      number;

begin
select bom_explosion_temp_s.nextval into grp_id from dual;
select bom_explosion_temp_session_s.nextval into session_id from dual;
  bompexpl.exploder_userexit(verify_flag => 0,                      /*constant*/
                             org_id => 490,               /*org_id*/         
                             order_by => 1,                         /*constant*/
                             grp_id => grp_id,                      /*constant*/
                             session_id => session_id,              /*constant*/
                             levels_to_explode => 10,               /*constant*/
                             bom_or_eng => 1,                       /*constant*/
                             impl_flag => 1,                        /*constant*/
                             plan_factor_flag => 1,                 /*constant*/
                             explode_option => 3,                   /*constant*/
                             module => 2,                           /*constant*/
                             cst_type_id => 0,                      /*constant*/
                             std_comp_flag => 0,                    /*constant*/
                             expl_qty => 1,                         /*constant*/
                             item_id => 1055,             /*top_item_id*/
                             alt_desg => null,            /*alternate_bom_designator*/
                             comp_code => '',                       /*constant*/
                             rev_date => to_char(sysdate, 'YYYY/MM/DD HH24:MI'),  /*constant*/
                             err_msg => out_message ,                 /*constant*/
                             error_code => out_code);                 /*constant*/
commit;
end;

使用道具 举报

回复
论坛徽章:
26
管理团队2006纪念徽章
日期:2006-04-16 22:44:45马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:142012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:182012新春纪念徽章
日期:2012-02-13 15:11:18
30#
发表于 2006-4-15 23:43 | 只看该作者
然后去bom_explosion_temp查询结果

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表