erp系統裡的bom展開函式:
l_grp_id number ;
l_session_id number ;
l_org_id number ;
l_levels_to_explode number := 10 ;
l_module number default 2 ; -- bom = 2
l_cst_type_id number default -1 ; -- all cost = -1 else 0
l_item_id number ;
l_bom_or_eng number ;
l_using_req_quantity number ;
l_using_ass_dem_date date ;
l_rev_date varchar2(20):= to_char(bom_dt,'dd-mon-yy hh24:mi');
l_err_msg varchar2(250) ;
l_error_code number ;
begin
-- 首先要有乙個group id
select bom_explosion_temp_s.nextval
into l_grp_id
from dual ;
-- 其次要得到乙個session id
select bom_explosion_temp_session_s.nextval
into l_session_id
from dual ;
bompexpl.exploder_userexit(
verify_flag =>0,
org_id =>l_org_id,
order_by =>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,
plan_factor_flag =>2,
explode_option =>2, -- 2,
module =>l_module,
cst_type_id =>l_cst_type_id,
std_comp_flag =>2,
expl_qty =>1,
item_id =>l_item_id,
alt_desg =>'',
comp_code =>'',
rev_date =>l_rev_date,
err_msg =>l_err_msg,
error_code =>l_error_code
);end ;
執行結束後用以下語句得到結果.
select * from bom_explosion_temp bet
where bet.group_id = l_grp_id
erp系統裡的bom展開函式:
l_grp_id number ;
l_session_id number ;
l_org_id number ;
l_levels_to_explode number := 10 ;
l_module number default 2 ; -- bom = 2
l_cst_type_id number default -1 ; -- all cost = -1 else 0
l_item_id number ;
l_bom_or_eng number ;
l_using_req_quantity number ;
l_using_ass_dem_date date ;
l_rev_date varchar2(20):= to_char(bom_dt,'dd-mon-yy hh24:mi');
l_err_msg varchar2(250) ;
l_error_code number ;
begin
-- 首先要有乙個group id
select bom_explosion_temp_s.nextval
into l_grp_id
from dual ;
-- 其次要得到乙個session id
select bom_explosion_temp_session_s.nextval
into l_session_id
from dual ;
bompexpl.exploder_userexit(
verify_flag =>0,
org_id =>l_org_id,
order_by =>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,
plan_factor_flag =>2,
explode_option =>2, -- 2,
module =>l_module,
cst_type_id =>l_cst_type_id,
std_comp_flag =>2,
expl_qty =>1,
item_id =>l_item_id,
alt_desg =>'',
comp_code =>'',
rev_date =>l_rev_date,
err_msg =>l_err_msg,
error_code =>l_error_code
);end ;
執行結束後用以下語句得到結果.
select * from bom_explosion_temp bet
where bet.group_id = l_grp_id
BOM展開和反查函式
bom展開和反查函式cs15 css4 bom 展開 cs bom explosion mat bom explosion old version as of 3.0,use cs bom expl mat v2 cs bom expl mat v2 bom explosion for materi...
ERP中物料批號追蹤(BOM子件展開)
今天在寫乙個關於物料批號追蹤的乙個報表。我使用的是sql指令碼編寫的儲存過程。首先,我們先對業務情景模擬一下 1.物料批號追蹤。我面對的情況是 從乙個物料 批號開始入手,追蹤上下游單據。上游單據就不說了,很簡單,下游,就需要去追蹤工單,領料單,成品入庫單,銷貨單,一連串單據。可是成品的原料可能組成半...
ERP系統中與BOM有關的常用方法
一 bom展開 按任一父結點展開到最底層 以下寫乙個簡單的,視具體要求稍做修改即可。create table 表 levelid int,levelname char 2 parent int insert 表 select 1,aa 0 union all select 2 bb 1 union ...