1.增加销售订单行 DECLARE v_api_version_number NUMBER := 1; v_return_status VARCHAR2 (2000); v_msg_count NUMBER; v_msg_data VARCHAR2 (2000); -- IN Variables -- v_header_rec oe_order_pub.header_rec_type; v_line_tbl oe_order_pub.line_tbl_type; v_action_request_tbl oe_order_pub.request_tbl_type; v_line_adj_tbl oe_order_pub.line_adj_tbl_type; -- OUT Variables -- v_header_rec_out oe_order_pub.header_rec_type; v_header_val_rec_out oe_order_pub.header_val_rec_type; v_header_adj_tbl_out oe_order_pub.header_adj_tbl_type; v_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type; v_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type; v_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type; v_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type; v_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type; v_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type; v_line_tbl_out oe_order_pub.line_tbl_type; v_line_val_tbl_out oe_order_pub.line_val_tbl_type; v_line_adj_tbl_out oe_order_pub.line_adj_tbl_type; v_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type; v_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type; v_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type; v_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type; v_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type; v_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type; v_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type; v_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type; v_action_request_tbl_out oe_order_pub.request_tbl_type; v_msg_index NUMBER; v_data VARCHAR2 (2000); v_loop_count NUMBER; v_debug_file VARCHAR2 (200); b_return_status VARCHAR2 (200); b_msg_count NUMBER; b_msg_data VARCHAR2 (2000); BEGIN DBMS_OUTPUT.PUT_LINE('Starting of script'); -- Setting the Enviroment -- mo_global.init('ONT'); fnd_global.apps_initialize ( user_id => 18859 ,resp_id => 55817 ,resp_appl_id => 660); mo_global.set_policy_context('S',898); v_action_request_tbl (1) := oe_order_pub.g_miss_request_rec; -- Line Record -- v_line_tbl (1) := oe_order_pub.g_miss_line_rec; v_line_tbl (1).operation := oe_globals.g_opr_create; v_line_tbl (1).header_id := 4169802; -- Existing order header id v_line_tbl (1).inventory_item_id := 1671715; v_line_tbl (1).ordered_quantity := 50; v_line_tbl (1).unit_selling_price := 480.68; v_line_tbl (1).line_type_id :=1935; v_line_tbl (1).calculate_price_flag := 'Y'; DBMS_OUTPUT.PUT_LINE('Starting of API'); -- Calling the API to add a new line to an existing Order -- OE_ORDER_PUB.PROCESS_ORDER ( p_api_version_number => v_api_version_number , p_header_rec => v_header_rec , p_line_tbl => v_line_tbl , p_action_request_tbl => v_action_request_tbl , p_line_adj_tbl => v_line_adj_tbl -- OUT variables , x_header_rec => v_header_rec_out , x_header_val_rec => v_header_val_rec_out , x_header_adj_tbl => v_header_adj_tbl_out , x_header_adj_val_tbl => v_header_adj_val_tbl_out , x_header_price_att_tbl => v_header_price_att_tbl_out , x_header_adj_att_tbl => v_header_adj_att_tbl_out , x_header_adj_assoc_tbl => v_header_adj_assoc_tbl_out , x_header_scredit_tbl => v_header_scredit_tbl_out , x_header_scredit_val_tbl => v_header_scredit_val_tbl_out , x_line_tbl => v_line_tbl_out , x_line_val_tbl => v_line_val_tbl_out , x_line_adj_tbl => v_line_adj_tbl_out , x_line_adj_val_tbl => v_line_adj_val_tbl_out , x_line_price_att_tbl => v_line_price_att_tbl_out , x_line_adj_att_tbl => v_line_adj_att_tbl_out , x_line_adj_assoc_tbl => v_line_adj_assoc_tbl_out , x_line_scredit_tbl => v_line_scredit_tbl_out , x_line_scredit_val_tbl => v_line_scredit_val_tbl_out , x_lot_serial_tbl => v_lot_serial_tbl_out , x_lot_serial_val_tbl => v_lot_serial_val_tbl_out , x_action_request_tbl => v_action_request_tbl_out , x_return_status => v_return_status , x_msg_count => v_msg_count , x_msg_data => v_msg_data ); DBMS_OUTPUT.PUT_LINE('Completion of API'); IF v_return_status = fnd_api.g_ret_sts_success THEN COMMIT; DBMS_OUTPUT.put_line ('Line Addition to Existing Order Success '); ELSE DBMS_OUTPUT.put_line ('Line Addition to Existing Order failed:'||v_msg_data); ROLLBACK; FOR i IN 1 .. v_msg_count LOOP v_msg_data := oe_msg_pub.get( p_msg_index => i, p_encoded => 'F'); dbms_output.put_line( i|| ') '|| v_msg_data); END LOOP; END IF; END; 2.取消销售订单头 DECLARE v_api_version_number NUMBER := 1; v_return_status VARCHAR2 (2000); v_msg_count NUMBER; v_msg_data VARCHAR2 (2000); -- IN Variables -- v_header_rec oe_order_pub.header_rec_type; v_line_tbl oe_order_pub.line_tbl_type; v_action_request_tbl oe_order_pub.request_tbl_type; v_line_adj_tbl oe_order_pub.line_adj_tbl_type; -- OUT Variables -- v_header_rec_out oe_order_pub.header_rec_type; v_header_val_rec_out oe_order_pub.header_val_rec_type; v_header_adj_tbl_out oe_order_pub.header_adj_tbl_type; v_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type; v_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type; v_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type; v_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type; v_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type; v_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type; v_line_tbl_out oe_order_pub.line_tbl_type; v_line_val_tbl_out oe_order_pub.line_val_tbl_type; v_line_adj_tbl_out oe_order_pub.line_adj_tbl_type; v_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type; v_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type; v_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type; v_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type; v_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type; v_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type; v_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type; v_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type; v_action_request_tbl_out oe_order_pub.request_tbl_type; v_msg_index NUMBER; v_data VARCHAR2 (2000); v_loop_count NUMBER; v_debug_file VARCHAR2 (200); b_return_status VARCHAR2 (200); b_msg_count NUMBER; b_msg_data VARCHAR2 (2000); BEGIN DBMS_OUTPUT.put_line ('Starting of script'); -- Setting the Enviroment -- mo_global.init ('ONT'); fnd_global.apps_initialize (user_id => 18859, resp_id => 55817, resp_appl_id => 660 ); mo_global.set_policy_context ('S', 898); v_action_request_tbl (1) := oe_order_pub.g_miss_request_rec; -- header Record -- v_header_rec := oe_order_pub.g_miss_header_rec; v_header_rec.operation := oe_globals.g_opr_update; v_header_rec.header_id := 4173801; v_header_rec.cancelled_flag := 'Y'; v_header_rec.change_reason := 'Not provided'; DBMS_OUTPUT.put_line ('Starting of API'); -- Calling the API to add a new line to an existing Order -- oe_order_pub.process_order (p_api_version_number => v_api_version_number, p_header_rec => v_header_rec, p_line_tbl => v_line_tbl, p_action_request_tbl => v_action_request_tbl, p_line_adj_tbl => v_line_adj_tbl -- OUT variables , x_header_rec => v_header_rec_out, x_header_val_rec => v_header_val_rec_out, x_header_adj_tbl => v_header_adj_tbl_out, x_header_adj_val_tbl => v_header_adj_val_tbl_out, x_header_price_att_tbl => v_header_price_att_tbl_out, x_header_adj_att_tbl => v_header_adj_att_tbl_out, x_header_adj_assoc_tbl => v_header_adj_assoc_tbl_out, x_header_scredit_tbl => v_header_scredit_tbl_out, x_header_scredit_val_tbl => v_header_scredit_val_tbl_out, x_line_tbl => v_line_tbl_out, x_line_val_tbl => v_line_val_tbl_out, x_line_adj_tbl => v_line_adj_tbl_out, x_line_adj_val_tbl => v_line_adj_val_tbl_out, x_line_price_att_tbl => v_line_price_att_tbl_out, x_line_adj_att_tbl => v_line_adj_att_tbl_out, x_line_adj_assoc_tbl => v_line_adj_assoc_tbl_out, x_line_scredit_tbl => v_line_scredit_tbl_out, x_line_scredit_val_tbl => v_line_scredit_val_tbl_out, x_lot_serial_tbl => v_lot_serial_tbl_out, x_lot_serial_val_tbl => v_lot_serial_val_tbl_out, x_action_request_tbl => v_action_request_tbl_out, x_return_status => v_return_status, x_msg_count => v_msg_count, x_msg_data => v_msg_data ); DBMS_OUTPUT.put_line ('Completion of API'); IF v_return_status = fnd_api.g_ret_sts_success THEN COMMIT; DBMS_OUTPUT.put_line ('Header Cancel to Existing Order Success '); ELSE DBMS_OUTPUT.put_line ( 'Header Cancel to Existing Order failed:' || v_msg_data ); ROLLBACK; FOR i IN 1 .. v_msg_count LOOP v_msg_data := oe_msg_pub.get (p_msg_index => i, p_encoded => 'F'); DBMS_OUTPUT.put_line (i || ') ' || v_msg_data); END LOOP; END IF; END; 3.取消销售订单行 DECLARE v_api_version_number NUMBER := 1; v_return_status VARCHAR2 (2000); v_msg_count NUMBER; v_msg_data VARCHAR2 (2000); -- IN Variables -- v_header_rec oe_order_pub.header_rec_type; v_line_tbl oe_order_pub.line_tbl_type; v_action_request_tbl oe_order_pub.request_tbl_type; v_line_adj_tbl oe_order_pub.line_adj_tbl_type; -- OUT Variables -- v_header_rec_out oe_order_pub.header_rec_type; v_header_val_rec_out oe_order_pub.header_val_rec_type; v_header_adj_tbl_out oe_order_pub.header_adj_tbl_type; v_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type; v_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type; v_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type; v_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type; v_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type; v_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type; v_line_tbl_out oe_order_pub.line_tbl_type; v_line_val_tbl_out oe_order_pub.line_val_tbl_type; v_line_adj_tbl_out oe_order_pub.line_adj_tbl_type; v_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type; v_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type; v_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type; v_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type; v_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type; v_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type; v_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type; v_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type; v_action_request_tbl_out oe_order_pub.request_tbl_type; v_msg_index NUMBER; v_data VARCHAR2 (2000); v_loop_count NUMBER; v_debug_file VARCHAR2 (200); b_return_status VARCHAR2 (200); b_msg_count NUMBER; b_msg_data VARCHAR2 (2000); BEGIN DBMS_OUTPUT.put_line ('Starting of script'); -- Setting the Enviroment -- mo_global.init ('ONT'); fnd_global.apps_initialize (user_id => 18859, resp_id => 55817, resp_appl_id => 660 ); mo_global.set_policy_context ('S', 898); v_action_request_tbl (1) := oe_order_pub.g_miss_request_rec; -- Line Record -- v_line_tbl (1) := oe_order_pub.g_miss_line_rec; v_line_tbl (1).operation := oe_globals.g_opr_update; ---v_line_tbl (1).header_id := 4169802; -- Existing order header id v_line_tbl (1).header_id := 4169802; -- Existing order header id v_line_tbl (1).line_id := 5324745; --Mandatory parameter v_line_tbl (1).ordered_quantity := 0; v_line_tbl (1).line_type_id := 1935; v_line_tbl (1).cancelled_flag := 'Y'; v_line_tbl (1).change_reason := 'Not provided'; DBMS_OUTPUT.put_line ('Starting of API'); -- Calling the API to add a new line to an existing Order -- oe_order_pub.process_order (p_api_version_number => v_api_version_number, p_header_rec => v_header_rec, p_line_tbl => v_line_tbl, p_action_request_tbl => v_action_request_tbl, p_line_adj_tbl => v_line_adj_tbl -- OUT variables , x_header_rec => v_header_rec_out, x_header_val_rec => v_header_val_rec_out, x_header_adj_tbl => v_header_adj_tbl_out, x_header_adj_val_tbl => v_header_adj_val_tbl_out, x_header_price_att_tbl => v_header_price_att_tbl_out, x_header_adj_att_tbl => v_header_adj_att_tbl_out, x_header_adj_assoc_tbl => v_header_adj_assoc_tbl_out, x_header_scredit_tbl => v_header_scredit_tbl_out, x_header_scredit_val_tbl => v_header_scredit_val_tbl_out, x_line_tbl => v_line_tbl_out, x_line_val_tbl => v_line_val_tbl_out, x_line_adj_tbl => v_line_adj_tbl_out, x_line_adj_val_tbl => v_line_adj_val_tbl_out, x_line_price_att_tbl => v_line_price_att_tbl_out, x_line_adj_att_tbl => v_line_adj_att_tbl_out, x_line_adj_assoc_tbl => v_line_adj_assoc_tbl_out, x_line_scredit_tbl => v_line_scredit_tbl_out, x_line_scredit_val_tbl => v_line_scredit_val_tbl_out, x_lot_serial_tbl => v_lot_serial_tbl_out, x_lot_serial_val_tbl => v_lot_serial_val_tbl_out, x_action_request_tbl => v_action_request_tbl_out, x_return_status => v_return_status, x_msg_count => v_msg_count, x_msg_data => v_msg_data ); DBMS_OUTPUT.put_line ('Completion of API'); IF v_return_status = fnd_api.g_ret_sts_success THEN COMMIT; DBMS_OUTPUT.put_line ('Line Cancel to Existing Order Success '); ELSE DBMS_OUTPUT.put_line ('Line Cancel to Existing Order failed:' || v_msg_data ); ROLLBACK; FOR i IN 1 .. v_msg_count LOOP v_msg_data := oe_msg_pub.get (p_msg_index => i, p_encoded => 'F'); DBMS_OUTPUT.put_line (i || ') ' || v_msg_data); END LOOP; END IF; END; 4.销售订单行更新 DECLARE v_api_version_number NUMBER := 1; v_return_status VARCHAR2 (2000); v_msg_count NUMBER; v_msg_data VARCHAR2 (2000); -- IN Variables -- v_header_rec oe_order_pub.header_rec_type; v_line_tbl oe_order_pub.line_tbl_type; v_action_request_tbl oe_order_pub.request_tbl_type; v_line_adj_tbl oe_order_pub.line_adj_tbl_type; -- OUT Variables -- v_header_rec_out oe_order_pub.header_rec_type; v_header_val_rec_out oe_order_pub.header_val_rec_type; v_header_adj_tbl_out oe_order_pub.header_adj_tbl_type; v_header_adj_val_tbl_out oe_order_pub.header_adj_val_tbl_type; v_header_price_att_tbl_out oe_order_pub.header_price_att_tbl_type; v_header_adj_att_tbl_out oe_order_pub.header_adj_att_tbl_type; v_header_adj_assoc_tbl_out oe_order_pub.header_adj_assoc_tbl_type; v_header_scredit_tbl_out oe_order_pub.header_scredit_tbl_type; v_header_scredit_val_tbl_out oe_order_pub.header_scredit_val_tbl_type; v_line_tbl_out oe_order_pub.line_tbl_type; v_line_val_tbl_out oe_order_pub.line_val_tbl_type; v_line_adj_tbl_out oe_order_pub.line_adj_tbl_type; v_line_adj_val_tbl_out oe_order_pub.line_adj_val_tbl_type; v_line_price_att_tbl_out oe_order_pub.line_price_att_tbl_type; v_line_adj_att_tbl_out oe_order_pub.line_adj_att_tbl_type; v_line_adj_assoc_tbl_out oe_order_pub.line_adj_assoc_tbl_type; v_line_scredit_tbl_out oe_order_pub.line_scredit_tbl_type; v_line_scredit_val_tbl_out oe_order_pub.line_scredit_val_tbl_type; v_lot_serial_tbl_out oe_order_pub.lot_serial_tbl_type; v_lot_serial_val_tbl_out oe_order_pub.lot_serial_val_tbl_type; v_action_request_tbl_out oe_order_pub.request_tbl_type; v_msg_index NUMBER; v_data VARCHAR2 (2000); v_loop_count NUMBER; v_debug_file VARCHAR2 (200); b_return_status VARCHAR2 (200); b_msg_count NUMBER; b_msg_data VARCHAR2 (2000); BEGIN DBMS_OUTPUT.put_line ('Starting of script'); -- Setting the Enviroment -- mo_global.init ('ONT'); fnd_global.apps_initialize (user_id => 18859, resp_id => 55817, resp_appl_id => 660 ); mo_global.set_policy_context ('S', 898); v_action_request_tbl (1) := oe_order_pub.g_miss_request_rec; -- Line Record -- v_line_tbl (1) := oe_order_pub.g_miss_line_rec; v_line_tbl (1).operation := oe_globals.g_opr_update; ---v_line_tbl (1).header_id := 4169802; -- Existing order header id v_line_tbl (1).header_id := 4170801; -- Existing order header id v_line_tbl (1).line_id := 5322744; --Mandatory parameter v_line_tbl (1).schedule_ship_date := to_date('20130927','YYYYMMDD'); --- v_line_tbl (1).ordered_quantity := 0; v_line_tbl (1).line_type_id := 1935; -- v_line_tbl (1).cancelled_flag := 'Y'; -- v_line_tbl (1).change_reason := 'Not provided'; DBMS_OUTPUT.put_line ('Starting of API'); -- Calling the API to add a new line to an existing Order -- oe_order_pub.process_order (p_api_version_number => v_api_version_number, p_header_rec => v_header_rec, p_line_tbl => v_line_tbl, p_action_request_tbl => v_action_request_tbl, p_line_adj_tbl => v_line_adj_tbl -- OUT variables , x_header_rec => v_header_rec_out, x_header_val_rec => v_header_val_rec_out, x_header_adj_tbl => v_header_adj_tbl_out, x_header_adj_val_tbl => v_header_adj_val_tbl_out, x_header_price_att_tbl => v_header_price_att_tbl_out, x_header_adj_att_tbl => v_header_adj_att_tbl_out, x_header_adj_assoc_tbl => v_header_adj_assoc_tbl_out, x_header_scredit_tbl => v_header_scredit_tbl_out, x_header_scredit_val_tbl => v_header_scredit_val_tbl_out, x_line_tbl => v_line_tbl_out, x_line_val_tbl => v_line_val_tbl_out, x_line_adj_tbl => v_line_adj_tbl_out, x_line_adj_val_tbl => v_line_adj_val_tbl_out, x_line_price_att_tbl => v_line_price_att_tbl_out, x_line_adj_att_tbl => v_line_adj_att_tbl_out, x_line_adj_assoc_tbl => v_line_adj_assoc_tbl_out, x_line_scredit_tbl => v_line_scredit_tbl_out, x_line_scredit_val_tbl => v_line_scredit_val_tbl_out, x_lot_serial_tbl => v_lot_serial_tbl_out, x_lot_serial_val_tbl => v_lot_serial_val_tbl_out, x_action_request_tbl => v_action_request_tbl_out, x_return_status => v_return_status, x_msg_count => v_msg_count, x_msg_data => v_msg_data ); DBMS_OUTPUT.put_line ('Completion of API'); IF v_return_status = fnd_api.g_ret_sts_success THEN COMMIT; DBMS_OUTPUT.put_line ('Line Cancel to Existing Order Success '); ELSE DBMS_OUTPUT.put_line ( 'Line Cancel to Existing Order failed:' || v_msg_data ); ROLLBACK; FOR i IN 1 .. v_msg_count LOOP v_msg_data := oe_msg_pub.get (p_msg_index => i, p_encoded => 'F'); DBMS_OUTPUT.put_line (i || ') ' || v_msg_data); END LOOP; END IF; END;
OE_ORDER_PUB.PROCESS_ORDER(R12.1.3)取消或更新销售订单行
来源:这里教程网
时间:2026-03-03 13:14:32
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- 02 Oracle Database 12c DBA官方手册1.6
02 Oracle Database 12c DBA官方手册1.6
26-03-03 - 12C RMAN-本机cdb差异增量备份恢复多个pdb
12C RMAN-本机cdb差异增量备份恢复多个pdb
26-03-03 - Oracle12c 针对单个pdb的全备与恢复
Oracle12c 针对单个pdb的全备与恢复
26-03-03 - oracle 12c 针对cdb的差异0备与对pdb进行恢复
oracle 12c 针对cdb的差异0备与对pdb进行恢复
26-03-03 - 12C针对cdb全备与 PDB执行不完全恢复(基于SCN)
12C针对cdb全备与 PDB执行不完全恢复(基于SCN)
26-03-03 - ORACLE dblink远程DB表truncat导致本地proc执行报错ORA-12012&ORA-06550&PLS-00907
- 12C PDB使用RMAN的4种完全恢复场景
12C PDB使用RMAN的4种完全恢复场景
26-03-03 - Oracle 12c 创建与删除CDB、PDBs
Oracle 12c 创建与删除CDB、PDBs
26-03-03 - 关于多租户架构
关于多租户架构
26-03-03 - oracle数据库备份之exp增量备份
oracle数据库备份之exp增量备份
26-03-03
