Script to set the Purchase Order Status to ‘OPEN’(将采购订单重新打开)
Business Requirement: The finance user requests the IT team to change the PO status to OPEN as they are unable to match the incoming vendor invoices. The PO status is set to closed because of the previous legible transactions or some data corruption issues.
Purpose: Set the Purchase Order Status to Open
1. Identify the PO’s whose status needs to be OPENed
2. Insert them into a temporary table e.g: xxrp_po_number_temp
create table xxrp_po_number_temp (po_number varchar2(200));
insert into xxrp_po_number_temp values (’1089442′);
3. Run the script
BEGIN
FOR c_rec in (select po_number from xxrp_po_number_temp )
LOOP
– Update PO Headers
UPDATE po_headers_all
SET closed_date = ”,
closed_code = ‘OPEN’
WHERE segment1 = c_rec.po_number;
– Update PO Lines
UPDATE po_lines_all
SET closed_date = ”,
closed_code = ‘OPEN’,
closed_by = ”,
last_updated_by = 0,
last_update_date = SYSDATE
WHERE po_header_id IN
(SELECT poh.po_header_id
FROM po_headers_all poh
WHERE poh.segment1 = c_rec.po_number);
– Update PO Shipments
UPDATE po_line_locations_all
SET closed_date = ”,
closed_code = ‘OPEN’,
closed_by = ”,
shipment_closed_date = ”,
last_updated_by = 0,
last_update_date = SYSDATE,
closed_for_receiving_date = ”,
closed_for_invoice_date = ”
WHERE po_header_id IN
(SELECT poh.po_header_id
FROM po_headers_all poh
WHERE poh.segment1 = c_rec.po_number);
– PO Distribution needs no update
— Update action history
DELETE
FROM po_action_history
WHERE object_type_code = ‘PO’
AND object_sub_type_code = ‘STANDARD’
AND action_code = ‘FINALLY CLOSE’
AND object_id =
(SELECT poh.po_header_id
FROM po_headers_all poh
WHERE poh.segment1 = c_rec.po_number
AND type_lookup_code = ‘STANDARD’);
END LOOP;
COMMIT;
EXCEPTION
when others then
rollback;
raise_application_error(-20001,’Error -’ || SQLERRM);
END;
/
–(III) Drop the temporary table
DROP TABLE xxrp_po_number_temp;
Script to set the Purchase Order Status to ‘OPEN’(将采购订单重新打开)的更多相关文章
- ABAP术语-Purchase Order
Purchase Order 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/07/1094717.html Request or instr ...
- SAP MM Purchase Order History Category
SAP MM Purchase Order History Category 1) ,These are different categories of PO history which is con ...
- Oracle采购模块中的多组织访问控制(MOAC)
1. 概述 从Release12开始启用多组织访问控制功能,将允许用户在一个单独的职责中访问一个或者多个经营单位(OU-Operation Units)的数据.这个功能允许用户在一个可共享服务的 ...
- [AX]AX2012 Interaction class
Ax2012 Client的form如果属性FormTemplate设置为DetailsPage或者ListPage,则必须同时设置属性InteractionClass为相应的Interaction类 ...
- MM/PP/SD/FICO 模块常用事物码(T-code)、SAP快捷键
MM/PP/SD/FICO MM常用T-CODE MM01 创建一般物料 Create Material – GeneralMM02 修改一般物料 Change MaterialMM03 显示一般物料 ...
- 电商物流仓储WMS业务流程
电商物流仓储WMS业务流程 SKU是什么意思? 一文详解电商仓储管理中SKU的含义 从货品角度看,SKU是指单独一种商品,其货品属性已经被确定.只要货品属性有所不同,那么就是不同的SKU. PO信息 ...
- 供应链需求调研CheckList
总体(General) 基本情况 1. 企业地址.邮编.电话.传真,项目联系人等基本资料. 2. 企业经营范围,产品线和主导产品. 3. 企业近几年的产值及销售额. 4. 企业 ...
- Back to Back Order Process
Steps involved involved in back to back order process in oracle apps 1. Enter Sales Order 2. Book Sa ...
- Purchase Document Open Interface(PDOI)
PO模块也有自己的接口表,多用于把其他业务系统在Oracle EBS系统生成采购订单记录. Table Name Description Type PO_HEADERS_INTERFACE This ...
随机推荐
- qt 4.6.2 与visual studio 2005 集成(编译方法,以及中间遇到的问题)
不知不觉在蒂森差不多半个月了,哈哈,时间过得很快,过得很充实,近来研究QT,首先嘛,肯定要学会安装了,这最基础的不会更不用说下面的啦.闲话少说,进正题,基本的安装步骤网上多的是,但参考一个大多数情况是 ...
- [LeetCode] Binary Tree Level Order Traversal 2
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...
- margin负值
一列li并排的时候,需要一些间距的时候,又不需要最右边或者最左边有间距. <!DOCTYPE html> <html lang="zh-CN"> <h ...
- 12 Tips for Accurate Project Estimating
Projects typically involve many dynamic aspects, yet they're often constrained by finite conditions. ...
- 用代码调用Storyboard里面的viewController
今天在帮助群里的一个朋友弄pop事件,在他那边,当前的viewcontroller,不能pop出去. 初步估计,他的ViewController层级多,他自己没有理清. 因为pushViewContr ...
- AJAX中UPDATEPANEL配合TIMER控件实现局部无刷新
首先加入UpdatePanel <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode= ...
- select下拉框美化
其实用下列CSS就可以解决,原理是将浏览器默认的下拉框样式清除,然后应用上自己的,再附一张向右对齐小箭头的图片即可. select { /*Chrome和Firefox里面的边框是不一样的,所以复 ...
- sql语句操作集锦
SQL操作全集 下列语句部分是Mssql语句,不可以在access中使用. SQL分类: DDL—数据定义语言(CREATE,ALTER,DROP,DECLARE) DML—数据操纵语言(SELECT ...
- [PCL]NDT点云匹配方法
测试NDT方法的Demo,http://pointclouds.org/documentation/tutorials/normal_distributions_transform.php#norma ...
- 图像处理之泛洪填充算法(Flood Fill Algorithm)
泛洪填充算法(Flood Fill Algorithm) 泛洪填充算法又称洪水填充算法是在很多图形绘制软件中常用的填充算法,最熟悉不过就是 windows paint的油漆桶功能.算法的原理很简单,就 ...