--事务处理
--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 := 0; --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');
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;
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 事务处理的更多相关文章

  1. Oracle EBS OPM 生产批创建事务处理

    --生产批创建事物处理 --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_mmli_tbl gm ...

  2. Oracle EBS OPM 车间发料事务处理

    --车间发料事物处理 --created by jenrry DECLARE l_iface_rec inv.mtl_transactions_interface%ROWTYPE; l_iface_l ...

  3. Oracle EBS OPM update material txn

    --update_material_txn --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_m ...

  4. Oracle EBS 应收事务处理取值

    SELECT ct.org_id ,ct.attribute1 bu_id --核算主体编号 ,ct.attribute2 dept_id --部门编号 ,hca.account_number ,hp ...

  5. Oracle EBS OPM close batch

    --close_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (4000); x_ ...

  6. Oracle EBS OPM convert dtl reservation

    --convert_dtl_reservation --created by jenrry DECLARE l_reservation_rec mtl_reservations%ROWTYPE; l_ ...

  7. Oracle EBS OPM complete step

    --complete_step --created by jenrry DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl g ...

  8. Oracle EBS OPM reshedule batch

    --reschedule_batch --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000 ...

  9. Oracle EBS OPM complete batch

    --complete_batch --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_exc ...

随机推荐

  1. 解决IDEA中进行maven install报:系统资源不足的问题

    一.背景 最近在idea中使用maven对公司的项目进行install的时候老是出现系统资源不足的问题导致install失败,在网上搜索也没找到很好的答案,自己不断摸索,最终在idea的配置里面找到了 ...

  2. node mysql插入中文时报错

    一开始以为是前端传参.数据类型的问题,于是就直接把sql语句中的参数直接改成字符串值,但发现还是报500错误. 所以,这就排除了前端的问题. 剩下的就是数据库了,发现我的表设置有问题.凡是有中文数据的 ...

  3. Shell脚本 | 一键卸载安卓App

    在平时工作的过程中,很多重复性内容可以通过运行脚本文件来代替.一次编写,就能带来很大的效率提升. 今天跟大家分享一个简单的 Shell 脚本,只有区区 20 行左右的代码. 因为有时候我们测试某个应用 ...

  4. PHP 使用 GeoIP 进行不同国家 ip 测试

    $ip = "67.220.91.30";// USA switch (mt_rand(0, 15)) { case 0:// India $ip = "210.212. ...

  5. Visual Studio 2017 取消 break mode

    用 Visual Studio 2017 (以下简称 VS 2017) 运行程序,程序出错后,只是进入中断模式,仅显示 The application is in break mode而没有像 VS ...

  6. Tomcat学习总结(1)——Tomcat入门教程

    一.打包JavaWeb应用 在Java中,使用"jar"命令来对将JavaWeb应用打包成一个War包,jar命令的用法如下: 范例:将JavaWebDemoProject这个Ja ...

  7. nginx 跳转系列

    1.nginx强制跳转https配置,通过http状态吗实现,http状态吗地址: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/3 ...

  8. mac 入门操作

    1. 打开制定目录 在finder里使用command+shift+g 快捷键可以完成到达某路径的操作选中文件/目录,显示简介可以查看路径 2. home end pageUp pageDown 在苹 ...

  9. [转]magento性能优化的教程(非常详细)

    本文转自:https://www.sypopo.com/post/kMQE8dERoV/ 前面优化 mod_deflate模块,将text. css 和 javascript 先进行压缩再发送到浏览器 ...

  10. #if _MSC_VER > 1000 #pragma once #endif 含义

    前提:MFC应用程序中,MainFrm 类头文件 MainFrm.h 中#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000解释 ...