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’(将采购订单重新打开)的更多相关文章

  1. Oracle采购模块中的多组织访问控制(MOAC)

     1. 概述 从Release12开始启用多组织访问控制功能,将允许用户在一个单独的职责中访问一个或者多个经营单位(OU-Operation Units)的数据.这个功能允许用户在一个可共享服务的 ...

  2. 供应链需求调研CheckList

    总体(General) 基本情况 1.    企业地址.邮编.电话.传真,项目联系人等基本资料. 2.    企业经营范围,产品线和主导产品. 3.    企业近几年的产值及销售额. 4.    企业 ...

  3. Back to Back Order Process

    Steps involved involved in back to back order process in oracle apps 1. Enter Sales Order 2. Book Sa ...

  4. Purchase Document Open Interface(PDOI)

    PO模块也有自己的接口表,多用于把其他业务系统在Oracle EBS系统生成采购订单记录. Table Name Description Type PO_HEADERS_INTERFACE This ...

  5. Process Order API - How To Scripts

    In this Document   Purpose   Questions and Answers   References APPLIES TO: Oracle Order Management ...

  6. 命名困惑系列之一:关于state和status的粗浅研究

    牛津高阶词汇的解释 state: CONDITION OF SB/STH  状态:the mental,emotional or physical condition that a person or ...

  7. 转:Internal Sales Order (ISO) Process Flow

    本文介绍下内部销售订单Internal Sales Order(ISO)在Oracle EBS中的流程,内部销售订单和组织间转移(Inter-Organization Transfer,IOT)的作用 ...

  8. [转]oracle EBS 基础100问

    from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...

  9. [转]Oracle EBS APIs

    FROM:http://blog.csdn.net/pan_tian/article/details/7754598 API To Find Sales Order's Subtotal,discou ...

随机推荐

  1. iOS开发 适配iOS10

    2016年9月7日,苹果发布iOS 10.2016年9月14日,全新的操作系统iOS 10将正式上线. 作为开发者,如何适配iOS10呢? 1.Notification(通知) 自从Notificat ...

  2. HTTP学习一:HTTP基础知识

    1 HTTP介绍 HTTP协议(HyperText Transfer Protocol,超文本传输协议)是用于从WWW服务器传输超文本到本地浏览器的传送协议. 它的发展是万维网协会(World Wid ...

  3. [转] Jenkins实战演练之Windows系统节点管理

    [前提] 通过<Jenkins实战演练之Windows服务器快速搭建>(http://my.oschina.net/iware/blog /191818)和<Jenkins实战演练之 ...

  4. wampserver中Apache启动不了的问题

    今天晚上安装了wampserver,启动后,右下角的图表橙色,绿色才代表服务启动成功,到底是什么原因导致不能成功启动呢? 网上查资料,说可能是端口冲突,也可能是网络TCP/IP的设置有关系,我设置TC ...

  5. Git的安装与使用

    1,下载git https://code.google.com/p/msysgit/downloads/list 2,安装git ,我们选择命令行形式,这样无论在window下还是在linux下 都可 ...

  6. RDIFramework.NET V2.5(.NET快速信息化系统开发框架) Web版界面样例(可参考)

    RDIFramework.NET V2.5(.NET快速信息化系统开发框架)  Web版介绍 现已升级到V2.8,点击查看 B/S结构(Browser/Server,浏览器/服务器模式),是WEB兴起 ...

  7. Android开发--Button的应用

    1.Button的创建 Button的创建和TextView类似,包含按钮的ID,宽度,高度,提示(即按钮上的文本内容).

  8. 迷你版 smarty --模板引擎和解析

    http://blog.ipodmp.com/archives/php-write-a-mini-smarty-template-engine/ 迷你版Smarty模板引擎目录结构如下: ① 要开发一 ...

  9. ruby字符串相关方法

    构造字符串字面量 方法一:最简单的使用单引号或者双引号括起来的字符串,比如"hello". 方法二:使用%q配合分界符,%q代表单引号str=%q!he/lo! 方法三:使用%Q配 ...

  10. WordPress Comment Attachment插件跨站脚本漏洞

    漏洞名称: WordPress Comment Attachment插件跨站脚本漏洞 CNNVD编号: CNNVD-201310-062 发布时间: 2013-10-09 更新时间: 2013-10- ...