DECLARE
lv_error_msg VARCHAR2(4000);
ln_error_code NUMBER;
BEGIN
bompexpl.exploder_userexit(verify_flag => NULL,
org_id
=> &gn_organization_id,
order_by => 1, --Op seq, item
seq
grp_id => &group_id,
session_id =>
NULL,
levels_to_explode => 100,
bom_or_eng => 1, --BOM
impl_flag
=> 1, --implemented only
plan_factor_flag => NULL,
explode_option => 2, --Current
module => 2,
--bom
cst_type_id => NULL,
std_comp_flag => 2, --all
components
expl_qty => 1,
item_id =>
&assembly_item_id,
alt_desg => NULL,
comp_code
=> NULL,
rev_date => NULL,
err_msg =>
lv_error_msg,
ERROR_CODE => ln_error_code);
END;
levels_to_explode 指定要展多少层。
结果存储在临时表bom_explosion_temp里。extended_quantity为1个bom需要多少个该组件
有时需要模拟工单组件物料需求展BOM,即只展第一层,遇到虚拟机继续向下展。可以先展所有层,然后用prior语句对临时表数据进行过滤
SELECT t.extended_quantity, t.component_item_id, t.group_id
FROM bom_explosion_temp t
WHERE 1 = 1
AND
wip_supply_type <> 6--Phantom
START WITH t.component_sequence_id
IS NULL
CONNECT BY t.sort_order LIKE PRIOR decode(t.wip_supply_type,
6, t.sort_order, NULL, t.sort_order, -99) || ‘%‘
AND
PRIOR plan_level = plan_level - 1
AND PRIOR group_id =
group_id