博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Using script to submit INV Manager to process MTI/MMTT
阅读量:6652 次
发布时间:2019-06-25

本文共 3104 字,大约阅读时间需要 10 分钟。

1.Using script to submit INV Manager to process MMTT

/* * When prompted for user_id, resp_id and resp_appl_id, ask ct enter the correct values for * these variables. The values can be obtained by logging into Inventory * reponsibility and from menu Help->Diagnostics->Examine, select block as * $PROFILES and field as the 3 variables and note down the values of each. */ SET SEVEROUTPUT ON declare l_header_id number; p_userid NUMBER := &user_id; p_respid NUMBER := &resp_id; p_applid NUMBER := &resp_appl_id; retmsg varchar2(240); retval number; prnmsg varchar2(256); begin select mtl_material_transactions_s.nextval into l_header_id from dual; update mtl_material_transactions_temp set process_flag = 'Y', lock_flag = NULL, transaction_mode = 3, error_code = NULL, error_explanation = NULL, transaction_header_id = l_header_id where nvl(transaction_status, -999) <> 2 and transaction_action_id = 8 and physical_adjustment_id is not null and transaction_source_id in (3694,3674); fnd_global.apps_initialize(p_userid, p_respid, p_applid); --Call Online TM retval := INV_LPN_TRX_PUB.PROCESS_LPN_TRX(p_trx_hdr_id => l_header_id, x_proc_msg => retmsg, p_proc_mode => 1); if (length(retmsg) > 200) then prnmsg := substr(retmsg, 1, 200); else prnmsg := retmsg; end if; if (retval = 0) then dbms_output.put_line(' All OK . msg:'||prnmsg); commit; --TM success so commit. else dbms_output.put_line(' Error . msg:'||prnmsg); rollback; --TM failed so rollback insert and update. end if; end; /
2.Using script to submit INV Manager to process MTI

DECLARE l_ret_val NUMBER ; l_return_status VARCHAR2(1); l_msg_data VARCHAR2(2000); l_trans_count NUMBER ; l_msg_count NUMBER ; l_error_code VARCHAR2(100); l_error_explanation VARCHAR2(2000); BEGIN fnd_profile.put('INV_DEBUG_TRACE', '1'); fnd_profile.put('INV_DEBUG_FILE', '/sqlcom/log/mz121dv3/utl/tm28.log'); fnd_profile.put('INV_DEBUG_LEVEL', 11); fnd_profile.put('USER_ID', '1068'); -- fnd_profile.put('SECURITY_GROUP_ID', '0'); dbms_output.put_line('Calling TM'); l_ret_val := INV_TXN_MANAGER_PUB.process_Transactions( p_api_version => 1.0 , p_init_msg_list => fnd_api.g_false , p_commit => fnd_api.g_false , p_validation_level => fnd_api.g_valid_level_full , x_return_status => l_return_status , x_msg_count => l_msg_count , x_msg_data => l_msg_data , x_trans_count => l_trans_count , p_table => 1 , p_header_id => 22183447 ); dbms_output.put_line('process_lot_txns: fn ret : ' || l_ret_val); dbms_output.put_line('process_lot_txns: ret value from TM: ' || l_return_status); dbms_output.put_line('process_lot_txns: processed count: ' || l_trans_count); IF l_return_status <> 'S' THEN BEGIN SELECT error_code , error_explanation INTO l_error_code , l_error_explanation FROM mtl_transactions_interface WHERE transaction_header_id = 22183219 AND ROWNUM = 1; dbms_output.put_line('err code: ' || l_error_code); dbms_output.put_line('err expl: ' || l_error_explanation); EXCEPTION WHEN OTHERS THEN NULL; END; END IF; --END IF ret sts <> 'S' EXCEPTION WHEN OTHERS THEN dbms_output.put_line('process_lot_txns: Exception raised'); ROLLBACK; END ;转载请注明出处:
======EOF======

你可能感兴趣的文章
移动端html5页面导航栏悬浮遮挡内容第一行解决办法
查看>>
Linux非阻塞IO(六)使用poll实现非阻塞的服务器端
查看>>
JS设置CSS样式的几种方式
查看>>
asp.net网站Application_Start疑是不执行的现象
查看>>
信号量同步编程
查看>>
Spring MVC 异常处理优解
查看>>
硬盘性能测试工具fio
查看>>
802.11帧
查看>>
css解决内联元素间的空白间隔
查看>>
lvs+keepalive 实现高可用软负载均衡集群
查看>>
log 的 debug()、 error()、 info()方法的区别
查看>>
php实现http与https转化
查看>>
第20件事 风险分析
查看>>
复制常用命令
查看>>
MongoDB索引管理
查看>>
Algs4-1.4.36下压栈的空间成本
查看>>
call 方法
查看>>
iOS开发--二维码的扫描
查看>>
十年技术
查看>>
bzoj 3211: 花神游历各国
查看>>