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 ...
随机推荐
- 【Spring Data JPA】06 全注解配置(非SpringBoot整合)
总依赖组件坐标: <properties> <spring.version>5.2.8.RELEASE</spring.version> <hibernate ...
- 陆吾AI智能机械狗的通讯控制
陆吾AI智能机械狗现在是蛮有名的了,在YouTube上比较火的一个东西了,和波士顿机器狗不同,波士顿机器狗价格昂贵主要原因是其定位于工业领域的机械狗因此采用的是工业级的硬件,但是如果我们采用的家用环境 ...
- 数据库存储时间数据用timestamp 好还是 varchar好
表示日期数据基本是date型,只有年月的用varchar2或者char,好处见下:1.数据规范.date对合法日期型会校验,包括闰年2月这种.避免字符型变量产生的某月32号,日期长度不对,日期格式不统 ...
- 8月5日CSP-S模拟赛赛后总结
8月5日CSP-S模拟赛赛后总结 \[8月5日 \ \ CSP-S模拟赛 \ \ 赛后总结 \\ 2024年8月5日 \\ by \ \ \ uhw177po \] 一.做题情况 第一题比赛 \(10 ...
- JavaWeb中的Tomcat,Servlet详解
JavaWeb JavaWeb技术主要包括服务器技术(后端),如Tomcat,Servlet,JSP等待,以及客户端技术(前端)如HTML,CSS,JavaScript等等 Web服务器 Web服务器 ...
- keycloak~关于社区登录的过程说明
keycloak将第三方登录(社区登录)进行了封装,大体主要会经历以下三个过程: 打开社区认证页面,输入账号密码或者扫码,完成社区上的认证 由社区进行302重定向,回到keycloak页面 keycl ...
- games101 作业6 详解SAH
games101 作业6 详解SAH 可参考资料:https://www.pbr-book.org/3ed-2018/Primitives_and_Intersection_Acceleration/ ...
- Camera | 12.瑞芯微摄像头自动焦距马达驱动移植
本为你主要讲解如何让摄像头ov13850支持自动对焦功能. 摄像头的对角主要通过VCM马达驱动芯片DW9714来实现的. 一.环境 soc : rk3568 board: EVB1-DDR4-V10 ...
- C# Winform 使用 BarTender打印条码
目录 - 1. 使用软件BarTender 设计打印模板 - 2. Winfrom集成打印 - 3.最终效果 - 1. 使用软件BarTender 设计打印模板 贴一个入门级使用教程:https:// ...
- NumPy从入门到放弃
看前建议: 本文以jupyter notebook为编辑器进行示例,建议有一定python基础后再进行学习. python的安装:https://www.cnblogs.com/scfssq/p/17 ...