Oracle EBS OPM update material txn
--update_material_txn
--created by jenrry
DECLARE
p_mmti_rec mtl_transactions_interface%ROWTYPE;
p_mmli_tbl gme_common_pvt.mtl_trans_lots_inter_tbl;
x_return_status VARCHAR2 (2000);
p_validation_level NUMBER;
p_init_msg_list VARCHAR2 (2000);
p_commit VARCHAR2 (2000);
x_message_count NUMBER;
x_message_list VARCHAR2 (2000);
l_msg_count NUMBER;
l_msg_data VARCHAR2 (2000);
x_mmt_rec mtl_material_transactions%ROWTYPE;
x_mmln_tbl gme_common_pvt.mtl_trans_lots_num_tbl;
l_txn_count NUMBER;
l_count_t NUMBER;
l_count_i NUMBER;
setup_failure EXCEPTION;
p_org_code VARCHAR2 (3) := 'PR1';
g_debug VARCHAR2 (5) := fnd_profile.VALUE ('AFLOG_LEVEL');
l_user_name VARCHAR2 (80);
l_user_id NUMBER; CURSOR get_user_id (v_user_name IN VARCHAR2)
IS
SELECT user_id
FROM fnd_user
WHERE user_name = v_user_name; PROCEDURE display_messages (p_msg_count IN NUMBER)
IS
MESSAGE VARCHAR2 (2000);
dummy NUMBER;
l_api_name CONSTANT VARCHAR2 (30) := 'DISPLAY_MESSAGES';
BEGIN
FOR i IN 1 .. p_msg_count
LOOP
fnd_msg_pub.get (p_msg_index => i,
p_data => MESSAGE,
p_encoded => 'F',
p_msg_index_out => dummy
);
DBMS_OUTPUT.put_line ('Message ' || TO_CHAR (i) || ' ' || MESSAGE);
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
fnd_msg_pub.add_exc_msg ('wrapper for Update_Material_Txn', l_api_name);
END display_messages;
BEGIN
DBMS_OUTPUT.ENABLE (20000);
l_user_name := 'PROCESS_OPS'; OPEN get_user_id (l_user_name); FETCH get_user_id
INTO l_user_id; IF get_user_id%NOTFOUND
THEN
DBMS_OUTPUT.put_line ('Invalid User ' || l_user_name); CLOSE get_user_id; RAISE NO_DATA_FOUND;
END IF; CLOSE get_user_id; fnd_profile.initialize (l_user_id);
fnd_global.apps_initialize (user_id => l_user_id,
resp_id => NULL,
resp_appl_id => NULL
);
x_return_status := fnd_api.g_ret_sts_success;
fnd_msg_pub.initialize;
gme_common_pvt.g_error_count := 0;
gme_common_pvt.set_timestamp;
gme_common_pvt.g_move_to_temp := fnd_api.g_false;
p_mmti_rec.source_code := 'OPM';
p_mmti_rec.source_header_id := 19492;
p_mmti_rec.transaction_source_id := 186706;
p_mmti_rec.trx_source_line_id := 19492;
--p_mmti_rec.last_updated_by := gme_common_pvt.g_user_ident;
--p_mmti_rec.last_update_login := gme_common_pvt.g_user_ident ;
--p_mmti_rec.last_update_date := gme_common_pvt.g_timestamp ;
--p_mmti_rec.creation_date := gme_common_pvt.g_timestamp ;
--p_mmti_rec.created_by := gme_common_pvt.g_user_ident;
p_mmti_rec.inventory_item_id := 178859;
p_mmti_rec.revision := NULL;
p_mmti_rec.organization_id := 1381;
p_mmti_rec.transaction_date := SYSDATE;
p_mmti_rec.transaction_type_id := gme_common_pvt.g_ing_issue;
p_mmti_rec.transaction_action_id := gme_common_pvt.g_ing_issue_txn_action;
p_mmti_rec.transaction_quantity := -8;
--p_mmti_rec.primary_quantity :=
p_mmti_rec.transaction_uom := 'LB';
p_mmti_rec.subinventory_code := 'PR0';
p_mmti_rec.locator_id := 1355;
p_mmti_rec.transaction_source_type_id := 5;
--p_mmti_rec.transaction_source_name :=
p_mmti_rec.wip_entity_type := 10;
--p_mmti_rec.reason_id := /* p_mmli_tbl(1). last_update_date := gme_common_pvt.g_timestamp ;
p_mmli_tbl(1). last_updated_by := gme_common_pvt.g_user_ident ;
p_mmli_tbl(1). creation_date := gme_common_pvt.g_timestamp ;
p_mmli_tbl(1). created_by := gme_common_pvt.g_user_ident ;
p_mmli_tbl(1). lot_number := 'TCS' ;
p_mmli_tbl(1). transaction_quantity := ; */
gme_api_pub.update_material_txn
(p_api_version => 2.0,
p_validation_level => gme_common_pvt.g_max_errors,
p_init_msg_list => fnd_api.g_false,
p_commit => fnd_api.g_true,
x_message_count => x_message_count,
x_message_list => x_message_list,
x_return_status => x_return_status,
p_transaction_id => 12137851,
p_mmti_rec => p_mmti_rec,
p_mmli_tbl => p_mmli_tbl,
p_create_lot => NULL,
p_generate_lot => NULL,
p_generate_parent_lot => NULL,
x_mmt_rec => x_mmt_rec,
x_mmln_tbl => x_mmln_tbl
);
DBMS_OUTPUT.put_line ( 'msg_count from process trxns='
|| TO_CHAR (l_msg_count)
); IF l_msg_count > 1
THEN
display_messages (l_msg_count);
END IF; DBMS_OUTPUT.put_line ( 'after process transactions x_return_status='
|| TO_CHAR (x_return_status)
);
-- Output the results
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_id = '
|| TO_CHAR (x_mmt_rec.transaction_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_type_id = '
|| TO_CHAR (x_mmt_rec.transaction_type_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_action_id = '
|| TO_CHAR (x_mmt_rec.transaction_action_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_source_id = '
|| TO_CHAR (x_mmt_rec.transaction_source_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.trx_source_line_id = '
|| TO_CHAR (x_mmt_rec.trx_source_line_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.source_line_id = '
|| TO_CHAR (x_mmt_rec.source_line_id),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_quantity = '
|| TO_CHAR (x_mmt_rec.transaction_quantity),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_uom = '
|| TO_CHAR (x_mmt_rec.transaction_uom),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.transaction_date = '
|| TO_CHAR (x_mmt_rec.transaction_date),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmln_tbl.count = '
|| TO_CHAR (x_mmln_tbl.COUNT),
1,
255
)
); IF (x_mmln_tbl.COUNT > 0)
THEN
FOR i IN 1 .. x_mmln_tbl.COUNT
LOOP
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmln_tbl((i).lot_number = '
|| TO_CHAR (x_mmln_tbl.COUNT),
1,
255
)
);
END LOOP;
END IF; DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.LAST_UPDATE_DATE = '
|| TO_CHAR (x_mmt_rec.last_update_date),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.LAST_UPDATED_BY = '
|| TO_CHAR (x_mmt_rec.last_updated_by),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.CREATION_DATE = '
|| TO_CHAR (x_mmt_rec.creation_date),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.CREATED_BY = '
|| TO_CHAR (x_mmt_rec.created_by),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ( 'x_mmt_rec.LAST_UPDATE_LOGIN = '
|| TO_CHAR (x_mmt_rec.last_update_login),
1,
255
)
);
DBMS_OUTPUT.put_line (SUBSTR ('x_return_status = ' || x_return_status,
1,
255
)
);
DBMS_OUTPUT.put_line ('x_message_count = ' || TO_CHAR (x_message_count));
DBMS_OUTPUT.put_line (SUBSTR ('x_message_list = ' || x_message_list, 1,
255)
);
gme_common_pvt.count_and_get (x_count => x_message_count,
p_encoded => fnd_api.g_false,
x_data => x_message_list
); IF x_message_count > 1
THEN
display_messages (x_message_count);
END IF;
EXCEPTION
WHEN setup_failure
THEN
DBMS_OUTPUT.put_line (' in setup failure');
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line (SUBSTR ( 'Error '
|| TO_CHAR (SQLCODE)
|| ': '
|| SQLERRM,
1,
255
)
);
RAISE;
END;
/
Oracle EBS OPM update material txn的更多相关文章
- Oracle EBS OPM 生产批创建事务处理
--生产批创建事物处理 --created by jenrry DECLARE p_mmti_rec mtl_transactions_interface%ROWTYPE; p_mmli_tbl gm ...
- 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 ...
- Oracle EBS OPM release step
--release_step生产批 --created by jenrry SET serveroutput on DECLARE x_return_status VARCHAR2 (1); l_ex ...
- Oracle EBS OPM 发放生产批
--发放生产批 --created by jenrry DECLARE x_return_status VARCHAR2 (1); l_exception_material_tbl gme_commo ...
随机推荐
- redis学习(一) redis的介绍与安装
redis简单介绍 redis全称remote-dictionary-server 直译为远程字典服务器, 是一个高性能的key-value存储系统,也被称为数据结构服务器,因为其所存储的数据值(va ...
- es6学习笔记11--Proxy和Reflect
Proxy概述 Proxy用于修改某些操作的默认行为,等同于在语言层面做出修改,所以属于一种“元编程”(meta programming),即对编程语言进行编程. Proxy可以理解成,在目标对象之前 ...
- 3D转弯保护区长啥样?
3D转弯保护区长啥样? 2015-12-06 刘崇军 风螺旋线 在课本中.规范中看到的转弯保护区一直是平面化的样子.我们知道副区是由主区外扩而成,但具体怎样精确外扩无从知晓:我们知道主区边界至副区边界 ...
- java权限控制以及变量的初始化
知识是靠积累的,不断的温习会帮你让你遇到许多问题,解决完这些问题之后,会收获许多,233333333333333. 1.java访问控制符 2.java变量初始化问题 默认构造方法的名字与类名相同,它 ...
- Eclipse MAT:浅堆 vs 保留堆
来自:唐尤华 https://dzone.com/articles/eclipse-mat-shallow-heap-retained-heap 有没有想要搞清楚浅堆(Shallow Heap)和保留 ...
- Druid链接池配置加密密码链接数据库
Druid是阿里巴巴开源平台上一个数据库连接池实现,它结合了C3P0.DBCP.PROXOOL等DB池的优点,同时加入了日志监控,可以很好的监控DB池连接和SQL的执行情况,可以说是针对监控而生的DB ...
- MongoDB中空间数据的存储和操作
本文使用官方C# Driver,实现在MongoDB中存储,查询空间数据(矢量) 空间数据的存储 本例中,从一个矢量文件(shapefile格式)中读取矢量要素空间信息以及属性表,并写入到MongoD ...
- Linux安装redis和部署
第一步:下载安装包 访问https://redis.io/download 到官网进行下载.这里下载最新的4.0版本. 第二步:安装 1.通过远程管理工具,将压缩包拷贝到Linux服务器中,执行解压 ...
- Spring、Springmvc整合web的web.xml配置
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http:// ...
- HDU4725(KB4-P SPFA+LLL+SLF优化)
The Shortest Path in Nya Graph Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ...