网上收集标准API展开BOM代码

BOM_EXPLOSION_temp是一个临时表,在展BOM的时候,是一个很有用的表,存放了组成料件层次。默认时是没有记录的,加入下列的语句:

DECLARE

l_group_id NUMBER;

l_error_message VARCHAR2(1000);

l_error_code NUMBER;

BEGIN

SELECT bom.bom_explosion_temp_s.NEXTVAL --取下一个序列

INTO l_group_id

FROM DUAL;

 

BEGIN

apps.bompexpl.exploder_userexit (verify_flag => NULL,

org_id => 122,

order_by => 1,

grp_id => l_group_id,

session_id => NULL,

levels_to_explode => 10, ----展开十层

bom_or_eng => 1,

impl_flag => 1,

plan_factor_flag => NULL,

explode_option => 2,

MODULE => 2,

cst_type_id => NULL,

std_comp_flag => 2,

expl_qty => 1,

item_id =>32523,--:inventory_item_id_parent, --- (select inventory_item_id from mtl_system_items_b where organization_id=89 and segment1='FWP14(A)-PLN'),

alt_desg => NULL,

comp_code => NULL,

rev_date => to_char(sysdate,'yyyy/mm/dd hh24:mi:ss'),--版本日期

err_msg => l_error_message,

ERROR_CODE => l_error_code);

COMMIT;

END;

 

dbms_output.put_line(l_error_code||l_error_message);

END;

---查询

select * from BOM_EXPLOSION_temp;


还有一种更加准确

DECLARE
  err_meg    VARCHAR2(100);
  ERROR_CODE VARCHAR2(100);
BEGIN
  bompxinq.exploder_userexit(verify_flag       => 0,
                             org_id            => 122,
                             order_by          => 1,
                             grp_id            => 0,
                             session_id        => 0,
                             levels_to_explode => 10,
                             bom_or_eng        => 1, -- 1 bom 2 eng
                             impl_flag 

你可能感兴趣的:(API)