壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11091|回复: 10

有人能解释一下bompexpl.exploder_userexit吗

[复制链接]
发表于 2006/6/11 13:17:54 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
最近在做bom report,涉及到这个包,有人能解释一下每个参数吗
bompexpl.exploder_userexit(verify_flag => :verify_flag,
org_id => :rg_id,--organization_id
order_by => :rder_by,
grp_id => :grp_id,
session_id => :session_id,
levels_to_explode => :levels_to_explode,
bom_or_eng => :bom_or_eng,
impl_flag => :impl_flag,
plan_factor_flag => lan_factor_flag,
explode_option => :explode_option,
module => :module,
cst_type_id => :cst_type_id,
std_comp_flag => :std_comp_flag,
expl_qty => :expl_qty,
item_id => :item_id,
alt_desg => :alt_desg,
comp_code => :comp_code,
rev_date => :rev_date,
err_msg => :err_msg,
error_code => :error_code)
发表于 2006/6/11 14:41:23 | 显示全部楼层
查到的相关资料

BOMPEXPL.EXPLODER_USEREXIT(
VERIFY_FLAG => V_VERIFY_FLAG,
ORG_ID => V_ORG_ID,
ORDER_BY => V_ORDER_BY,
GRP_ID => V_GRP_ID,
SESSION_ID => V_SESSION_ID,
LEVELS_TO_EXPLODE => V_LEVELS_TO_EXPLODE,
BOM_OR_ENG => V_BOM_OR_ENG,
IMPL_FLAG => V_IMPL_FLAG,
PLAN_FACTOR_FLAG => V_PLAN_FACTOR_FLAG,
EXPLODE_OPTION => V_EXPLODE_OPTION,
MODULE => V_MODULE,
CST_TYPE_ID => V_CST_TYPE_ID,
STD_COMP_FLAG => V_STD_COMP_FLAG,
EXPL_QTY => V_EXPL_QTY,
ITEM_ID => V_ITEM_ID,
ALT_DESG => V_ALT_DESG,
COMP_CODE => V_COMP_CODE,
REV_DATE => V_REV_DATE,
ERR_MSG => V_ERR_MSG,
ERROR_CODE => V_ERROR_CODE);
我是用这个内部函数的,oracle标准bom展开,自己写的话,考虑不全,
原来我写的方式和上边思路差不多,但是没有考虑uom,所以用oracle这个是最准确的。
 楼主| 发表于 2006/6/12 09:23:42 | 显示全部楼层
您能告诉我每个参数具体的含义吗?
 楼主| 发表于 2006/6/12 16:31:27 | 显示全部楼层
唉,没人理我啊我自己贴一下我找到的资料
包题头的说明
| Parameters: org_id organization_id
| order_by 1 - Op seq, item seq
| 2 - Item seq, op seq
| grp_id unique value to identify current explosion
| use value from sequence bom_explosion_temp_s
| session_id unique value to identify current session
| use value from bom_explosion_temp_session_s
| levels_to_explode
| bom_or_eng 1 - BOM
| 2 - ENG
| impl_flag 1 - implemented only
| 2 - both impl and unimpl
| explode_option 1 - All
| 2 - Current
| 3 - Current and future
| module 1 - Costing
| 2 - Bom
| 3 - Order entry
| 4 - ATO
| 5 - WSM
| cst_type_id cost type id for costed explosion
| std_comp_flag 1 - explode only standard components
| 2 - all components
| expl_qty explosion quantity
| item_id item id of asembly to explode
| list_id unique id for lists in bom_lists for range
| report_option 1 - cost rollup with report
| 2 - cost rollup no report
| 3 - temp cost rollup with report
| cst_rlp_id rollup_id
| req_id request id
| prgm_appl_id program application id
| prg_id program id
| user_id user id
| lock_flag 1 - do not lock the table
| 2 - lock the table
| alt_rtg_desg alternate routing designator
| rollup_option 1 - single level rollup
| 2 - full rollup
| plan_factor_flag1 - Yes
| 2 - No
| incl_lt_flag 1 - Yes
| 2 - No
| alt_desg alternate bom designator
| rev_date explosion date YYYY/MM/DD HH24:MI:SS
| comp_code concatenated component code lpad 16
| err_msg error message out buffer
| error_code error code out. returns sql error code
| if sql error
 楼主| 发表于 2006/6/12 16:34:42 | 显示全部楼层
下面是我结合实际分析出来的包的含义
oracle 内置包,用于将表中数据以层次关系展开  将运行出的数据添加到零时表中

bompexpl.exploder_userexit(verify_flag => :verify_flag,
org_id => :rg_id,--organization_id           --用户输入的组织号
order_by => :rder_by,                       --1 - Op seq, item seq   
                                                            --2 - Item seq, op seq
grp_id => :grp_id,                     --unique value to identify current
                                                   explosion use
                        --value from sequence bom_explosion_temp_s      

session_id => :session_id,  --unique value to identify current                                            --                   session
                                        -- use value from
                                         -- bom_explosion_temp_session_s
         
levels_to_explode => :levels_to_explode,  - -展开层数
bom_or_eng => :bom_or_eng,                --1 - BOM; 2 - ENG
impl_flag => :impl_flag,                 -- 1 - implemented only
                                                         2 - both impl and unimpl

plan_factor_flag => lan_factor_flag, 默认2
explode_option => :explode_option,       -- 1 - All| 2 - Current| 3 - Current and future
module => :module,                    -- 1 - Costing| 2 - Bom| 3 - Order entry| 4 - ATO| 5 - WSM

cst_type_id => :cst_type_id,--cost type id for costed explosion
std_comp_flag => :std_comp_flag,--std_comp_flag 1 - explode only standard components
                                -- 2 - all components
                             
expl_qty => :expl_qty,   -- explosion quantity
item_id => :item_id,     --item id of assembly to explode--用户输入的库存号
alt_desg => :alt_desg,  ---alternate bom designator
comp_code => :comp_code, --concatenated component code lpad 16
rev_date => :rev_date,   -- explosion date YYYY/MM/DD HH24:MI:SS  ;一定要这个格式to_char(sysdate, 'YYYY/MM/DD HH24:MI:SS')
err_msg => :err_msg,     --error message out buffer返回错误信息               
error_code => :error_code--error code out.returns sql error code if sql error 返回错误代码

)
 楼主| 发表于 2006/6/12 16:35:49 | 显示全部楼层
请哪位好心的大虾帮忙将上面的资料补充完整,先谢拉
 楼主| 发表于 2006/7/6 14:12:51 | 显示全部楼层
create or replace procedure cux_svabom( p_inventory_item_id number,
                                      P_organization_id number) is
v_assembly_item           mtl_system_items.segment1%type;
v_assembly_item_id        mtl_system_items.inventory_item_id%type;
v_componet_item           mtl_system_items.segment1%type;
v_componet_item_id        mtl_system_items.inventory_item_id%type;
v_organization_id         mtl_system_items.organization_id%type;
v_componet_qty            bom_inventory_components.component_quantity%type;
v_sequence                                                          number:=0;

cursor cux_sva_bom  is
SELECT
distinct
msia.segment1 assembly_item,
msia.inventory_item_id assembly_item_id,
msid.segment1 component_item ,
bic.component_item_id,
msia.organization_id,
bic.component_quantity
FROM  mtl_system_items msia,
      bom_bill_of_materials bbom,--
      bom_inventory_components bic,--
      mtl_system_items msid
WHERE msia.inventory_item_id=bbom.assembly_item_id
AND bbom.organization_id=msia.organization_id
AND bbom.bill_sequence_id=bic.bill_sequence_id
AND bic.component_item_id=msid.inventory_item_id
AND msia.organization_id=msid.organization_id
AND bic.implementation_date is not null
AND nvl(bic.disable_date,sysdate)>=sysdate
AND msia.organization_id=P_organization_id
AND msia.inventory_item_id=p_inventory_item_id;
begin
v_sequence:=v_sequence+1;
for c_bom in cux_sva_bom Loop

v_assembly_item:=c_bom.assembly_item;
v_assembly_item_id:=c_bom.assembly_item_id;
v_componet_item:=c_bom.component_item;
v_componet_item_id:=c_bom.component_item_id;
v_organization_id:=c_bom.organization_id;
v_componet_qty:=c_bom.component_quantity;
cux_svabom( v_componet_item_id , v_organization_id );
insert into cux_bom_temp3
values(v_assembly_item,v_assembly_item_id,v_componet_item,v_componet_item_id,
v_organization_id,v_componet_qty,v_sequence);

end loop;
/*
OPEN cux_sva_bom;
Loop
FETCH cux_sva_bom into v_assembly_item,v_assembly_item_id,
v_componet_item,v_componet_item_id,v_organization_id,v_componet_qty;
-- DBMS_OUTPUT.PUT_LINE(v_assembly_item||v_componet_item);
EXIT when cux_sva_bom%NOTFOUND;
insert into cux_bom_temp3
values(v_assembly_item,v_assembly_item_id,v_componet_item,v_componet_item_id,
v_organization_id,v_componet_qty,v_sequence);
cux_svabom(v_componet_item_id,v_organization_id);

end loop;
close cux_sva_bom;*/
end cux_svabom;
 楼主| 发表于 2006/7/6 16:58:02 | 显示全部楼层
上面我做了一个PROCEDURE,但结果和用包做出来的结果差别很大,麻烦哪位高人帮忙看看
发表于 2006/7/10 12:14:46 | 显示全部楼层
studying!
 楼主| 发表于 2006/7/17 16:17:39 | 显示全部楼层

关于BOM总结

经过我对比研究,我推荐大家使用下面这个包,而不要用楼上的包bompexpl.exploder_userexit,这个包会减少数据,而bompxinq.exploder_userexit则不会。
bompxinq.exploder_userexit(
                                      verify_flag    =>0,
                                      org_id    =>p_org_id,----组织ID
                                      order_by    => 1,
                                      grp_id    =>n_grp_id,----分组ID
                                      session_id            =>0,
                                      levels_to_explode   =>10,
                                      bom_or_eng            =>1,
                                      impl_flag            =>1,
                                      plan_factor_flag=>2,
                                      explode_option =>2,
                                      module    =>2,
                                      cst_type_id            =>0,
                                      std_comp_flag=>0,
                                      expl_qty    =>1,
                                      item_id    =>p_item_id,----物料ID
                                      unit_number_from=>null,
                                      unit_number_to=>null,
                                      alt_desg    =>p_alt_desg,----替代项
                                      comp_code   =>'',
                                      rev_date    =>sysdate,
                                         show_rev              =>2,
                                      material_ctr          =>2,
                                      lead_time    =>2,
                                      err_msg    =>v_err_msg,
                                      error_code            =>n_error_code
                              );
发表于 2013/7/17 17:52:55 | 显示全部楼层
不错,很详细了,谢谢楼主
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 03:57 , Processed in 0.018204 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表