Oracle EBS INV 创建物料搬运单
Create or Replace PROCEDURE ProcessMoveOrder
AS
-- Common Declarations
l_api_version NUMBER := 1.0;
l_init_msg_list VARCHAR2(2) := FND_API.G_TRUE;
l_return_values VARCHAR2(2) := FND_API.G_FALSE;
l_commit VARCHAR2(2) := FND_API.G_FALSE;
x_return_status VARCHAR2(2);
x_msg_count NUMBER := 0;
x_msg_data VARCHAR2(255); -- WHO columns
l_user_id NUMBER := -1;
l_resp_id NUMBER := -1;
l_application_id NUMBER := -1;
l_row_cnt NUMBER := 1;
l_user_name VARCHAR2(30) := 'MFG';
l_resp_name VARCHAR2(50) := 'Manufacturing and Distribution Manager'; -- API specific declarations
l_header_id NUMBER := 0;
l_trohdr_rec INV_MOVE_ORDER_PUB.TROHDR_REC_TYPE;
l_trohdr_val_rec INV_MOVE_ORDER_PUB.TROHDR_VAL_REC_TYPE;
l_trolin_tbl INV_MOVE_ORDER_PUB.TROLIN_TBL_TYPE;
l_trolin_val_tbl INV_MOVE_ORDER_PUB.TROLIN_VAL_TBL_TYPE;
x_trolin_tbl INV_MOVE_ORDER_PUB.TROLIN_TBL_TYPE;
x_trolin_val_tbl INV_MOVE_ORDER_PUB.TROLIN_VAL_TBL_TYPE;
x_trohdr_rec INV_MOVE_ORDER_PUB.TROHDR_REC_TYPE;
x_trohdr_val_rec INV_MOVE_ORDER_PUB.TROHDR_VAL_REC_TYPE; BEGIN -- Get the user_id
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = l_user_name; -- Get the application_id and responsibility_id
SELECT application_id, responsibility_id
INTO l_application_id, l_resp_id
FROM fnd_responsibility_vl
WHERE responsibility_name = l_resp_name; FND_GLOBAL.APPS_INITIALIZE(l_user_id, l_resp_id, l_application_id); -- Suhasini / Mfg Mgr / INV
dbms_output.put_line('Initialized applications context: '|| l_user_id || ' '|| l_resp_id ||' '|| l_application_id ); -- Initialize the move order header
l_trohdr_rec.date_required := sysdate+2;
l_trohdr_rec.organization_id := 207;
l_trohdr_rec.from_subinventory_code := 'Stores';
l_trohdr_rec.to_subinventory_code := 'FGI';
l_trohdr_rec.status_date := sysdate;
l_trohdr_rec.request_number := 'TEST_TRO2';
l_trohdr_rec.header_status := INV_Globals.G_TO_STATUS_PREAPPROVED; -- preApproved
l_trohdr_rec.transaction_type_id := INV_GLOBALS.G_TYPE_TRANSFER_ORDER_SUBXFR; -- INV_GLOBALS.G_TYPE_TRANSFER_ORDER_STGXFR;
l_trohdr_rec.move_order_type := INV_GLOBALS.G_MOVE_ORDER_REQUISITION; -- G_MOVE_ORDER_PICK_WAVE;
l_trohdr_rec.db_flag := FND_API.G_TRUE;
l_trohdr_rec.operation := INV_GLOBALS.G_OPR_CREATE; -- Who columns
l_trohdr_rec.created_by := l_user_id;
l_trohdr_rec.creation_date := sysdate;
l_trohdr_rec.last_updated_by := l_user_id;
l_trohdr_rec.last_update_date := sysdate; -- create line for the header created above
l_trolin_tbl(l_row_cnt).date_required := sysdate;
l_trolin_tbl(l_row_cnt).organization_id := 207;
l_trolin_tbl(l_row_cnt).inventory_item_id := 513963;
l_trolin_tbl(l_row_cnt).from_subinventory_code:= 'Stores';
l_trolin_tbl(l_row_cnt).to_subinventory_code := 'FGI';
l_trolin_tbl(l_row_cnt).quantity := 2;
l_trolin_tbl(l_row_cnt).status_date := sysdate;
l_trolin_tbl(l_row_cnt).uom_code := 'Ea';
l_trolin_tbl(l_row_cnt).line_number := l_row_cnt;
l_trolin_tbl(l_row_cnt).line_status := INV_Globals.G_TO_STATUS_PREAPPROVED;
l_trolin_tbl(l_row_cnt).db_flag := FND_API.G_TRUE;
l_trolin_tbl(l_row_cnt).operation := INV_GLOBALS.G_OPR_CREATE; -- Who columns
l_trolin_tbl(l_row_cnt).created_by := l_user_id;
l_trolin_tbl(l_row_cnt).creation_date := sysdate;
l_trolin_tbl(l_row_cnt).last_updated_by := l_user_id;
l_trolin_tbl(l_row_cnt).last_update_date := sysdate;
l_trolin_tbl(l_row_cnt).last_update_login := FND_GLOBAL.login_id; -- call API to create move order header
DBMS_OUTPUT.PUT_LINE('=======================================================');
DBMS_OUTPUT.PUT_LINE('Calling INV_MOVE_ORDER_PUB.Process_Move_Order API'); INV_MOVE_ORDER_PUB.Process_Move_Order(
P_API_VERSION_NUMBER => l_api_version
, P_INIT_MSG_LIST => l_init_msg_list
, P_RETURN_VALUES => l_return_values
, P_COMMIT => l_commit
, X_RETURN_STATUS => x_return_status
, X_MSG_COUNT => x_msg_count
, X_MSG_DATA => x_msg_data
, P_TROHDR_REC => l_trohdr_rec
, P_TROHDR_VAL_REC => l_trohdr_val_rec
, P_TROLIN_TBL => l_trolin_tbl
, P_TROLIN_VAL_TBL => l_trolin_val_tbl
, X_TROHDR_REC => x_trohdr_rec
, X_TROHDR_VAL_REC => x_trohdr_val_rec
, X_TROLIN_TBL => x_trolin_tbl
, X_TROLIN_VAL_TBL => x_trolin_val_tbl
); DBMS_OUTPUT.PUT_LINE('=======================================================');
DBMS_OUTPUT.PUT_LINE('Return Status: '||x_return_status); IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
DBMS_OUTPUT.PUT_LINE('Error Message :'||x_msg_data);
END IF; IF (x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
DBMS_OUTPUT.PUT_LINE('Move Order Created Successfully for '||x_trolin_tbl(l_row_cnt).header_id);
END IF; DBMS_OUTPUT.PUT_LINE('======================================================='); EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Exception Occured :');
DBMS_OUTPUT.PUT_LINE(SQLCODE ||':'||SQLERRM);
DBMS_OUTPUT.PUT_LINE('=======================================================');
END ProcessMoveOrder;
Oracle EBS INV 创建物料搬运单的更多相关文章
- Oracle EBS INV 创建物料搬运单头
CREATE OR REPLACE PROCEDURE XX_CreateMoveOrderHeader AS -- Common Declarations l_api_version NUMBER ...
- Oracle EBS INV 创建物料搬运单行
CREATE OR REPLACE PROCEDURE CreateMoveOrderLines AS -- Common Declarations l_api_version NUMBER := 1 ...
- Oracle EBS INV创建保留
CREATE or REPPLACE PROCEDURE CreateReservation AS -- Common Declarations l_api_version NUMBER := 1.0 ...
- Oracle EBS INV 创建货位
create or replace PROCEDURE XX_CREATE_LOCATOR AS -- Common Declarations l_api_version NUMBER := 1.0; ...
- Oracle EBS INV 挑库发放物料搬运单
create or replace PROCEDURE XX_TRANSACT_MO_LINE AS -- Common Declarations l_api_version NUMBER := 1. ...
- Oracle EBS AP 创建贷项通知单并核销到相应发票
--1.0 生成与发票一样的贷项通知单 created by jenrry 20170423 DECLARE L_CUSTOMER_TRX_ID NUMBER; L_INVOICE_NUMBER VA ...
- Oracle EBS OPM 创建生产批
--创建生产批 --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000); x_return ...
- Oracle EBS INV 查询物料无值 ECO
查找物料的时候报错 没有输入值 解决方法: 针对FORM做trace 多查看几个生成的trace 搜索 MTL_SYSTEM_ITEMS_b 的信息 查看到最后面的语句(一般可直接查看) 看SQL 哪 ...
- Oracle EBS INV 更新物料慢
失效 ICX SELECT FA.APPLICATION_SHORT_NAME, FA.APPLICATION_ID, PI.STATUS, PI.PRODUCT_VERSION, PI.PATCH_ ...
随机推荐
- JavaScript -- Window-Confirm
-----032-Window-Confirm.html----- <!DOCTYPE html> <html> <head> <meta http-equi ...
- 使用XHProf分析PHP性能瓶颈(一)
安装xhprof扩展 wget http://pecl.php.net/get/xhprof-0.9.4.tgz tar zxf xhprof-0.9.4.tgz cd xhprof-0.9.4/ex ...
- tensorflow 根据节点获取节点前的整张图
1.先获取节点 output_layer = self.model.get_pooled_output() logits = self.tf_instance.matmul(output_layer, ...
- java-构建jar带哟参数提示的
使用command的cli包构建带有参数提示的jar包 需要引入command cli的依赖 <commons.version>1.2</commons.version> &l ...
- centos7 安装配置zookeeper
https://blog.csdn.net/AaronLin6/article/details/78438877 https://www.cnblogs.com/sxdcgaq8080/p/74924 ...
- Linux配置多个Tomcat同时运行
Linux系统下怎样配置多个Tomcat同时运行呢,首先修改变量为第一个tomcat,然后修改第二个tomcat启动的脚本 1.修改环境变量 # vi /etc/profile ####### 工程1 ...
- JS脚本动态给元素/控件添加事件
最近突然要用到JS脚本动态给元素添加事件.如TextBox的onclick事件.但有的onclick事件原先已经定义了相应代码!这里又不能替代原有方法,而JS脚本里面有个方法可以给控件在原有事件的基础 ...
- 复刻smartbits的国产网络性能测试工具minismb-如何配置Ping报文
复刻smartbits的国产网络性能测试工具minismb,是一款专门用于测试智能路由器,网络交换机的性能和稳定性的软硬件相结合的工具.可以通过此以太网测试工具测试任何ip网络设备的端口吞吐率,带宽, ...
- java concurrent 探秘
我们都知道,在JDK1.5之前,Java中要进行业务并发时,通常需要有程序员独立完成代码实现,当然也有一些开源的框架提供了这些功能,但是这些依然没有JDK自带的功能使用起来方便.而当针对高质量Java ...
- spark-调度策略之FAIR
1.概述 spark有两种调度模式:FIFO.FAIR.FIFO是先进先出,有很强的顺序性,只有前一个处理完成后才会去处理后进来的.FAIR是公平调度,通过配置进行控制优先执行的任务.spark默认使 ...