news 2026/4/30 5:34:09

Oracle EBS OM 销售订单信息更新API

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Oracle EBS OM 销售订单信息更新API

本文只是更新了头行销售员,其他字段可自行测试,另外只有未关闭的订单行才能进行更新

DECLARE -- Non-scalar parameters require additional processing p_header_rec oe_order_pub.header_rec_type; p_old_header_rec oe_order_pub.header_rec_type; p_header_val_rec oe_order_pub.header_val_rec_type; p_old_header_val_rec oe_order_pub.header_val_rec_type; p_header_adj_tbl oe_order_pub.header_adj_tbl_type; p_old_header_adj_tbl oe_order_pub.header_adj_tbl_type; p_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type; p_old_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type; p_header_price_att_tbl oe_order_pub.header_price_att_tbl_type; p_old_header_price_att_tbl oe_order_pub.header_price_att_tbl_type; p_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type; p_old_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type; p_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type; p_old_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type; p_header_scredit_tbl oe_order_pub.header_scredit_tbl_type; p_old_header_scredit_tbl oe_order_pub.header_scredit_tbl_type; p_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type; p_old_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type; p_header_payment_tbl oe_order_pub.header_payment_tbl_type; p_old_header_payment_tbl oe_order_pub.header_payment_tbl_type; p_header_payment_val_tbl oe_order_pub.header_payment_val_tbl_type; p_old_header_payment_val_tbl oe_order_pub.header_payment_val_tbl_type; p_line_tbl oe_order_pub.line_tbl_type; p_old_line_tbl oe_order_pub.line_tbl_type; p_line_val_tbl oe_order_pub.line_val_tbl_type; p_old_line_val_tbl oe_order_pub.line_val_tbl_type; p_line_adj_tbl oe_order_pub.line_adj_tbl_type; p_old_line_adj_tbl oe_order_pub.line_adj_tbl_type; p_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type; p_old_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type; p_line_price_att_tbl oe_order_pub.line_price_att_tbl_type; p_old_line_price_att_tbl oe_order_pub.line_price_att_tbl_type; p_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type; p_old_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type; p_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type; p_old_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type; p_line_scredit_tbl oe_order_pub.line_scredit_tbl_type; p_old_line_scredit_tbl oe_order_pub.line_scredit_tbl_type; p_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type; p_old_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type; p_line_payment_tbl oe_order_pub.line_payment_tbl_type; p_old_line_payment_tbl oe_order_pub.line_payment_tbl_type; p_line_payment_val_tbl oe_order_pub.line_payment_val_tbl_type; p_old_line_payment_val_tbl oe_order_pub.line_payment_val_tbl_type; p_lot_serial_tbl oe_order_pub.lot_serial_tbl_type; p_old_lot_serial_tbl oe_order_pub.lot_serial_tbl_type; p_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type; p_old_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type; p_action_request_tbl oe_order_pub.request_tbl_type; x_header_rec oe_order_pub.header_rec_type; x_header_val_rec oe_order_pub.header_val_rec_type; x_header_adj_tbl oe_order_pub.header_adj_tbl_type; x_header_adj_val_tbl oe_order_pub.header_adj_val_tbl_type; x_header_price_att_tbl oe_order_pub.header_price_att_tbl_type; x_header_adj_att_tbl oe_order_pub.header_adj_att_tbl_type; x_header_adj_assoc_tbl oe_order_pub.header_adj_assoc_tbl_type; x_header_scredit_tbl oe_order_pub.header_scredit_tbl_type; x_header_scredit_val_tbl oe_order_pub.header_scredit_val_tbl_type; x_header_payment_tbl oe_order_pub.header_payment_tbl_type; x_header_payment_val_tbl oe_order_pub.header_payment_val_tbl_type; x_line_tbl oe_order_pub.line_tbl_type; x_line_val_tbl oe_order_pub.line_val_tbl_type; x_line_adj_tbl oe_order_pub.line_adj_tbl_type; x_line_adj_val_tbl oe_order_pub.line_adj_val_tbl_type; x_line_price_att_tbl oe_order_pub.line_price_att_tbl_type; x_line_adj_att_tbl oe_order_pub.line_adj_att_tbl_type; x_line_adj_assoc_tbl oe_order_pub.line_adj_assoc_tbl_type; x_line_scredit_tbl oe_order_pub.line_scredit_tbl_type; x_line_scredit_val_tbl oe_order_pub.line_scredit_val_tbl_type; x_line_payment_tbl oe_order_pub.line_payment_tbl_type; x_line_payment_val_tbl oe_order_pub.line_payment_val_tbl_type; x_lot_serial_tbl oe_order_pub.lot_serial_tbl_type; x_lot_serial_val_tbl oe_order_pub.lot_serial_val_tbl_type; x_action_request_tbl oe_order_pub.request_tbl_type; p_header_customer_info_tbl oe_order_pub.customer_info_table_type; p_line_customer_info_tbl oe_order_pub.customer_info_table_type; p_org_id NUMBER; p_operating_unit NUMBER; p_api_version_number NUMBER := 1; p_init_msg_list VARCHAR2(2000); p_return_values VARCHAR2(2000); p_action_commit VARCHAR2(2000); x_return_status VARCHAR2(2000); x_msg_count NUMBER; x_msg_data VARCHAR2(2000); l_msg_data VARCHAR2(3000); p_rtrim_data VARCHAR2(2000); p_validate_desc_flex VARCHAR2(2000); l_success_cnt NUMBER := 0; l_failed_cnt NUMBER := 0; CURSOR c_mass_upd IS SELECT t.* ,t.rowid ,h.org_id FROM cux.cux_om_mass_update_temp t ,oe_order_headers_all h WHERE 1 = 1 AND t.header_id = h.header_id --AND t.order_number = '451182452' AND nvl(t.status ,'xx') <> 'S' AND t.salesrep_id_new IS NOT NULL AND t.batch_no = 20250423001 ORDER BY t.header_id ,t.line_id; BEGIN dbms_output.put_line('Starting of script'); fnd_global.apps_initialize(user_id => 0 ,resp_id => 50947 ,resp_appl_id => 20003); mo_global.init('ONT'); dbms_output.put_line('Starting of API'); FOR r IN c_mass_upd LOOP oe_msg_pub.initialize; -- Header Record -- p_header_rec := oe_order_pub.g_miss_header_rec; p_header_rec.operation := oe_globals.g_opr_update; p_header_rec.header_id := r.header_id; -- 先头行销售员一起更新,再将失败记录行销售员更新一下 --p_header_rec.salesrep_id := r.salesrep_id_new; -- Line Record -- p_line_tbl(1) := oe_order_pub.g_miss_line_rec; p_line_tbl(1).operation := oe_globals.g_opr_update; p_line_tbl(1).line_id := r.line_id; p_line_tbl(1).salesrep_id := r.salesrep_id_new; p_org_id := r.org_id; -- Call the procedure oe_order_pub.process_order(p_org_id => p_org_id ,p_operating_unit => p_operating_unit ,p_api_version_number => p_api_version_number ,p_init_msg_list => p_init_msg_list ,p_return_values => p_return_values ,p_action_commit => p_action_commit ,x_return_status => x_return_status ,x_msg_count => x_msg_count ,x_msg_data => x_msg_data ,p_header_rec => p_header_rec ,p_old_header_rec => p_old_header_rec ,p_header_val_rec => p_header_val_rec ,p_old_header_val_rec => p_old_header_val_rec ,p_header_adj_tbl => p_header_adj_tbl ,p_old_header_adj_tbl => p_old_header_adj_tbl ,p_header_adj_val_tbl => p_header_adj_val_tbl ,p_old_header_adj_val_tbl => p_old_header_adj_val_tbl ,p_header_price_att_tbl => p_header_price_att_tbl ,p_old_header_price_att_tbl => p_old_header_price_att_tbl ,p_header_adj_att_tbl => p_header_adj_att_tbl ,p_old_header_adj_att_tbl => p_old_header_adj_att_tbl ,p_header_adj_assoc_tbl => p_header_adj_assoc_tbl ,p_old_header_adj_assoc_tbl => p_old_header_adj_assoc_tbl ,p_header_scredit_tbl => p_header_scredit_tbl ,p_old_header_scredit_tbl => p_old_header_scredit_tbl ,p_header_scredit_val_tbl => p_header_scredit_val_tbl ,p_old_header_scredit_val_tbl => p_old_header_scredit_val_tbl ,p_header_payment_tbl => p_header_payment_tbl ,p_old_header_payment_tbl => p_old_header_payment_tbl ,p_header_payment_val_tbl => p_header_payment_val_tbl ,p_old_header_payment_val_tbl => p_old_header_payment_val_tbl ,p_line_tbl => p_line_tbl ,p_old_line_tbl => p_old_line_tbl ,p_line_val_tbl => p_line_val_tbl ,p_old_line_val_tbl => p_old_line_val_tbl ,p_line_adj_tbl => p_line_adj_tbl ,p_old_line_adj_tbl => p_old_line_adj_tbl ,p_line_adj_val_tbl => p_line_adj_val_tbl ,p_old_line_adj_val_tbl => p_old_line_adj_val_tbl ,p_line_price_att_tbl => p_line_price_att_tbl ,p_old_line_price_att_tbl => p_old_line_price_att_tbl ,p_line_adj_att_tbl => p_line_adj_att_tbl ,p_old_line_adj_att_tbl => p_old_line_adj_att_tbl ,p_line_adj_assoc_tbl => p_line_adj_assoc_tbl ,p_old_line_adj_assoc_tbl => p_old_line_adj_assoc_tbl ,p_line_scredit_tbl => p_line_scredit_tbl ,p_old_line_scredit_tbl => p_old_line_scredit_tbl ,p_line_scredit_val_tbl => p_line_scredit_val_tbl ,p_old_line_scredit_val_tbl => p_old_line_scredit_val_tbl ,p_line_payment_tbl => p_line_payment_tbl ,p_old_line_payment_tbl => p_old_line_payment_tbl ,p_line_payment_val_tbl => p_line_payment_val_tbl ,p_old_line_payment_val_tbl => p_old_line_payment_val_tbl ,p_lot_serial_tbl => p_lot_serial_tbl ,p_old_lot_serial_tbl => p_old_lot_serial_tbl ,p_lot_serial_val_tbl => p_lot_serial_val_tbl ,p_old_lot_serial_val_tbl => p_old_lot_serial_val_tbl ,p_action_request_tbl => p_action_request_tbl ,x_header_rec => x_header_rec ,x_header_val_rec => x_header_val_rec ,x_header_adj_tbl => x_header_adj_tbl ,x_header_adj_val_tbl => x_header_adj_val_tbl ,x_header_price_att_tbl => x_header_price_att_tbl ,x_header_adj_att_tbl => x_header_adj_att_tbl ,x_header_adj_assoc_tbl => x_header_adj_assoc_tbl ,x_header_scredit_tbl => x_header_scredit_tbl ,x_header_scredit_val_tbl => x_header_scredit_val_tbl ,x_header_payment_tbl => x_header_payment_tbl ,x_header_payment_val_tbl => x_header_payment_val_tbl ,x_line_tbl => x_line_tbl ,x_line_val_tbl => x_line_val_tbl ,x_line_adj_tbl => x_line_adj_tbl ,x_line_adj_val_tbl => x_line_adj_val_tbl ,x_line_price_att_tbl => x_line_price_att_tbl ,x_line_adj_att_tbl => x_line_adj_att_tbl ,x_line_adj_assoc_tbl => x_line_adj_assoc_tbl ,x_line_scredit_tbl => x_line_scredit_tbl ,x_line_scredit_val_tbl => x_line_scredit_val_tbl ,x_line_payment_tbl => x_line_payment_tbl ,x_line_payment_val_tbl => x_line_payment_val_tbl ,x_lot_serial_tbl => x_lot_serial_tbl ,x_lot_serial_val_tbl => x_lot_serial_val_tbl ,x_action_request_tbl => x_action_request_tbl ,p_rtrim_data => p_rtrim_data ,p_validate_desc_flex => p_validate_desc_flex ,p_header_customer_info_tbl => p_header_customer_info_tbl ,p_line_customer_info_tbl => p_line_customer_info_tbl); --dbms_output.put_line('Completion of API'); --dbms_output.put_line('x_return_status: ' || x_return_status); IF x_return_status = fnd_api.g_ret_sts_success THEN UPDATE cux.cux_om_mass_update_temp c SET c.status = 'S' ,c.err_msg = NULL WHERE c.rowid = r.rowid; l_success_cnt := l_success_cnt + 1; COMMIT; /*dbms_output.put_line('Order Import Success : ' || x_header_rec.header_id);*/ ELSE /*dbms_output.put_line('Order Import failed v_msg_data:' || x_msg_data); dbms_output.put_line('Order Import failed v_msg_count:' || x_msg_count);*/ FOR i IN 1 .. oe_msg_pub.count_msg LOOP l_msg_data := oe_msg_pub.get(p_msg_index => i ,p_encoded => 'F'); --dbms_output.put_line(i || ') ' || x_msg_data); END LOOP; ROLLBACK; l_failed_cnt := l_failed_cnt + 1; UPDATE cux.cux_om_mass_update_temp c SET c.status = 'E' ,c.err_msg = l_msg_data WHERE c.rowid = r.rowid; COMMIT; END IF; END LOOP; COMMIT; dbms_output.put_line('SUCCESS Count: ' || l_success_cnt); dbms_output.put_line('FAILED Count: ' || l_failed_cnt); dbms_output.put_line('Completion of API'); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(SQLCODE || '.' || SQLERRM); ROLLBACK; END;
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/23 21:56:24

3步掌控Mac性能:AppPolice让你的电脑告别卡顿烦恼

3步掌控Mac性能&#xff1a;AppPolice让你的电脑告别卡顿烦恼 【免费下载链接】AppPolice MacOS app for quickly limiting CPU usage by running applications 项目地址: https://gitcode.com/gh_mirrors/ap/AppPolice 你是否曾经遇到过这样的情况&#xff1a;当你在处…

作者头像 李华
网站建设 2026/4/24 16:00:43

终极免费健康助手:Workrave完全使用指南

终极免费健康助手&#xff1a;Workrave完全使用指南 【免费下载链接】workrave Workrave is a program that assists in the recovery and prevention of Repetitive Strain Injury (RSI). The program frequently alerts you to take micro-pauses, rest breaks and restricts…

作者头像 李华
网站建设 2026/4/26 8:43:27

Mirai Console Loader 终极配置指南:从零构建QQ机器人

Mirai Console Loader 终极配置指南&#xff1a;从零构建QQ机器人 【免费下载链接】mirai-console-loader 模块化、轻量级且支持完全自定义的 mirai 加载器。 项目地址: https://gitcode.com/gh_mirrors/mi/mirai-console-loader Mirai Console Loader&#xff08;简称M…

作者头像 李华
网站建设 2026/4/23 16:55:08

AI营销技术强的企业

AI营销技术强的企业&#xff1a;如何通过优质语料提升品牌影响力引言在当今数字化时代&#xff0c;AI营销技术已经成为企业竞争的重要利器。随着人工智能技术的不断进步&#xff0c;越来越多的企业开始利用AI来优化营销策略、提升品牌影响力。本文将探讨如何通过优质语料提升企…

作者头像 李华
网站建设 2026/4/28 18:12:35

sar 命令

目录 1.背景介绍 2. sar 介绍 3. sar 使用 3.1 参数说明 3.2 监控指定网口带宽、速率 1.背景介绍 需要监控网口带宽 2. sar 介绍 sar 是一个强大的系统性能监控工具&#xff0c;属于 sysstat 工具包的一部分。它可以收集和报告系统的 CPU、内存、I/O、网络等多方面的性…

作者头像 李华
网站建设 2026/4/29 7:09:16

自动驾驶的“数据魔法师“:卡尔曼滤波如何让车辆看得更准

自动驾驶的"数据魔法师"&#xff1a;卡尔曼滤波如何让车辆看得更准 【免费下载链接】autoware 项目地址: https://gitcode.com/gh_mirrors/aut/Autoware 在自动驾驶的世界里&#xff0c;传感器数据就像一张布满噪点的照片——激光雷达的点云中混杂着雨滴干扰…

作者头像 李华