You are on page 1of 2

CREATE OR REPLACE PROCEDURE ss_proc(p_item_id number default null)

IS
p_seq_id
NUMBER;
p_group_id NUMBER;
x_errm
VARCHAR2 (100);
x_errcode
NUMBER;
BEGIN
BEGIN
SELECT bom_lists_s.NEXTVAL
INTO p_seq_id
FROM DUAL;
dbms_output.put_line('_seq_id'||p_seq_id);
EXCEPTION
WHEN OTHERS
THEN
x_errm := 'Error Message:' || SQLERRM || ' : ';
x_errcode := 1;
END;
BEGIN
SELECT bom_explosion_temp_s.NEXTVAL
INTO p_group_id
FROM DUAL;
dbms_output.put_line('Group_id'||p_group_id);
EXCEPTION
WHEN others
THEN
x_errm := x_errm || 'Error Message: ' || SQLERRM;
x_errcode := 1;
END;
INSERT INTO bom_lists
(sequence_id, assembly_item_id, alternate_designator,
organization_id
)
VALUES (p_seq_id, p_item_id, NULL,
85
);
dbms_output.put_line('Hello'||p_group_id);
bompexpl.explosion_report (org_id
list_id
grp_id
session_id
levels_to_explode
bom_or_eng
impl_flag
module
cst_type_id
std_comp_flag
expl_qty
report_option
req_id
lock_flag
rollup_option
alt_rtg_desg
rev_date
err_msg
ERROR_CODE

=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>

85,
p_seq_id,
p_group_id,
-1,
10,
1,
1,
2,
-1,
-1,
1,
-1,
0,
1,
-1,
'',
SYSDATE,
x_errm,
x_errcode,

cst_rlp_id
verify_flag
plan_factor_flag
incl_lt_flag
);

=>
=>
=>
=>

0,
0,
2,
2

insert into xxjush_bom_extract_tbl(


fg_item_code,
assembly_item_id ,
assembly_item_name ,
component_item_id ,
component_item_name ,
component_code ,
supply_subinventory ,
component_remarks ,
plan_level,
organization_id ,
sort_order,
component_quantity )
select (select segment1 from mtl_system_items_b where inventory_item_id =p_ite
m_id and organization_id =85) fg_item_code ,
assembly_item_id,
(Select segment1 from mtl_system_items_b msib where inventory_item_id =
bet.assembly_item_id and organization_id=85) assembly_item_name,
component_item_id,
(Select segment1 from mtl_system_items_b msib where inventory_item_id =
bet.component_item_id and organization_id=85) component_item_name,
bet.component_code,
bet.supply_subinventory,
bet.component_remarks,
bet.plan_level,
bet.organization_id,
bet.sort_order,
bet.component_quantity
from bom_Explosion_temp bet;
IF x_errcode = 9999 OR x_errcode < 0
THEN
null;
END IF;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;