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. Oracle采购模块中的多组织访问控制(MOAC)

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

  3. [AX]AX2012 Interaction class

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

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

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

  5. 供应链需求调研CheckList

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

  6. Back to Back Order Process

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

  7. Purchase Document Open Interface(PDOI)

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

  8. Process Order API - How To Scripts

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

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

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

随机推荐

  1. uiimage 上传 数据库

    之前我所接触的上传图片都是直接与服务器交互的,即 app端要做的就是上传到服务器 现在这个项目却是app先上传到"数据库",由"数据库"传到服务端 下面说主题 ...

  2. HTML5+CSS3的响应式网页设计:自动适应屏幕宽度

    这几天都在修改博客上面的样式.本来用的是d83.0的模板.自己又修改了许多地方,其中自己修改的一些地方在手机里面显示的效果不是很理想,于是想改成自适应的效果.对CSS3不是特别的熟练,只能去网上找找案 ...

  3. SQL Syntax

    1.limit 语法:限制查询记录,进行分页处理:select * from article limit 0,10;(从0号记录开始,依次取10条记录) 2.like 语法:查询指定字符串的相似匹配记 ...

  4. python实现线程池

    线程池 简单线程池 import queue import threading import time class ThreadPool(object): #创建线程池类 def __init__(s ...

  5. EasyUI-在iframe里获取现阶段选中的tab的标题

    在iframe里获取当前选中的tab的标题(easyui) var currTab =$$('#tabs').tabs('getSelected'); console.info(currTab.pan ...

  6. hdu1102

    http://acm.hdu.edu.cn/showproblem.php?pid=1102 最小生成树(模板题) 3 0 990 692 990 0 179 692 179 0 1 1 2 一共3个 ...

  7. e8_4输出菲波拉契数列的前10项

    program fbnq;{输出菲波拉契数列的前10项} var a:..] of integer; i:integer; begin a[]:=; a[]:=; do a[i]:=a[i-]+a[i ...

  8. nagios和zabbix自定义监控脚本

    一. 自定义nagios监控脚本1. 在客户端上创建脚本/usr/local/nagios/libexec/check_disk.shvim  /usr/local/nagios/libexec/ch ...

  9. overflow的几个坑

    在android 4.0的原生浏览器上注意: html元素上不要加overflow: auto;的样式,否则会造成有些元素无法点击 在absolute元素上 不要加 overflow: auto; 否 ...

  10. IAR for STM8 错误

    一个IAR for STM8 v1.3 的工程,换到1.4版后出现如下错误 unable to allocate space for sections/blocks with a total esti ...