后来在报表群(52978459)网友的多次帮助,以及使用代理服务器*查询到一篇博文后终于能成功运行了。
其间还有一些小插曲,因为原来使用正向解BOM也有用到临时表,没有初始用户环境,但这个反解的不初始就没有结果,想起群中有位朋友说过,我就试了一下,居然出来了。
可能你觉得这些都不值一提,但是有时打错一个字母没任何提示,你可能两三天也找不出来原因。
好了,还是说重 点如何使用这个吧。
先把这个包的参数说明复制过来。
File Name : BOMPIINQ.sql |
| DESCRIPTION : This file is a packaged procedure for the imploders.
| This package contains 2 different imploders for the
| single level and multi level implosion. The package
| imploders calls the correct imploder based on the
| # of levels to implode.
| Parameters: org_id organization_id 组织ID
| sequence_id unique value to identify current implosion 这个不是解BOM的序号,是用查询产生的。
| use value from sequence bom_small_impl_temp_s
| levels_to_implode 反解BOM的层级
| eng_mfg_flag 1 - BOM 工程还是生产BOM
| 2 - ENG
| impl_flag 1 - implemented only 生效
| 2 - both impl and unimpl
| display_option 1 - All 所有(包含失效的 )
| 2 - Current 当前
| 3 - Current and future 当前和未来
| item_id item id of asembly to explode 低层物料就是起始物料
| impl_date explosion date dd-mon-rr hh24:mi
| err_msg error message out buffer 返回的错误信息
| error_code error code out. returns sql error code 返回的错误代码
| if sql error, 9999 if loop detected.
| organization_option 组织设定
| 1 - Current Organization
| 2 - Organization Hierarchy
| 3 - All Organizations to which access is allowed
| organization_hierarchy
| Organization Hierarchy Name
-----------------------------------------------------------------------------------------------------------
/*初始环境部份,根据你自已的环境设定*/
BEGIN
FND_GLOBAL.APPS_INITIALIZE(USER_ID =>1111 ,RESP_ID =>50276 ,RESP_APPL_ID =>401 );
END;
/*主程序部份*/
-----------------------------------------------------------------------------------------------------------------------------------------------------
declare
V_SEQUENCE_ID number;
v_err_msg VARCHAR2(80);
v_err_code NUMBER;
V_DATE VARCHAR2 (30);
begin
delete BOM_SMALL_IMPL_TEMP;
-- V_SEQUENCE_ID:=142354;
SELECT BOM_IMPLOSION_TEMP_S.NEXTVAL INTO V_SEQUENCE_ID FROM SYS.DUAL;
SELECT TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI') INTO V_DATE FROM DUAL;
BOMPIINQ.IMPLODER_USEREXIT (
SEQUENCE_ID => V_SEQUENCE_ID,
ENG_MFG_FLAG => 2,
ORG_ID => 106,
IMPL_FLAG => 2,
DISPLAY_OPTION => 1,
LEVELS_TO_IMPLODE => 15,
ITEM_ID =>52219, --34077520002
IMPL_DATE => V_DATE,
unit_number_from =>null,
unit_number_to=>null,
ERR_MSG => v_err_msg,
ERR_CODE =>v_err_code,
organization_option =>3,
organization_hierarchy =>null,
serial_number_from =>null,
serial_number_to =>null
);
end;
运行完成后你就可以使用
select * from BOM_SMALL_IMPL_TEMP 这个临时表了,如果没有数据先看看用户环境初始成功不。
[转载请保留]:IT网摘 http://www.itwz.net/IT/2011915/n96448381.html