Create Worker Order Funfa
Create Worker Order Funfa
O_msg_index NUMBER;
l_eam_wo_rec eam_process_wo_pub.eam_wo_rec_type;
l_eam_op_tbl eam_process_wo_pub.eam_op_tbl_type;
l_eam_op_network_tbl eam_process_wo_pub.eam_op_network_tbl_type;
l_eam_res_tbl eam_process_wo_pub.eam_res_tbl_type;
l_eam_res_inst_tbl eam_process_wo_pub.eam_res_inst_tbl_type;
l_eam_sub_res_tbl eam_process_wo_pub.eam_sub_res_tbl_type;
l_eam_res_usage_tbl eam_process_wo_pub.eam_res_usage_tbl_type;
l_eam_mat_req_tbl eam_process_wo_pub.eam_mat_req_tbl_type;
l_out_eam_wo_rec eam_process_wo_pub.eam_wo_rec_type;
l_out_eam_op_tbl eam_process_wo_pub.eam_op_tbl_type;
l_out_eam_op_network_tbl eam_process_wo_pub.eam_op_network_tbl_type;
l_out_eam_res_tbl eam_process_wo_pub.eam_res_tbl_type;
l_out_eam_res_inst_tbl eam_process_wo_pub.eam_res_inst_tbl_type;
l_out_eam_sub_res_tbl eam_process_wo_pub.eam_sub_res_tbl_type;
l_out_eam_res_usage_tbl eam_process_wo_pub.eam_res_usage_tbl_type;
l_out_eam_mat_req_tbl eam_process_wo_pub.eam_mat_req_tbl_type;
l_out_eam_direct_items_tbl eam_process_wo_pub.eam_direct_items_tbl_type;
l_eam_wo_comp_rec eam_process_wo_pub.eam_wo_comp_rec_type;
g_eam_mat_req_rec0 eam_process_wo_pub.eam_mat_req_rec_type;
g_eam_mat_req_tbl0 eam_process_wo_pub.eam_mat_req_tbl_type;
l_eam_wo_rec eam_process_wo_pub.eam_wo_rec_type;
x_eam_op_tbl eam_process_wo_pub.eam_op_tbl_type;
x_eam_op_network_tbl eam_process_wo_pub.eam_op_network_tbl_type;
x_eam_res_tbl eam_process_wo_pub.eam_res_tbl_type;
x_eam_res_inst_tbl eam_process_wo_pub.eam_res_inst_tbl_type;
x_eam_sub_res_tbl eam_process_wo_pub.eam_sub_res_tbl_type;
x_eam_res_usage_tbl eam_process_wo_pub.eam_res_usage_tbl_type;
x_eam_mat_req_tbl eam_process_wo_pub.eam_mat_req_tbl_type;
x_eam_direct_items_tbl eam_process_wo_pub.eam_direct_items_tbl_type;
X_status VARCHAR2(4000);
X_msg_cnt NUMBER;
X_msg_data VARCHAR2(4000);
x_message_list EAM_ERROR_MESSAGE_PVT.Error_Tbl_Type;
Begin
--g_eam_mat_req_rec0.inventory_item_id := 5982591;
l_eam_wo_rec.asset_activity_id := 5982591; -- ok
--g_eam_mat_req_tbl0(1) := g_eam_mat_req_rec0;
eam_process_wo_pub.process_wo
( p_bo_identifier => 'EAM'
, p_api_version_number => 1.0
, p_init_msg_list => TRUE
, p_commit => 'Y'
, p_eam_wo_rec => l_eam_wo_rec
, p_eam_op_tbl => l_eam_op_tbl
, p_eam_op_network_tbl => l_eam_op_network_tbl
, p_eam_res_tbl => l_eam_res_tbl
, p_eam_res_inst_tbl => l_eam_res_inst_tbl
, p_eam_sub_res_tbl => l_eam_sub_res_tbl
, p_eam_res_usage_tbl => l_eam_res_usage_tbl
, p_eam_mat_req_tbl => l_eam_mat_req_tbl
, p_eam_direct_items_tbl => l_out_eam_direct_items_tbl
, x_eam_wo_rec => x_eam_wo_rec
, x_eam_op_tbl => x_eam_op_tbl
, x_eam_op_network_tbl => x_eam_op_network_tbl
, x_eam_res_tbl => x_eam_res_tbl
, x_eam_res_inst_tbl => x_eam_res_inst_tbl
, x_eam_sub_res_tbl => x_eam_sub_res_tbl
, x_eam_res_usage_tbl => x_eam_res_usage_tbl
, x_eam_mat_req_tbl => x_eam_mat_req_tbl
, x_eam_direct_items_tbl => x_eam_direct_items_tbl
, x_return_status => X_status
, x_msg_count => X_msg_cnt
, p_debug => 'Y'
, p_output_dir => 'TEMP'--'home/fsappgecis'--/temp'
, p_debug_filename => 'eamwotest.log'
, p_debug_file_mode => 'w'
);
end loop;
end;
5231250
select * from apps.wip_discrete_jobs where creation_date > sysdate - 1 and
organization_id = 11568
select * from wip_entities where wip_entity_id in (5656600,5655601) -- 5982592
select max(t.header_id)+1,
max(t.group_id)+1
from wip_job_schedule_interface t
SELECT
*
FROM
mtl_eam_asset_activities meaa
WHERE
meaa.maintenance_object_type = 3
AND meaa.asset_activity_id = 5982591
AND meaa.maintenance_object_id =
p_eam_wo_rec.maintenance_object_id;
and insert the records as follows (those are mostly the required fields allocated)
:
apps.mtl_eam_asset_numbers_all_v