How To Delete Reservations Using Standard API INV_RESERVATION_PUB.Delete_Reservation (Doc ID 2219367.1)
Solution
Summary: The reservation API INV_RESERVATION_PUB.Delete_Reservation will delete reservations accepting the reservation id and optionally serial numbers to locate and remove reservations. Care should be taken to ensure related objects like sales orders no longer need the reservation to avoid errors like Negative balances when attempting to ship material. You might also use the reservation API that relieves reservations instead -- INV_RESERVATION_PUB.Relieve_Reservation API.
Details: Here is an example of using the delete reservation API. The example includes values for the inventory application id (401), an example Manufacturing and Distribution Manager responsibility id, and an example MFG user id. Change the values to the appropriate ids on your environment. The SQL also prompts for the organization id and item number. In this example, the code loops through reservations on this item removing them but rownum is limited to 1 so only the first row is removed.
--set serveroutput on
DECLARE
p_rsv apps.inv_reservation_global.mtl_reservation_rec_type;
p_dummy_sn apps.inv_reservation_global.serial_number_tbl_type;
l_msg_count NUMBER;
l_msg_data VARCHAR2(240);
l_status VARCHAR2(1);
l_index_out NUMBER;
v_reserv_id NUMBER;
l_err_status VARCHAR2(50);
l_err_mesg VARCHAR2(2000);
-- User Variables: Update for your environment ~~!
l_resp_appl_id NUMBER := 401; --FND_PROFILE.VALUE ('RESP_APPL_ID');
l_resp_id NUMBER := 56229; --FND_PROFILE.VALUE ('RESP_ID');
l_user_id NUMBER := 1068; --FND_PROFILE.VALUE ('USER_ID');
-- Item/Organization Variables
l_organization_id NUMBER := &yourorgid;
l_youritem VARCHAR2(100) := '&YourPartNumber';
-- Find 1 reservation for your item
CURSOR c_reserve IS
SELECT DISTINCT reservation_id
FROM apps.mtl_reservations_all_v
WHERE inventory_item_id IN (SELECT inventory_item_id
FROM apps.mtl_system_items_b
WHERE organization_id = l_organization_id
AND segment1 = l_youritem)
AND organization_id = l_organization_id --p_organization_id;
AND rownum < 2;
BEGIN
fnd_global.apps_initialize(user_id => l_user_id
,resp_id => l_resp_id
,resp_appl_id => l_resp_appl_id);
FOR r_reserve IN c_reserve
LOOP
dbms_output.put_line('Reservation ID : ' || r_reserve.reservation_id);
p_rsv.reservation_id := r_reserve.reservation_id;
apps.inv_reservation_pub.delete_reservation(p_api_version_number => 1.0
,p_init_msg_lst => fnd_api.g_false
,p_rsv_rec => p_rsv
,p_serial_number => p_dummy_sn
,
-- p_validation_flag => fnd_api.g_true,
x_return_status => l_status
,x_msg_count => l_msg_count
,x_msg_data => l_msg_data);
dbms_output.put_line('Reservation API : ' || l_status);
IF l_status <> 'S' THEN
fnd_msg_pub.get(p_msg_index => l_msg_count
,p_data => l_msg_data
,p_encoded => 'F'
,p_msg_index_out => l_index_out);
l_err_status := 'E';
l_err_mesg := 'Delete Allocations API failed ' || rtrim(l_msg_data);
dbms_output.put_line('API failed ' || l_err_mesg);
ELSE
l_err_status := 'S';
l_err_mesg := NULL;
dbms_output.put_line('API success ' || l_err_mesg);
END IF;
END LOOP;
END;
/
How To Delete Reservations Using Standard API INV_RESERVATION_PUB.Delete_Reservation (Doc ID 2219367.1)的更多相关文章
- Differences Between Enterprise, Standard and Standard One Editions on Oracle 11.2 (Doc ID 1084132.1)
标准版不允许并行.分区.闪回.各种缓存等大数据量必须特性,如此限制,oracle摆明了只卖企业版,买标准版不如mysql(如果不熟悉postgresql的话). Oracle企业版1 CPU 20w起 ...
- Atitit.论垃圾文件的识别与清理 文档类型垃圾文件 与api概要设计pa6.doc
Atitit.论垃圾文件的识别与清理 文档类型垃圾文件 与api概要设计pa6.doc 1. 俩个问题::识别垃圾文件与清理策略1 1.1. 文件类型:pic,doc,v,m cc,isho pose ...
- [MEAN Stack] First API -- 3. Select by ID with Mongoose and Express
Mongoose allows you to easily select resources by ID from your MongoDB. This is an important aspect ...
- 基于.NET Standard的分布式自增ID算法--美团点评LeafSegment
概述 前一篇文章讲述了最流行的分布式ID生成算法snowflake,本篇文章根据美团点评分布式ID生成系统文章,介绍另一种相对更容易理解和编写的分布式ID生成方式. 实现原理 Leaf这个名字是来自德 ...
- 基于.NET Standard的分布式自增ID算法--Snowflake代码实现
概述 上篇文章介绍了3种常见的Id生成算法,本篇主要介绍如何使用C#实现Snowflake. 基础字段 /// <summary> /// 工作节点Id(长度为5位) /// </s ...
- 基于.NET Standard的分布式自增ID算法--Snowflake
概述 本篇文章主要讲述分布式ID生成算法中最出名的Snowflake算法.搞.NET开发的,数据库主键最常见的就是int类型的自增主键和GUID类型的uniqueidentifier. 那么为何还要引 ...
- .NET Web API - 去掉讨厌的$id并且强制返回json格式
// 只返回json字符串,屏蔽自动选择xml格式的可能性,同时去掉讨厌的$id var json = config.Formatters.JsonFormatter; json.Serializer ...
- 一道题目学ES6 API,合并对象id相同的两个数组对象
var arr2=[{id:1,name:'23'}] var arr1=[{id:1,car:'car2'}] const combined = arr2.reduce((acc, cur) =&g ...
- 用ASP.NET Core 2.0 建立规范的 REST API -- DELETE, UPDATE, PATCH 和 Log
本文所需的一些预备知识可以看这里: http://www.cnblogs.com/cgzl/p/9010978.html 和 http://www.cnblogs.com/cgzl/p/9019314 ...
- Fetch API & Delete & HTTP Methods
Fetch API & Delete & HTTP Methods vue https://developer.mozilla.org/en-US/docs/Web/API/Fetch ...
随机推荐
- 编程语言mojo报错:error: cannot call function that may raise in a context that cannot raise
代码: from python import Python fn main(): # fn main() raises: # This is equivalent to Python's `impor ...
- x86_64/aarch64架构下ffpyplayer源码编译
问题来源: 某鱼上挂着pytorch的aarch64架构下的源码编译,遇到某网友提出的要在aarch64架构下的ubuntu上ffpyplayer源码编译,于是有了本文. ============== ...
- php日常收获
php 1.sprintf 用法(晚上写成blog w3cschool可查) 2.使用thinkphp getfield 方法时只查询一个字段默认返回第一条数据, 如果想要返回数组需要写成: $thi ...
- 这应该是全网最全的CSP-S初赛复习吧
点我到洛谷看 \(Update\ 2024/8/2:\) 加入了在数据结构中增加了"树",做出部分更改. linux基础命令 cd 切换目录 ls 列出目前工作目录所含的文件及子目 ...
- JS Map对象与map方法
前言 最近遇到一个遍历的问题,查资料的过程中,发现有个 Map 对象,提供了很多方法可以轻松地获取我们想要的数据,之前只知道有 map ,没想到还有 Map ,是不是有点绕?不急,这两个东西都是虽然 ...
- 【VMware vCenter】一次性说清楚 vCenter Server 的 CLI 部署方式。
VMware vCenter Server 是 VMware vSphere 解决方案的核心组件,用于管理多个 ESXi 主机并实现更多高级功能特性(如 HA.DRS 以及 FT 等),相信大家已经非 ...
- 2024-08-14:用go语言,给定两个长度分别为n和m的整数数组nums和changeIndices,下标从1开始。初始时,nums 中所有下标均未标记。 从第1秒到第m秒,每秒可以选择以下四种操
2024-08-14:用go语言,给定两个长度分别为n和m的整数数组nums和changeIndices,下标从1开始.初始时,nums 中所有下标均未标记. 从第1秒到第m秒,每秒可以选择以下四种操 ...
- 流体饱和多孔介质的本构关系 + Föppl-von Kármán 方程
向有液体的多孔介质上施加应力,应力一部分分布到骨架上,一部分分布到孔隙流体上.骨架上的应力会导致变形,所以被称为 "有效应力".这里考虑拉伸应力为正,有效应力原理写为 \[\sig ...
- Es java API官网手册
官方地址: 一.TransportClient客户端 https://www.elastic.co/guide/en/elasticsearch/client/java-api/7.5/index.h ...
- hook千牛 千牛破解发消息 千牛机器人 千牛发消息组件 调用千牛发消息 实时获取千牛聊天记录 可以提供代码
由于开发的时候,需要调用千牛发消息,所以研究了如何调用千牛发消息的组件,非协议破解,需要挂机,基本不弹发消息的窗体,非模拟发送,直接调用千牛的某个方法直接发送的,挂机后还能获取订单,实时获取聊天记录, ...