CREATE OR REPLACE
PROCEDURE XX_CreateMoveOrderHeader 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_user_name VARCHAR2(30) := 'MFG';
l_resp_name VARCHAR2(50) := 'Manufacturing and Distribution Manager'; -- API specific declarations
l_trohdr_rec INV_MOVE_ORDER_PUB.TROHDR_REC_TYPE;
l_trohdr_val_rec INV_MOVE_ORDER_PUB.TROHDR_VAL_REC_TYPE;
x_trohdr_rec INV_MOVE_ORDER_PUB.TROHDR_REC_TYPE;
x_trohdr_val_rec INV_MOVE_ORDER_PUB.TROHDR_VAL_REC_TYPE;
l_validation_flag VARCHAR2(2) := INV_MOVE_ORDER_PUB.G_VALIDATION_YES; 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);
dbms_output.put_line('Initialized applications context: '|| l_user_id || ' '|| l_resp_id ||' '|| l_application_id ); -- Initialize the variables
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_TRO1';
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; -- call API to create move order header
DBMS_OUTPUT.PUT_LINE('=======================================================');
DBMS_OUTPUT.PUT_LINE('Calling INV_MOVE_ORDER_PUB.Create_Move_Order_Header API'); INV_MOVE_ORDER_PUB.Create_Move_Order_Header(
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
, X_TROHDR_REC => x_trohdr_rec
, X_TROHDR_VAL_REC => x_trohdr_val_rec
, P_VALIDATION_FLAG => l_validation_flag
); 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');
DBMS_OUTPUT.PUT_LINE('Move Order Header ID : '||x_trohdr_rec.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 XX_CreateMoveOrderHeader;

  

Oracle EBS INV 创建物料搬运单头的更多相关文章

  1. Oracle EBS INV 创建物料搬运单

    Create or Replace PROCEDURE ProcessMoveOrder AS -- Common Declarations l_api_version NUMBER := 1.0; ...

  2. Oracle EBS INV 创建物料搬运单行

    CREATE OR REPLACE PROCEDURE CreateMoveOrderLines AS -- Common Declarations l_api_version NUMBER := 1 ...

  3. Oracle EBS INV创建保留

    CREATE or REPPLACE PROCEDURE CreateReservation AS -- Common Declarations l_api_version NUMBER := 1.0 ...

  4. Oracle EBS INV 创建货位

    create or replace PROCEDURE XX_CREATE_LOCATOR AS -- Common Declarations l_api_version NUMBER := 1.0; ...

  5. Oracle EBS INV 挑库发放物料搬运单

    create or replace PROCEDURE XX_TRANSACT_MO_LINE AS -- Common Declarations l_api_version NUMBER := 1. ...

  6. Oracle EBS AP 创建贷项通知单并核销到相应发票

    --1.0 生成与发票一样的贷项通知单 created by jenrry 20170423 DECLARE L_CUSTOMER_TRX_ID NUMBER; L_INVOICE_NUMBER VA ...

  7. Oracle EBS OPM 创建生产批

    --创建生产批 --created by jenrry DECLARE x_message_count NUMBER; x_message_list VARCHAR2 (2000); x_return ...

  8. Oracle EBS GL 创建会计科目

    SELECT ct.trx_number ,l.accounting_class_code ,l.entered_dr ,l.entered_cr ,fnd_flex_ext.get_segs('SQ ...

  9. Oracle EBS INV 查询物料无值 ECO

    查找物料的时候报错 没有输入值 解决方法: 针对FORM做trace 多查看几个生成的trace 搜索 MTL_SYSTEM_ITEMS_b 的信息 查看到最后面的语句(一般可直接查看) 看SQL 哪 ...

随机推荐

  1. 全网最详细的启动zkfc进程时,出现INFO zookeeper.ClientCnxn: Opening socket connection to server***/192.168.80.151:2181. Will not attempt to authenticate using SASL (unknown error)解决办法(图文详解)

    不多说,直接上干货! at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:) at org ...

  2. Spring Boot + Spring Cloud 实现权限管理系统 后端篇(七):集成 Druid 数据源

    数据库连接池负责分配.管理和释放数据库连接,它允许应用程序重复使用一个现有的数据库连接,而不是再重新建立一个:释放空闲时间超过最大空闲时间的数据库连接来避免因为没有释放数据库连接而引起的数据库连接遗漏 ...

  3. Java判断一个时间是否在时间区间内

    package com.liying.tiger.test; import java.text.ParseException; import java.text.SimpleDateFormat; i ...

  4. java实现跳跃表

    先贴上一个MIT跳跃表公开课链接:http://open.163.com/movie/2010/12/7/S/M6UTT5U0I_M6V2TTJ7S.html redis中的有序链表结构就是在跳跃表的 ...

  5. Java 容器源码分析之Queue

    简介 Queue是一种很常见的数据结构类型,在java里面Queue是一个接口,它只是定义了一个基本的Queue应该有哪些功能规约.实际上有多个Queue的实现,有的是采用线性表实现,有的基于链表实现 ...

  6. 经典SQL语句大全(转)

    一.基础 1.说明:创建数据库CREATE DATABASE database-name 2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备 ...

  7. 比較C struct 與 C# unsafe struct内存分佈

    昨晚在群裏無意間看到一個朋友有一個需求.他是在C裏面將兩個結構體(HeadStruct,BodyStruct)的内存數據直接通過socket send發給C#寫的服務端來處理.當然他之前所使用的需求基 ...

  8. 七台机器部署Hadoop2.6.5高可用集群

    1.HA架构注意事项 两个Namenode节点在某个时间只能有一个节点正常响应客户端请求,响应请求的节点状态必须是active standby状态要能够快速无缝切换成active状态,两个NN节点必须 ...

  9. UVa 11988 Broken Keyboard(数组模拟链表)

    题目链接: https://cn.vjudge.net/problem/UVA-11988 /* 问题 将一段文本经过一定的规则处理后输出,规则就是[表示home键,表示光标跳到行首,]表示end键, ...

  10. [转]Magento2命令行配置之性能测试生成数据

    本文转自:https://blog.csdn.net/xz_src/article/details/72799539 性能测试数据概述 使用Magento性能工具包或其他工具进行性能测试,你必定产生大 ...