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 ...
随机推荐
- 手把手使用 SVG + CSS 实现渐变进度环效果
效果 轨道 使用 svg 画个轨道 <svg viewBox="0 0 100 100"> <circle cx="50" cy=" ...
- 新手入门深度学习:在不使用Google的情况下如何在国内获得免费的算力 —— 算力共享,驱动人工智能创新的新引擎
分享链接地址: 算力获新生 | 算力共享,驱动人工智能创新的新引擎
- 编程语言中的Variable Shadowing(变量遮蔽)—— declaration shadows a local variable —— Consider Allow Shadowing of let Bindings
Variable Shadowing(变量遮蔽)是编程语言中比较常见的一种情况,但是由于不同语言对于这个情景的处理是不同的,所以在具体语言中这个Variable Shadowing(变量遮蔽)的表现也 ...
- 如何在jax框架的jit中快速的实现循环结构 —— Jax框架的jit编译是否可以使用循环结构
相关: Jax框架的jit编译是否可以使用循环结构,如果使用循环结构需要注意什么 前文中给出了jit下使用python做循环结构的代码,下面再次给出这个代码,这个代码为jupyter-notebook ...
- 域名所有权验证 —— DNS TXT 域名验证
参考: https://help.aliyun.com/zh/cdn/getting-started/verify-the-ownership-of-a-domain-name https://blo ...
- Illegal key size or default parameters 解决方案
1.背景 在做aes加密时,报错 Illegal key size or default parameters...有的jdk版本报错,有的不报错,原因在于: jdk 或jre\lib\securit ...
- mybatis打印sql
转
我们在使用mybatis开发过程中,经常需要打印sql以及输入输出,下面说一下mybatis结合log4j打印sql的. 1.添加mybatis配置 mybatis的日志打印方式比较多,SLF4J | ...
- 【A GUIDE TO CRC ERROR DETECTION ALGORITHM】 (译文2)
6. A Fully Worked Example 一个完全可行的例子 Having defined CRC arithmetic, we can now frame a CRC calculatio ...
- 有没有一个适合初学者学习的基于linux的嵌入式综合项目?
一.前言 很多粉丝问我,有没有一个适合初学者学习的嵌入式的Linux的项目? 我之前陆陆续续写过一些适合新手的小项目: <从0写一个<电话号码管理系统>的C入门项目[适合初学者]&g ...
- FFmpeg开发笔记(四十八)从0开始搭建直播系统的开源软件架构
音视频技术的一个主要用途是直播,包括电视直播.电脑直播.手机直播等等,甚至在线课堂.在线问诊.安防监控等应用都属于直播系统的范畴.由于直播系统不仅涉及到音视频数据的编解码,还涉及到音视频数据的实时传 ...