The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT approval_status INTO l_item_approval_status
FROM mtl_system_items_b
WHERE inventory_item_id = l_inventory_item_id
AND organization_id = p_item.main_obj_type.organization_id;
x_last_login_id => p_item.main_obj_type.last_updated_by,
x_bom_rev_starting => NULL,
x_rtg_rev_starting => NULL,
x_ecn_name => NULL,
x_item_code => 1, --to transfer item to Mfg
x_bom_code => 1, --to transfer Bom to Mfg
x_rtg_code => 2,
x_mfg_description => p_item.main_obj_type.description,
x_segment1 => p_item.main_obj_type.segment1,
x_segment2 => p_item.main_obj_type.segment2,
x_segment3 => p_item.main_obj_type.segment3,
x_segment4 => p_item.main_obj_type.segment4,
x_segment5 => p_item.main_obj_type.segment5,
x_segment6 => p_item.main_obj_type.segment6,
x_segment7 => p_item.main_obj_type.segment7,
x_segment8 => p_item.main_obj_type.segment8,
x_segment9 => p_item.main_obj_type.segment9,
x_segment10 => p_item.main_obj_type.segment10,
x_segment11 => p_item.main_obj_type.segment11,
x_segment12 => p_item.main_obj_type.segment12,
x_segment13 => p_item.main_obj_type.segment13,
x_segment14 => p_item.main_obj_type.segment14,
x_segment15 => p_item.main_obj_type.segment15,
x_segment16 => p_item.main_obj_type.segment16,
x_segment17 => p_item.main_obj_type.segment17,
x_segment18 => p_item.main_obj_type.segment18,
x_segment19 => p_item.main_obj_type.segment19,
x_segment20 => p_item.main_obj_type.segment20,
x_implemented_only => NULL,
x_commit => FALSE
);
,p_last_update_status IN VARCHAR2
,p_revised_item_sequence_id IN NUMBER
,p_name_val_list IN inv_ebi_name_value_list
,x_eco_obj OUT NOCOPY inv_ebi_eco_obj
,x_return_status OUT NOCOPY VARCHAR2
,x_msg_count OUT NOCOPY NUMBER
,x_msg_data OUT NOCOPY VARCHAR2
)
IS
l_eco_obj inv_ebi_eco_obj;
,p_last_update_status => p_last_update_status
,p_revised_item_sequence_id => p_revised_item_sequence_id
,p_name_val_list => p_name_val_list
,x_eco_obj => l_eco_obj
,x_return_status => l_return_status
,x_msg_count => l_msg_count
,x_msg_data => l_msg_data
);
x_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).selection_date_str :=
INV_EBI_ITEM_HELPER.convert_date_str(p_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).selection_date);
x_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.main_obj_type.last_update_date_str :=
INV_EBI_ITEM_HELPER.convert_date_str(p_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.main_obj_type.last_update_date);
x_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.main_obj_type.program_update_date_str :=
INV_EBI_ITEM_HELPER.convert_date_str(p_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.main_obj_type.program_update_date);
x_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.deprecated_obj_type.wh_update_date_str :=
INV_EBI_ITEM_HELPER.convert_date_str(p_eco_lst_obj(i).eco_attr.eco_revised_item_type(j).item.deprecated_obj_type.wh_update_date_str);
SELECT inv_ebi_change_id_obj(geco.change_id,'N')
FROM (SELECT eec1.change_id
FROM eng_engineering_changes eec,eng_engineering_changes eec1
where eec.change_id=p_chg_id
and eec.change_notice=eec1.change_notice
MINUS
SELECT b.change_id
FROM THE (SELECT CAST(p_change_lst as inv_ebi_change_id_obj_tbl)
FROM dual) b ) geco;
SELECT inv_ebi_change_id_obj(geco.change_id,geco.last_update_status)
FROM (SELECT b.change_id,b.last_update_status
FROM THE (SELECT CAST( p_change_lst as inv_ebi_change_id_obj_tbl)
FROM dual ) b
UNION
SELECT c.change_id,c.last_update_status
FROM THE (SELECT CAST( l_mult_org_chg_id_tbl as inv_ebi_change_id_obj_tbl)
FROM dual ) c ) geco;
,p_last_update_status => l_eco_output_tbl_lst(l_cnt_cid).last_update_status
,p_revised_item_sequence_id => NULL
,p_name_val_list => l_name_val_list
,x_eco_obj => l_eco_obj
,x_return_status => l_return_status
,x_msg_count => l_count
,x_msg_data => l_msg_data
);
,p_update_item_tbl IN inv_ebi_item_attr_tbl
,x_update_item_tbl OUT NOCOPY inv_ebi_item_attr_tbl
,x_out OUT NOCOPY inv_ebi_item_output_obj
,x_eco_obj OUT NOCOPY inv_ebi_eco_obj
) IS
l_item inv_ebi_item_obj;
l_update_item_count NUMBER :=0;
SELECT revision
FROM mtl_item_revisions_b
WHERE
organization_id = p_organization_id AND
inventory_item_id = p_inventory_item_id;
x_update_item_tbl := inv_ebi_item_attr_tbl();
x_update_item_tbl := p_update_item_tbl;
IF l_eco_obj.NAME_VALUE_TBL(x).PARAM_NAME in ('VALIDATE_REVISED_ITEM_REVISION','TEMPLATE_FOR_ITEM_UPDATE_ALLOWED','ASSIGN_DEFAULT_TEMPLATE_FROM_ICC','ALLOW_LIFECYCLE_PHASE_SKIP') THEN
l_eco_obj.eco_revised_item_type(i).item.NAME_VALUE_TBL.extend();
INV_EBI_UTIL.debug_line('STEP 110: START update mtl_item_revisions_b');
UPDATE mtl_item_revisions_b
SET
implementation_date = sysdate,
effectivity_date = sysdate,
creation_date = sysdate,
last_update_date = sysdate,
last_updated_by = DECODE(last_updated_by, NULL, fnd_global.user_id,last_updated_by),
created_by = DECODE(last_updated_by, NULL, fnd_global.user_id,last_updated_by)
WHERE
inventory_item_id = l_item_output_obj.inventory_item_id AND
organization_id = l_item_output_obj.organization_id AND
revision = l_revision;
INV_EBI_UTIL.debug_line('STEP 120: END update mtl_item_revisions_b');
x_update_item_tbl.EXTEND(1);
l_update_item_count := x_update_item_tbl.COUNT;
x_update_item_tbl(l_update_item_count) := INV_EBI_GET_ITEM_OUTPUT_OBJ(NULL,NULL,NULL,NULL);
x_update_item_tbl(l_update_item_count).item_obj := l_eco_obj.eco_revised_item_type(i).item;
PROCEDURE process_update_items(
p_commit IN VARCHAR2 := FND_API.g_false
,p_update_item_tbl IN inv_ebi_item_attr_tbl
,x_out OUT NOCOPY inv_ebi_item_output_obj
) IS
l_output_status inv_ebi_output_status;
INV_EBI_UTIL.debug_line('STEP 10: START INSIDE INV_EBI_CHANGE_ORDER_PUB.process_update_items');
IF(p_update_item_tbl IS NOT NULL AND p_update_item_tbl.COUNT > 0) THEN
FOR i IN 1..p_update_item_tbl.COUNT LOOP
INV_EBI_UTIL.debug_line('STEP 20: BEFORE CALLING INV_EBI_ITEM_HELPER.sync_item');
,p_operation => INV_EBI_ITEM_PUB.g_otype_update
,p_item => p_update_item_tbl(i).item_obj
,x_out => x_out
);
x_out.item_number := p_update_item_tbl(i).item_obj.main_obj_type.item_number;
x_out.organization_code := p_update_item_tbl(i).item_obj.main_obj_type.organization_code;
INV_EBI_UTIL.debug_line('STEP 40: END INSIDE INV_EBI_CHANGE_ORDER_PUB.process_update_items');
x_out.output_status.msg_data := x_out.output_status.msg_data||' -> INV_EBI_CHANGE_ORDER_PUB.process_update_items ';
x_out.output_status.msg_data := SQLERRM||' INV_EBI_CHANGE_ORDER_PUB.process_update_items ';
END process_update_items;
SELECT status_code
INTO l_curr_status_code
FROM eng_engineering_changes
WHERE change_id = l_change_id;
SELECT status_code
INTO l_status_code
FROM eng_change_statuses_vl
WHERE LOWER(status_name) = 'scheduled'; -- Scheduled
SELECT change_order_type_id INTO l_change_order_type_id
FROM eng_engineering_changes
WHERE change_notice = p_eco_obj.eco_change_order_type.eco_name
AND organization_id = l_organization_id;
l_updated_item_tbl inv_ebi_item_attr_tbl;
l_updated_item_tbl := inv_ebi_item_attr_tbl(); -- Bug 8830143
,p_update_item_tbl => l_upd_item_tbl
,x_update_item_tbl => l_updated_item_tbl
,x_out => l_item_output_obj
,x_eco_obj => l_eco_obj
);
IF(l_updated_item_tbl IS NOT NULL AND l_updated_item_tbl.COUNT> 0) THEN
FOR l_count IN 1..l_updated_item_tbl.COUNT LOOP
l_upd_item_cnt := l_upd_item_cnt + 1;
l_upd_item_tbl := l_updated_item_tbl;
,p_update_item_tbl => l_upd_item_tbl
,x_update_item_tbl => l_updated_item_tbl
,x_out => l_item_output_obj
,x_eco_obj => l_eco_obj
);
IF(l_updated_item_tbl IS NOT NULL AND l_updated_item_tbl.COUNT> 0) THEN
FOR l_count IN 1..l_updated_item_tbl.COUNT LOOP
l_upd_item_cnt := l_upd_item_cnt + 1;
INV_EBI_UTIL.debug_line('STEP 60: BEFORE CALLING INV_EBI_ITEM_HELPER.process_update_item_lifecycle');
INV_EBI_ITEM_HELPER.process_update_item_lifecycle(
p_commit => FND_API.g_false
,p_update_item_tbl => l_updated_item_tbl
,x_out => l_item_output_obj
);
INV_EBI_UTIL.debug_line('STEP 70: AFTER CALLING INV_EBI_ITEM_HELPER.process_update_item_lifecycle for item updation STATUS: '|| l_item_output_obj.output_status.return_status);
FOR i IN 1..l_updated_item_tbl.COUNT LOOP
IF( l_updated_item_tbl(i).item_obj.main_obj_type.item_number = l_item_name
AND l_updated_item_tbl(i).item_obj.main_obj_type.organization_code = l_org_code) THEN
l_eco_name := l_upd_eco_name_tbl(i);
INV_EBI_UTIL.debug_line('STEP 120: BEFORE CALLING INV_EBI_CHANGE_ORDER_PUB.process_update_items ');
process_update_items(
p_commit => p_commit
,p_update_item_tbl => l_updated_item_tbl
,x_out => l_item_output_obj
);
INV_EBI_UTIL.debug_line('STEP 130: AFTER CALLING INV_EBI_CHANGE_ORDER_PUB.process_update_items STATUS: '|| l_item_output_obj.output_status.return_status);
FOR i IN 1..l_updated_item_tbl.COUNT LOOP
IF( l_updated_item_tbl(i).item_obj.main_obj_type.item_number = l_item_name
AND l_updated_item_tbl(i).item_obj.main_obj_type.organization_code = l_org_code) THEN
l_eco_name := l_upd_eco_name_tbl(i);