--事务处理
--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. StreamSets学习系列之StreamSets的Core Tarball方式安装(图文详解)

    不多说,直接上干货! 前期博客 StreamSets学习系列之StreamSets支持多种安装方式[Core Tarball.Cloudera Parcel .Full Tarball .Full R ...

  2. 使用vue3.0和element实现后台管理模板

    通过自己所学的这段时间,利用空余时间,使用vue3.0脚手架搭建的一个关于后台的管理模板,所实现功能也是模仿一个后台的界面,数据分为两种存放,一种是直接存储到mlab,这里的数据是存放这登录注册,只有 ...

  3. Chrome 开发工具之Timeline/Performance

    之前有说到Element,Console,Sources大多运用于debug,Network可用于debug和查看性能,今天的主角Timeline(现已更名Performance)更多的是用在性能优化 ...

  4. Django使用Signals监测model字段变化发送通知

    上一篇文章<运维效率之数据迁移自动化>中讲到了工单通知,本文将介绍工单通知实现过程中的一些小技巧.所有演示均基于Django2.0 阅读此篇文章你可以: 解锁一个python if的使用新 ...

  5. 浅析Session和Cookie

    Cookie   Cookie的作用,就是当一个用户通过http访问一个服务器时,这个服务器会将一些key/value键值对返回给客户端浏览器,并给这些数据加上一些限制条件,在条件符合时这个用户访问该 ...

  6. Spring Security 之 Remember-Me (记住我)

    效果:在用户的session(会话)过期或者浏览器关闭后,应用程序仍能记住它.用户可选择是否被记住.(在登录界面选择)   “记住”是什么意思?     就是下次你再访问的时候,直接进入系统,而不需要 ...

  7. elasticSearch6源码分析(3)cluster模块

    1. cluser概述 One of the main roles of the master is to decide which shards to allocate to which nodes ...

  8. .16-浅析webpack源码之编译后流程梳理

    这节把编译打包后的流程梳理一下,然后集中处理compile. 之前忽略了一个点,如下: new NodeEnvironmentPlugin().apply(compiler); // 引入插件加载 i ...

  9. C# an error has occurred while updating the entries.see the log file

    message:An error occurred while updating the entries. See the inner exception for details. C# 在执行插入方 ...

  10. 乐字节-Java8新特性之Optional

    上一篇小乐带大家了解了Java新特性之Stream,接下来将会继续述说Java新特性之Optional Optional<T>类(java.util.Optional)是一个容器类,代表一 ...