ORACLE EBS BOM 展开(使用标准程序bompexpl.exploder_userexit展开)

create or replace package cux_bom_pub is

PROCEDURE bom_expand_to_temp(
p_organization_id number,

p_item_id VARCHAR2,
p_levels_to_explode NUMBER);
end cux_bom_pub;

create or replace package body cux_bom_pub is
--g_session_id NUMBER;

g_bom_cnt NUMBER := 0;
PROCEDURE bom_expand_to_temp(

p_organization_id number,
p_item_id VARCHAR2,
p_levels_to_explode
NUMBER) IS
-- PRAGMA AUTONOMOUS_TRANSACTION;
--v_cnt number;

l_grp_id number ;
l_session_id number ;
-- l_org_id
number ;
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_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 ;
-- l_cnt 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 ;

-- Find item_id
l_item_id := p_item_id;
/*select
inventory_item_id
into l_item_id
from mtl_system_items_b --
mtl_item_flexfields
where organization_id = p_organization_id and
segment1 = p_item_no;
*/
-- determine maximum levels to explode from
bom_explosions
IF p_levels_to_explode IS NULL THEN
select
maximum_bom_level
into l_levels_to_explode
from
bom_parameters
where organization_id = p_organization_id;

ELSE
l_levels_to_explode := p_levels_to_explode;
END IF;

delete bom.bom_explosion_temp;-- where top_item_id =l_item_id;

--delete bom_explosion_temp;
-- commit;

bompexpl.exploder_userexit(

verify_flag =>0, -- DEFAULT 0
org_id
=>p_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 =>2,
-- 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 =>l_item_id,
alt_desg =>‘‘,

comp_code =>‘‘,

rev_date =>l_rev_date,
err_msg
=>l_err_msg,
error_code
=>l_error_code
);

if ( l_error_code <> 0 ) then
-- rollback;

dbms_output.put_line(‘ERROR: ‘ || l_err_msg);
else

INSERT
INTO cux_explosion_temp(
top_bill_sequence_id ,

bill_sequence_id ,
organization_id ,

component_sequence_id ,
component_item_id ,

plan_level ,
extended_quantity ,

sort_order ,
request_id ,

program_application_id ,
program_id ,

program_update_date ,
group_id ,

session_id ,
select_flag ,

select_quantity ,
extend_cost_flag
,
top_alternate_designator ,
top_item_id
,
context ,
attribute1
,
attribute2 ,
attribute3
,
attribute4 ,
attribute5
,
attribute6 ,
attribute7
,
attribute8 ,
attribute9
,
attribute10 ,
attribute11
,
attribute12 ,
attribute13
,
attribute14 ,
attribute15
,
header_id ,
line_id
,
list_price ,
selling_price
,
component_yield_factor ,
item_cost
,
include_in_rollup_flag ,

based_on_rollup_flag ,
actual_cost_type_id ,

component_quantity ,
shrinkage_rate ,

so_basis ,
optional ,

mutually_exclusive_options ,
check_atp ,

shipping_allowed ,
required_to_ship ,

required_for_revenue ,
include_on_ship_docs ,

include_on_bill_docs ,
low_quantity ,

high_quantity ,
pick_components
,
primary_uom_code ,
primary_unit_of_measure
,
base_item_id ,
atp_components_flag
,
atp_flag ,
bom_item_type
,
pick_components_flag ,
replenish_to_order_flag
,
shippable_item_flag ,
customer_order_flag
,
internal_order_flag ,

customer_order_enabled_flag ,
internal_order_enabled_flag ,

so_transactions_flag ,
mtl_transactions_enabled_flag,

stock_enabled_flag ,
description ,

assembly_item_id ,
alternate_bom_designator ,

configurator_flag ,
price_list_id ,

rounding_factor ,
pricing_context ,

pricing_attribute1 ,
pricing_attribute2
,
pricing_attribute3 ,
pricing_attribute4
,
pricing_attribute5 ,
pricing_attribute6
,
pricing_attribute7 ,
pricing_attribute8
,
pricing_attribute9 ,
pricing_attribute10
,
pricing_attribute11 ,
pricing_attribute12
,
pricing_attribute13 ,
pricing_attribute14
,
pricing_attribute15 ,
component_code
,
loop_flag ,

inventory_asset_flag ,
planning_factor ,

operation_seq_num ,
parent_bom_item_type ,

wip_supply_type ,
item_num ,

effectivity_date ,
disable_date ,

implementation_date ,
supply_subinventory ,

supply_locator_id ,
component_remarks ,

change_notice ,
operation_lead_time_percent ,

rexplode_flag ,
common_bill_sequence_id
,
common_organization_id ,
primary_path_flag
,
auto_request_material ,
explosion_type
,
creation_date ,
created_by
,
last_update_date ,
last_updated_by
,
comp_bill_seq_id ,

comp_common_bill_seq_id ,
num_col1 ,

num_col2 ,
num_col3 ,

date_col1 ,
date_col2 ,

date_col3 ,
char_col1 ,

char_col2 ,
char_col3 ,

include_in_cost_rollup ,
parent_sort_order ,

structure_type_id ,
obj_name ,

pk1_value ,
pk2_value
,
pk3_value ,
pk4_value
,
pk5_value ,
hgrid_flag
,
operation_offset ,
current_revision
,
locator ,
suggested_vendor_name
,
unit_price ,
vendor_id
,
from_end_item_unit_number ,

to_end_item_unit_number ,
from_end_item_rev_id ,

from_end_item_minor_rev_id ,
to_end_item_rev_id ,

to_end_item_minor_rev_id ,
new_component_code ,

from_bill_revision_id ,
to_bill_revision_id ,

revision_id ,
revision_label ,

effectivity_control ,
access_flag ,

eng_item_flag ,
assembly_type ,

from_object_revision_id ,
from_minor_revision_id
,
to_object_revision_id ,
to_minor_revision_id
,
object_revision_id ,
minor_revision_id
,
minor_revision_code ,

component_item_revision_id ,
component_minor_revision_id ,

bom_implementation_date ,
gtin_number ,

gtin_description ,
trade_item_descriptor ,

top_gtin_number ,
top_gtin_description ,

top_trade_item_descriptor ,
parent_gtin_number ,

parent_gtin_description ,
parent_trade_item_descriptor,

trade_item_descriptor_desc ,
gtin_publication_status ,

quantity_of_children ,
total_qty_at_next_level
,
change_id ,
acd_type
,
quantity_related ,
change_policy_value
,
exploded_date ,
exploded_unit_number
,
exploded_end_item_rev ,
exploded_option
,
basis_type)
SELECT top_bill_sequence_id,

bill_sequence_id ,
organization_id ,

component_sequence_id ,
component_item_id ,
plan_level
,
extended_quantity ,
sort_order
,
request_id ,
program_application_id
,
program_id ,
program_update_date ,

group_id ,
session_id ,

select_flag ,
select_quantity ,

extend_cost_flag ,
top_alternate_designator ,

top_item_id ,
context ,
attribute1
,
attribute2 ,
attribute3
,
attribute4 ,
attribute5
,
attribute6 ,
attribute7 ,

attribute8 ,
attribute9 ,

attribute10 ,
attribute11 ,

attribute12 ,
attribute13 ,

attribute14 ,
attribute15 ,
header_id
,
line_id ,
list_price
,
selling_price ,
component_yield_factor
,
item_cost ,
include_in_rollup_flag ,

based_on_rollup_flag ,
actual_cost_type_id ,

component_quantity ,
shrinkage_rate ,
so_basis
,
optional ,

mutually_exclusive_options ,
check_atp ,

shipping_allowed ,
required_to_ship ,

required_for_revenue ,
include_on_ship_docs ,

include_on_bill_docs ,
low_quantity ,

high_quantity ,
pick_components ,

primary_uom_code ,
primary_unit_of_measure ,

base_item_id ,
atp_components_flag ,
atp_flag
,
bom_item_type ,
pick_components_flag
,
replenish_to_order_flag ,
shippable_item_flag
,
customer_order_flag ,
internal_order_flag ,

customer_order_enabled_flag ,
internal_order_enabled_flag ,

so_transactions_flag ,
mtl_transactions_enabled_flag,

stock_enabled_flag ,
description ,

assembly_item_id ,
alternate_bom_designator ,

configurator_flag ,
price_list_id ,

rounding_factor ,
pricing_context ,

pricing_attribute1 ,
pricing_attribute2 ,

pricing_attribute3 ,
pricing_attribute4 ,

pricing_attribute5 ,
pricing_attribute6 ,

pricing_attribute7 ,
pricing_attribute8 ,

pricing_attribute9 ,
pricing_attribute10 ,

pricing_attribute11 ,
pricing_attribute12 ,

pricing_attribute13 ,
pricing_attribute14 ,

pricing_attribute15 ,
component_code ,
loop_flag
,
inventory_asset_flag ,
planning_factor
,
operation_seq_num ,
parent_bom_item_type
,
wip_supply_type ,
item_num ,

effectivity_date ,
disable_date ,

implementation_date ,
supply_subinventory ,

supply_locator_id ,
component_remarks ,

change_notice ,
operation_lead_time_percent ,

rexplode_flag ,
common_bill_sequence_id ,

common_organization_id ,
primary_path_flag ,

auto_request_material ,
explosion_type ,

creation_date ,
created_by ,

last_update_date ,
last_updated_by ,

comp_bill_seq_id ,
comp_common_bill_seq_id ,
num_col1
,
num_col2 ,
num_col3
,
date_col1 ,
date_col2
,
date_col3 ,
char_col1 ,

char_col2 ,
char_col3 ,

include_in_cost_rollup ,
parent_sort_order ,

structure_type_id ,
obj_name ,
pk1_value
,
pk2_value ,
pk3_value
,
pk4_value ,
pk5_value
,
hgrid_flag ,
operation_offset ,

current_revision ,
locator ,

suggested_vendor_name ,
unit_price ,
vendor_id
,
from_end_item_unit_number ,

to_end_item_unit_number ,
from_end_item_rev_id ,

from_end_item_minor_rev_id ,
to_end_item_rev_id ,

to_end_item_minor_rev_id ,
new_component_code ,

from_bill_revision_id ,
to_bill_revision_id ,

revision_id ,
revision_label ,

effectivity_control ,
access_flag ,

eng_item_flag ,
assembly_type ,

from_object_revision_id ,
from_minor_revision_id ,

to_object_revision_id ,
to_minor_revision_id ,

object_revision_id ,
minor_revision_id ,

minor_revision_code ,
component_item_revision_id ,

component_minor_revision_id ,
bom_implementation_date ,

gtin_number ,
gtin_description ,

trade_item_descriptor ,
top_gtin_number ,

top_gtin_description ,
top_trade_item_descriptor ,

parent_gtin_number ,
parent_gtin_description ,

parent_trade_item_descriptor,
trade_item_descriptor_desc ,

gtin_publication_status ,
quantity_of_children ,

total_qty_at_next_level ,
change_id ,
acd_type
,
quantity_related ,
change_policy_value
,
exploded_date ,
exploded_unit_number
,
exploded_end_item_rev ,
exploded_option ,

basis_type
FROM bom_explosion_temp t;-- WHERE t.session_id =
l_session_id;
g_bom_cnt := g_bom_cnt + 1;
IF g_bom_cnt =
1000 THEN
commit;
g_bom_cnt := 0;
END IF;

end if;
COMMIT;
end;
end cux_bom_pub;

时间: 2024-08-26 12:18:00

ORACLE EBS BOM 展开(使用标准程序bompexpl.exploder_userexit展开)的相关文章

[转]oracle EBS 基础100问

from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 ORACLE EBS学习的其他资源有哪四个? 1002 ORACLE OPEN WORLD大会是不是一个市场营销活动? 1003 Oracle 大学有哪五种课程? 1004 多个责任分配给一个人,是多对一关系,还是一对多关系? 1005 一个责任分配给多个人,是什么样的关系? 1006 双+号和双-号,

Oracle EBS的BIP报表中显示特殊字体

http://oracleseeker.com/2009/08/25/font_mapping_setup_for_special_character_print_in_oracle_ebs_bip/ 如若在BIP报表中使用了一些特殊的字体,这些字体在JRE的字体库中没有的话,则BIP报表的运行结果就不正确,最典型的例子就是条码字体的打印. 如下图是我在rtf模板中使用code39字体设计的条码显示 但是在Oracle EBS环境下运行之后的结果如下,条码字体的格式丢失了: 这是由于FO引擎在生

Oracle EBS Model Function Technical

?.Oracle EBS(ERP)Oracle 是公司名字,这个我估计大家都知道.EBS是E-Business Suite的缩写,简单的说,就是Oracle做的一个企业级的信息化软件或者系统,里面包含了财务,人力,分销,资产等很多企业用的到的模块.现在主流的就是SAP和Oracle EBS.在EBS 顾问这个行业,粗略的有以下分工.?.Oracle EBS Function Consultant 功能顾问功能顾问呢,就是业务顾问,可以理解为普通软件行业的产品经理,主要是熟悉业务的同时也熟悉系统相

Oracle EBS 提示XX对当前用户不可用--XX is not a valid responsibility for the current user

Oracle EBS 提示XX对当前用户为不可用职责--XX is not a valid responsibility for the current user 最近在EBS中添加新职责进行切换没问题,但是要进入相关职责的Form或Web页面则会碰到如图的难题.解决方法是这样的. 1. 进入Functional Administrator职责. 2. 选择Core Services->Caching Framework->Global Configuration. 3. 分别Clear Al

Oracle EBS R12 - 怎样更改SYSADMIN的password

SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production PL/SQL Release 11.1.0.7.0 - Production CORE    11.1.0.7

Oracle EBS 采购 接收入库 接口开发

http://blog.itpub.net/25164132/viewspace-746657/ 接收入库是项目中会经常碰到的开发,这类开发一般来说比较简单,但是接收入库在Oracle中其实涉及到很多模块,其中层次较多,也可以做得比较复杂.本文将尽可能深入细致地讨论接收入库的流程,种类,数据来源,数据的流动路径,以及各个数据点之间的对应关系.最后将给出一个较为全面的接收入库的样例代码.接收入库的种类接收入库可以按照数据来源分为2种:1.         对于po订单以及发放的接收入库:2.   

如何启用Oracle EBS Form监控

前言: 有时候,因某些需要,必须知道Oracle的Form被使用的情况,以方面我们做出决策: 例如,如果某个Form被使用的次数非常多,那么,这个Form的相关SQL代码就应该优先处理,以减少服务器负荷,从而提供系统运行速度. 或者,(特别是)在系统要升级的时候,这些数据就显得非常重要了:决定哪个Form应该留,哪个Form应该拿掉. 当然,这个信息只是做出决策的参考数据而已. 1. 在Oracle EBS上进行Form跟踪的技术方法: Oracle EBS的一个Profile 提供此功能: U

第五篇 Getting Started with ORACLE EBS(开始学习ORACLE EBS)

第一篇介绍了ERP软件是供应链管理软件.告诉你这个软件改善或提升企业管理的切入点和着力点.有了着力点才能给力. 第二篇介绍了什么是咨询以及咨询工作共通的章法,告诉了你咨询的套路是什么,就像练习一套拳,套路就是这样的,这些是形式的东西. 第三篇介绍了EXCEL和基于数据库的软件在数据处理方面的异同. 第四篇介绍了在国内做咨询你应该具备的一些基础理论常识. 从本篇也就是第五篇开始着手介绍一些循序渐进学习ORACLE EBS的知识.面向的读者是ORACLE EBS系统实施新手.并欢迎高手不吝批评纠正.

第7篇 ORACLE EBS DEMO虚拟机环境的安装

ERP信息系统的实施不仅要求懂得道理方面的知识,更要侧重于应用实践.为了有一个稳定的测试环境.初学者可以自己搭建一个EBS DEMO环境.本节介绍EBS DEMO环境虚拟机的安装.一. 安装前的准备(只介绍我自己的情况)1T移动硬盘(Toshiba)宿主机是Thinkpad T420 I5内核 500G硬盘 8G内存 WIN7 64bit操作系统.EBS_R12_Cygwin_专用安装包.rarvs2005.rarVirtualBox-4.2.12-84980-Win.exeWindowsSer