PURPOSE:

This post is to provide a sample script to Release a hold on sales order using an API OE_ORDER_PUB.PROCESS_ORDER.

TEST INSTANCE:  R12.1.1

SCRIPT:

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;

BEGIN

DBMS_OUTPUT.PUT_LINE('Starting of script');

-- Setting the Enviroment --

fnd_global.apps_initialize (user_id        => 1450,

resp_id        => 50675,

resp_appl_id   => 700);

oe_msg_pub.initialize;

mo_global.set_org_context (p_org_id_char       => 81,

p_sp_id_char        => null,

p_appl_short_name   => 'ONT');

--This is to Release hold an order header

v_action_request_tbl (1)              := oe_order_pub.g_miss_request_rec;

v_action_request_tbl (1).entity_id    := 333351; -- Header ID of the order

v_action_request_tbl (1).entity_code  := OE_GLOBALS.G_ENTITY_HEADER;

v_action_request_tbl (1).request_type := OE_GLOBALS.G_RELEASE_HOLD;

v_action_request_tbl (1).param1       := 1041;    -- hold_id

v_action_request_tbl (1).param2       := 'O';   -- indicator that it is an order hold

v_action_request_tbl (1).param3       := 333351; -- Header ID of the order

v_action_request_tbl (1).param4       := 'AR_AUTOMATIC'; -- Release Reason Code

/*

--This is to Release hold an order line

v_action_request_tbl (1)              := oe_order_pub.g_miss_request_rec;

v_action_request_tbl (1).entity_id    := 286897; -- LINE ID of the order

v_action_request_tbl (1).entity_code  := OE_GLOBALS.G_ENTITY_LINE;

v_action_request_tbl (1).request_type := OE_GLOBALS.G_RELEASE_HOLD;

v_action_request_tbl (1).param1       := 1041;    -- hold_id

v_action_request_tbl (1).param2       := 'O';   -- indicator that it is an order hold

v_action_request_tbl (1).param3       := 286897; -- LINE ID of the order

v_action_request_tbl (1).param4       := 'AR_AUTOMATIC'; -- Release Reason Code

*/

DBMS_OUTPUT.PUT_LINE('Starting of API');

-- Calling the API to Release hold on 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 ('Releasing Hold on Sales Order is Success ');

ELSE

DBMS_OUTPUT.put_line ('Releasing Hold on Sales 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;

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;

来自 <http://www.shareoracleapps.com/2010/06/oe-order-pub-process-order-to-release.html>

最新文章

  1. Linux C++ 开发简介
  2. ASP.NET MVC为字段设置多语言显示 [转]
  3. Windows Live Writer离线编写博客
  4. 【POJ 1035】Spell checker
  5. ToDo系列
  6. SQLServer2008 和SQLServer2008 R2版本导出 数据库结构和数据sql
  7. HDFS入门详解
  8. tomcat 产生heapdump文件配置
  9. TOGAF架构内容框架之内容元模型(下)
  10. Android 6.0 M userdebug版本执行adb remount失败
  11. Linux show funny time[ liunx 有趣的东西展示]
  12. jQuery如何停止元素的animate动画,还有怎样判断是否处于动画状态
  13. 手把手教你安装nmon
  14. IT? 挨踢
  15. 基于Confluent.Kafka实现的KafkaConsumer消费者类和KafkaProducer消息生产者类型
  16. mpvue图片轮播遇到的问题
  17. 检查mono兼容性的工具MOAM
  18. webpack初起步
  19. PHP 浮点数 转化 整数方法对比 ceil,floor,round,intval,number_format
  20. 数据库——MySQL

热门文章

  1. 【codeforces85D】
  2. 网站服务器压力Web性能测试(3):http_load:测试web服务器的吞吐量与负载
  3. springboot基础知识学习
  4. yii2 一对多关系的对分页造成的影响
  5. cpu占用高 20180108
  6. 【Android开发日记】之基础篇(二)——Android的动画效果
  7. 关于进度管理工具Gantt图
  8. 【C++】C++11的auto和decltype关键字
  9. python基础(1)---python简介
  10. (翻译)Xamarin.Essentials 最新预览版的更多跨平台 API