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. ABAP术语-Purchase Order

    Purchase Order 原文:http://www.cnblogs.com/qiangsheng/archive/2008/03/07/1094717.html Request or instr ...

  2. SAP MM Purchase Order History Category

    SAP MM Purchase Order History Category 1) ,These are different categories of PO history which is con ...

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

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

  4. [AX]AX2012 Interaction class

    Ax2012 Client的form如果属性FormTemplate设置为DetailsPage或者ListPage,则必须同时设置属性InteractionClass为相应的Interaction类 ...

  5. MM/PP/SD/FICO 模块常用事物码(T-code)、SAP快捷键

    MM/PP/SD/FICO MM常用T-CODE MM01 创建一般物料 Create Material – GeneralMM02 修改一般物料 Change MaterialMM03 显示一般物料 ...

  6. 电商物流仓储WMS业务流程

    电商物流仓储WMS业务流程 SKU是什么意思?  一文详解电商仓储管理中SKU的含义 从货品角度看,SKU是指单独一种商品,其货品属性已经被确定.只要货品属性有所不同,那么就是不同的SKU. PO信息 ...

  7. 供应链需求调研CheckList

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

  8. Back to Back Order Process

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

  9. Purchase Document Open Interface(PDOI)

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

随机推荐

  1. HD 1003 Max Sum 的递归解法

    #include <STDIO.H> typedef struct SU_tag{ SU_tag(){} SU_tag(int a,int b,int c):max_sum(a),left ...

  2. 采用asyncore进行实时同步

    最近在维护项目的时候,发现某个实时数据同步功能非常容易失败,故静下心来彻底弄清楚该设计的实现原理,以及其中用到的python异步sockethandler : asyncore. 实时数据同步功能的设 ...

  3. Magento PHP Extension "curl" must be loaded解决方法

    我记得我第一次在xampp装magento的时候,进入后台时提示PHP Extension "curl" must be loaded 在网页上查了下原因和解决方法,发现是mage ...

  4. javac 错误: 编码GBK的不可映射字符

    在java代码中有中文注释,使用javac编译时,出现编码报错. 错误: 编码GBK的不可映射字符 问题原因: 在编译的时候,如果我们没有用-encoding参数指定我们的JAVA源程序的编码格式,则 ...

  5. qt QMessageBox QInputDialog

    最近用到了QMessgaeBox和QInputDialog,QMessageBox用于提示,警告等消息,QInputDialog给用户弹出输入对话框. 参考链接 http://chenboqiang. ...

  6. mobiscroll.js 使用

    使用较为详情的参考网址:http://www.lanrenmaku.com/jMobile/2014_1231_1357.html

  7. iOS:BitCode的介绍

    一.什么是BitCode?作用是什么? Bitcode is an intermediate representation of a compiled program. Apps you upload ...

  8. iOS:app直播---采集篇

    [如何快速的开发一个完整的iOS直播app](采集篇) 转载自简书@袁峥Seemygo:http://www.jianshu.com/p/c71bfda055fa 前言 开发一款直播app,首先需要采 ...

  9. NYU Hand Pose Dataset

    http://cims.nyu.edu/~tompson/NYU_Hand_Pose_Dataset.htm#overview

  10. eclipse的快捷键大全

    Ctrl+1 快速修复(最经典的快捷键,就不用多说了)Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加)Ctrl+Alt+↑ 复制当前行到上一行(复制增加)Alt+↓ 当 ...