Oracle EBS PO 采购订单接口 创建后 点击发运后 未修改任何数据 需要保存
现象:
Oracle EBS PO 采购订单接口创建的订单 点击发运后 未修改任何数据 需要保存
测试环境:
Oracle EBS R12.1.3
解决方法:
oracle 官方BUG 不能进行修复 只能进行数据修复
oracle 官方提供两个数据修复脚本 matelink: (Doc ID 943681.1)
先执行下面脚本:
DECLARE
CURSOR non_releases_data @H_301_20@IS
@H_301_20@SELECT pla.item_id,pos.ship_to_organization_id,pha.vendor_id,pha.vendor_site_id,pos.line_location_id
FROM po_line_locations_all pos,po_lines_all pla,po_headers_all pha
WHERE pos.po_line_id=pla.po_line_id
@H_301_20@AND pos.po_header_id=pha.po_header_id
@H_301_20@AND pos.po_release_id @H_301_20@is @H_301_20@NULL
@H_301_20@AND pos.country_of_origin_code @H_301_20@IS @H_301_20@NULL
@H_301_20@AND pos.shipment_type @H_301_20@IN ('STANDARD','PLANNED')
@H_301_20@AND pha.DOCUMENT_CREATION_METHOD='PDOI';
x_item_id number;
x_ship_to_org_id number;
x_vendor_id number;
x_vendor_site_id number;
x_shipment_type VARCHAR2(25);
x_country_of_origin_code varchar2(2);
x_line_location_id NUMBER;
rowsupdated NUMBER;
@H_301_20@BEGIN
DELETE po_session_gt;
@H_301_20@OPEN non_releases_data;
rowsupdated:=0;
@H_301_20@LOOP
FETCH non_releases_data INTO
x_item_id,x_ship_to_org_id,x_vendor_id,x_vendor_site_id,x_line_location_id;
@H_301_20@EXIT @H_301_20@WHEN non_releases_data%NOTFOUND;
rowsupdated:=rowsupdated+1;
po_coo_s.get_default_country_of_origin
(x_item_id,x_country_of_origin_code);
@H_301_20@IF (x_country_of_origin_code @H_301_20@IS @H_301_20@NOT @H_301_20@NULL) the
INSERT INTO po_session_gt(num1,char1,num2) values
(x_line_location_id,x_country_of_origin_code,7516875);
@H_301_20@END @H_301_20@IF;
@H_301_20@END @H_301_20@LOOP;
Close non_releases_data;
EXCEPTION
@H_301_20@WHEN @H_301_20@OTHERS @H_301_20@THEN
ROLLBACK;
dbms_output.put_line('An exception occurred.');
dbms_output.put_line('Please contact Oracle support.');
@H_301_20@END;
再查询下面脚本:
@H_301_20@SELECT Count(*) @H_301_20@FROM po_session_gt @H_301_20@WHERE num2=7516875;
再执行下面脚本:
DECLARE
CURSOR non_releases_data IS
@H_301_20@SELECT pla.item_id,pos.line_location_id @H_301_20@FROM po_line_locations_all pos,po_headers_all pha @H_301_20@WHERE pos.po_line_id=pla.po_line_id @H_301_20@AND pos.po_header_id=pha.po_header_id @H_301_20@AND pos.po_release_id @H_301_20@is @H_301_20@NULL @H_301_20@AND pos.country_of_origin_code @H_301_20@IS @H_301_20@NULL @H_301_20@AND pos.shipment_type @H_301_20@IN ('STANDARD','PLANNED') @H_301_20@AND pha.DOCUMENT_CREATION_METHOD='PDOI';
x_item_id number;
x_ship_to_org_id number;
x_vendor_id number;
x_vendor_site_id number;
x_shipment_type VARCHAR2(25);
x_country_of_origin_code varchar2(2);
x_line_location_id NUMBER;
rowsupdated NUMBER;
@H_301_20@BEGIN @H_301_20@DELETE po_session_gt;
OPEN non_releases_data;
rowsupdated:=0;
LOOP
FETCH non_releases_data INTO
x_item_id,x_line_location_id;
EXIT WHEN non_releases_data%NOTFOUND;
rowsupdated:=rowsupdated+1;
po_coo_s.get_default_country_of_origin
(x_item_id,x_country_of_origin_code);
@H_301_20@UPDATE po_line_locations_all @H_301_20@SET country_of_origin_code= x_country_of_origin_code @H_301_20@WHERE line_location_id=x_line_location_id;
@H_301_20@END LOOP;
Close non_releases_data;
EXCEPTION
WHEN OTHERS THEN
@H_301_20@ROLLBACK;
dbms_output.put_line('An exception occurred.');
dbms_output.put_line('Please contact Oracle support.');
@H_301_20@END;
进行数据修复。
总结:
在做接口导入的时候 可以直接将这两个脚本写成两个存储过程 放在采购订单导入的包里面 订单创建成功后 调用第一个脚本的存储过程 然后查询 符合条件 在调用第二个脚本的存储过程修复数据。