bompexpl.exploder_userexit 标准展BOM

  l_levels_to_explode NUMBER;
    l_module            NUMBER DEFAULT 2; -- bom = 2
    l_cst_type_id       NUMBER DEFAULT - 1; -- all cost = -1 else 0
    -- l_item_id           NUMBER;
    -- l_organization_id   NUMBER;
    l_bom_or_eng NUMBER := 1; --1 bom 2 eng
    l_rev_date   VARCHAR2(30) := to_char(SYSDATE,
                                         'yyyy/mm/dd hh24 :mi :ss'); --Must be this
    l_err_msg    VARCHAR2(250);
    l_error_code NUMBER;

 SELECT bom_explosion_temp_s.nextval
        INTO l_grp_id
        FROM dual;
      SELECT bom_explosion_temp_session_s.nextval
        INTO l_session_id
        FROM dual;
      SELECT maximum_bom_level
        INTO l_levels_to_explode
        FROM bom_parameters
       WHERE organization_id = rec.organization_id;
      DELETE bom.bom_explosion_temp;
      bompexpl.exploder_userexit(verify_flag       => 0, -- DEFAULT 0
                                 org_id            => rec.organization_id,
                                 order_by          => 1, -- DEFAULT 1
                                 grp_id            => l_grp_id,
                                 session_id        => l_session_id,
                                 levels_to_explode => l_levels_to_explode,
                                 bom_or_eng        => l_bom_or_eng,
                                 impl_flag         => 1, -- DEFAULT 1
                                 plan_factor_flag  => 2, -- DEFAULT 2
                                 explode_option    => 1, -- DEFAULT 2
                                 module            => l_module, -- DEFAULT 2
                                 cst_type_id       => l_cst_type_id,
                                 std_comp_flag     => 0,
                                 expl_qty          => 1, -- DEFAULT 1
                                 item_id           => rec.assembly_item_id,
                                 alt_desg          => '',
                                 comp_code         => '',
                                 rev_date          => l_rev_date,
                                 err_msg           => l_err_msg,
                                 ERROR_CODE        => l_error_code);

SELECT --CUX_BOM_BILL_COMPONENTS_ALL_s.Nextval,
                      trunc(l_raise_date) raise_date, --生成日期
                      bet.top_item_id, --顶层物料id
                      bet.organization_id, --组织id
                      bet.assembly_item_id, --父物料id
                      msib.segment1 parent_item_code, --父物料名称
                      msib.description parent_item_desc, --父物料描述
                      msib.attribute1 parent_item_model, --父物料机型
                      bet.component_item_id, --自物料id
                      msib2.segment1 component_item_code, --子物料名称
                      msib2.description component_item_desc, --子物料描述
                      NULL component_item_class_code, --子物料分类代码
                      NULL component_item_class_dsp, --子物料分类名称
                      bet.item_num, --序号
                      bet.operation_seq_num, --工序
                      bet.component_quantity, --组件用量
                      bet.component_yield_factor, ----产出率
                      pasv.vendor_id vendor_id,
                      pasv.vendor_name vendor_name,
                      pasv.allocation_percent, --补充来源比例
                      pasv.allocation_percent * bet.component_quantity / 100 actual_component_quantity, --供应商实际用量
                      bet.sort_order,
                      bet.effectivity_date, --组件生效开始日期
                      bet.disable_date --组件生效结束日期
                       FROM bom_explosion_temp bet

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值