Oracle EBS OPM 车间发料事务处理
--车间发料事物处理
--created by jenrry
DECLARE l_iface_rec inv.mtl_transactions_interface%ROWTYPE;
l_iface_lot_rec inv.mtl_transaction_lots_interface%ROWTYPE;
l_cur_mfg_org_id NUMBER := 127; --Current Inv Organization
l_user_id NUMBER := 6058; --User ID, Sysadmin here l_outcome BOOLEAN;
l_timeout NUMBER := 100;
l_error_code VARCHAR2(4000);
l_error_explanation VARCHAR2(4000); BEGIN
fnd_global.apps_initialize (user_id => l_user_id,
resp_id => 51010,
resp_appl_id => 553
);
fnd_profile.put ('AFLOG_LEVEL', '1');
mo_global.set_policy_context('S',
127);
l_iface_rec.last_update_date := SYSDATE;
l_iface_rec.last_updated_by := l_user_id;
l_iface_rec.creation_date := SYSDATE;
l_iface_rec.created_by := l_user_id;
l_iface_rec.last_update_login := -1; l_iface_lot_rec.last_update_date := SYSDATE;
l_iface_lot_rec.last_updated_by := l_user_id;
l_iface_lot_rec.creation_date := SYSDATE;
l_iface_lot_rec.created_by := l_user_id;
l_iface_lot_rec.last_update_login := -1; SELECT mtl_material_transactions_s.NEXTVAL INTO l_iface_rec.transaction_interface_id FROM dual; l_iface_rec.transaction_header_id := l_iface_rec.transaction_interface_id;
l_iface_rec.transaction_mode := 3;
l_iface_rec.process_flag := 1;
l_iface_rec.transaction_type_id := 35; --mtl_transaction_types
l_iface_rec.transaction_source_id := 408953; --wip_entity_id
l_iface_rec.wip_entity_type := 10; l_iface_rec.organization_id := l_cur_mfg_org_id;
l_iface_rec.inventory_item_id := 623;
l_iface_rec.subinventory_code := 'Y02';
l_iface_rec.transaction_quantity := -1;
l_iface_rec.primary_quantity := -1;
l_iface_rec.transaction_uom := '个';
l_iface_rec.transaction_date := SYSDATE ;
l_iface_rec.source_code := 'Test Only';
l_iface_rec.source_header_id := 987654321;
l_iface_rec.source_line_id := 987654321;
l_iface_rec.locator_id := 3;
INSERT INTO inv.mtl_transactions_interface VALUES l_iface_rec; l_iface_lot_rec.transaction_interface_id := l_iface_rec.transaction_interface_id;
l_iface_lot_rec.lot_number := '201308-001';
l_iface_lot_rec.transaction_quantity := l_iface_rec.transaction_quantity;
l_iface_lot_rec.source_code := l_iface_rec.source_code;
l_iface_lot_rec.source_line_id := l_iface_rec.source_line_id; INSERT INTO inv.mtl_transaction_lots_interface VALUES l_iface_lot_rec; l_timeout := 100;
-- Auto commit whenever success or failure!!
l_outcome := mtl_online_transaction_pub.process_online(p_transaction_header_id => l_iface_rec.transaction_header_id,
p_timeout => l_timeout,
p_error_code => l_error_code,
p_error_explanation => l_error_explanation);
IF (l_outcome = FALSE) THEN
dbms_output.put_line('Failed to process the transaction');
dbms_output.put_line('Error code: ' || l_error_code);
dbms_output.put_line('Error message: ' || l_error_explanation);
DELETE inv.mtl_transactions_interface
WHERE transaction_header_id = l_iface_rec.transaction_header_id;
COMMIT;
ELSE
dbms_output.put_line('Transaction with header id ' ||
to_char(l_iface_rec.transaction_header_id) ||
' has been processed successfully');
COMMIT;
END IF; END;
Oracle EBS OPM 车间发料事务处理的更多相关文章
- Oracle EBS OPM 事务处理
--事务处理 --created by jenrry DECLARE l_iface_rec inv.mtl_transactions_interface%ROWTYPE; l_iface_lot_r ...
- Oracle EBS OPM 生产批创建事务处理
--生产批创建事物处理 --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_mmli_tbl gm ...
- Oracle EBS OPM update material txn
--update_material_txn --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_m ...
- Oracle EBS OPM close batch
--close_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (4000); x_ ...
- Oracle EBS OPM convert dtl reservation
--convert_dtl_reservation --created by jenrry DECLARE l_reservation_rec mtl_reservations%ROWTYPE; l_ ...
- Oracle EBS OPM complete step
--complete_step --created by jenrry DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl g ...
- Oracle EBS OPM reshedule batch
--reschedule_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000 ...
- Oracle EBS OPM complete batch
--complete_batch --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_exc ...
- Oracle EBS OPM 创建生产批
--创建生产批 --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000); x_return ...
随机推荐
- C#基础篇四数组
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace P01A ...
- 运行vue init webpack vueTest时报错
前言:好久没动vue项目了,早上心血来潮.准备写一个项目,然后坚持在github更新,不为别的,只为养成一个习惯. 运行vue init webpack vueTest时,报了下面的错误: 当时我思考 ...
- js便签笔记(10) - 分享:json.js源码解读笔记
1. 如何理解“json” 首先应该意识到,json是一种数据转换格式,既然是个“格式”,就是个抽象的东西.它不是js对象,也不是字符串,它只是一种格式,一种规定而已. 这个格式规定了如何将js对象转 ...
- php使用 utf8_encode 来将特殊字符转成 utf8
如果在接受 $_POST 或 $_GET 时发生类似的错误报告:SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xF6te ...
- MySQL 5.7 新备份工具mysqlpump 使用说明 - 运维小结
之前详细介绍了Mysqldump备份工具使用,下面说下MySQL5.7之后新添加的备份工具mysqlpump.mysqlpump是mysqldump的一个衍生,mysqldump备份功能这里就不多说了 ...
- 【IT笔试面试题整理】数组中出现次数超过一半的数字
[试题描述]数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字. [试题分析]时间复杂度O(n),空间复杂度O(1) 思路1: 创建一个hash_map,key为数组中的数,value为此数 ...
- Netty 高性能之道 FastThreadLocal 源码分析(快且安全)
前言 Netty 作为高性能框架,对 JDK 中的很多类都进行了封装了和优化,例如 Thread 类,Netty 使用了 FastThreadLocalRunnable 对所有 DefaultThre ...
- Spring基础(8) : 延迟加载,Bean的作用域,Bean生命周期
1.延迟加载 <bean id="p" class="com.Person" lazy-init="true"/> @Confi ...
- 设计模式学习--面向对象的5条设计原则之单一职责原则--SRP
一.SRP简介(SRP--Single-Responsibility Principle): 就一个类而言,应该只专注于做一件事和仅有一个引起它变化的原因. 所谓职责,我们可以理解他为功能,就是设 ...
- FineUI 布局宽度自适应,后台回调js方法
FineUI页面布局,宽度自适应 @(F.Panel().CssClass().ShowBorder().BoxConfigChildMargin("0 5 0 0").ShowH ...