EBS 采购订单接口导入

涉及表po_headers_all,po_lines_all,po_distributions_all

导入字段参考以下代码:(参考插入字段,插入值需要自行给出)

-- Created on 2010-11-1 by meteorWJ DECLARE l_header_intf_data po_headers_interface%ROWTYPE; l_line_intf_data po_lines_interface%ROWTYPE; l_dist_intf_data po_distributions_interface%ROWTYPE; BEGIN SELECT po_headers_interface_s.NEXTVAL INTO l_header_intf_data.interface_header_id FROM dual; l_header_intf_data.batch_id := g_group_id; l_header_intf_data.action := 'ORIGINAL'; l_header_intf_data.org_id := l_org_id; /*l_header_data.operating_unit*/ l_header_intf_data.vendor_id := l_header_data.vendor_id; l_header_intf_data.vendor_site_id := l_vendor_site_id /*l_header_data.vendor_site_id*/ ; l_header_intf_data.ship_to_location_id := l_header_data.ship_to_loc_id; l_header_intf_data.currency_code := l_header_data.currency_code; l_header_intf_data.attribute15 := l_header_data.current_po_number; l_header_intf_data.attribute4 := l_header_data.current_po_number; l_header_intf_data.attribute10 := l_transportation_mode; --l_header_data.intf_attribute3; l_header_intf_data.attribute6 := l_vendor_type; l_header_intf_data.attribute7 := to_char(l_eta_date, 'YYYY-MM-DD'); l_header_intf_data.attribute8 := to_char(l_etd_date, 'YYYY-MM-DD'); l_header_intf_data.attribute9 := l_header_data.intf_attribute9; --'SCMS'; l_header_intf_data.attribute12 := l_transmission_mode; l_header_intf_data.attribute13 := '1'; l_header_intf_data.agent_id := l_agent_id; l_header_intf_data.document_type_code := 'STANDARD'; l_header_intf_data.attribute11 := l_city_code; l_header_intf_data.comments := l_header_data.comments; l_header_intf_data.terms_id := l_terms_id; l_header_intf_data.interface_source_code := 'PLANet'; --l_header_intf_data.rate_date := TRUNC(SYSDATE); INSERT INTO po_headers_interface VALUES l_header_intf_data; SELECT po_lines_interface_s.NEXTVAL INTO l_line_intf_data.interface_line_id FROM dual; l_line_intf_data.interface_header_id := l_header_intf_data.interface_header_id; l_line_intf_data.organization_id := l_header_intf_data.org_id; l_line_intf_data.item_id := l_line_data.item_id; l_line_intf_data.unit_price := l_item_price; l_line_intf_data.quantity := l_line_data.quantity; l_line_intf_data.ship_to_organization_id := l_header_organization_id; --l_line_organization_id; l_line_intf_data.promised_date := l_line_data.need_by_date; --l_line_intf_data.need_by_date := l_line_data.need_by_date; l_line_intf_data.taxable_flag := l_taxable_flag; l_line_intf_data.tax_name := l_tax_name; INSERT INTO po_lines_interface VALUES l_line_intf_data; SELECT po.po_distributions_interface_s.NEXTVAL INTO l_dist_intf_data.interface_distribution_id FROM dual; l_dist_intf_data.interface_header_id := l_line_intf_data.interface_header_id; l_dist_intf_data.interface_line_id := l_line_intf_data.interface_line_id; l_dist_intf_data.org_id := l_line_intf_data.organization_id; l_dist_intf_data.destination_subinventory := l_dist_data.destination_subinventory; l_dist_intf_data.quantity_ordered := l_dist_data.quantity_ordered; INSERT INTO po_distributions_interface VALUES l_dist_intf_data; END;

 

导入接口表后,需要调用标准请求导入正式采购订单

fnd_global.apps_initialize(user_id => fnd_global.user_id, resp_id => l_resp_id, resp_appl_id => l_resp_appl_id); l_request_id := fnd_request.submit_request('PO', 'POXPOPDOI', NULL, NULL, FALSE, NULL, 'STANDARD', NULL, 'N', NULL, 'APPROVED', NULL, g_group_id, NULL, NULL, chr(0));

 

若导入失败,请参考po_interface_errors查找错误信息

导入成功,将在po_headers_all,po_lines_all,po_line_locations_all,po_distrubutions_all表中生成记录

你可能感兴趣的:(Oracle,EBS)