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

Table Name Description Type
PO_HEADERS_INTERFACE This is the table where to insert PO headers data in interface table. Interface table
PO_LINES_INTERFACE This is where we insert PO lines information to be imported ( it is used also for Shipments details ) Interface table
PO_DISTRIBUTIONS_INTERFACE This is where we insert PO distribution details before import Interface table
PO_INTERFACE_ERRORS Stores all errors resulted from import process. Errors table
PO_HEADERS_ALL Stores document headers for purchase orders, purchase agreements,quotations, and RFQs PO Base table
PO_LINES_ALL Stores purchase document lines for purchase orders, purchase agreements, quotations, and RFQs PO Base table
PO_LINE_LOCATIONS_ALL Stores document shipment schedules for purchase orders, purchase agreements, quotations, and RFQs PO Base table
PO_DISTRIBUTIONS_ALL Stores purchase order distributions PO Base table

下边是主要的三张PO接口表,用于记录订单头,行,Shipments以及Distributions信息

  • PO_HEADERS_INTERFACE
  • PO_LINES_INTERFACE
  • PO_DISTRIBUTIONS_INTERFACE
接口表的查询语句
  • Select * from PO_HEADERS_INTERFACE where INTERFACE_HEADER_ID=&headerid;
  • Select * from PO_LINES_INTERFACE where INTERFACE_HEADER_ID=&headerid;
  • Select * from PO_DISTRIBUTIONS_INTERFACE where INTERFACE_HEADER_ID=&headerid;
R12还引入了另外一张Interface表,PO_LINE_LOCATIONS_INTERFACE,这张表其实暂时还用不到,还只是Oracle标准产品内部使用,但因为名称上很容易让人误解,所以这里提一下。

Table Name

Feature Area

PO_LINE_LOCATIONS_INTERFACE

This table is intended for internal use only.
This is the interface table for price breaks and standard PO shipments. You should not populate these tables rather PO_LINES_INTERFACE as before. PDOI internally pushes records to this interface table for processing.

数据插入到接口表后,需要运行Concurrent Program:Import Standard Purchase Orders,用于把接口表导入到采购订单相关表。
Concurrent Program参数:
Default Buyer(Optional):
Enter the default buyer name to be associated with the incoming documents that are not assigned to a buyer..
If a default buyer is not specified and the imported purchase order also does not have buyer information, the program will use the normal Purchasing defaulting mechanism to generate buyer information. If the buyer name provided in the interface is not valid, then the record will error out and the default buyer name will not be supplemented.

Create or Update Item (Required)
The valid response is Yes or No. If Yes, the program will also create items in the item master from those buyer part numbers in the interface data where there is no corresponding item master entry. If No, the program will not create new item master entries.
Approval Status
有三个可选值,APPROVED,INCOMPLETE,INITIATE APPROVAL.
关于这个字段Purchasing User Guide中有清楚的说明,接口表中Status字段 + 这个Concurrent Program的Approval Status共同决定最终PO的状态。
Document Status in Interface Table Concurrent Program Approval Status Parameter Resulting Document Status
Null INCOMPLETE INCOMPLETE
Null APPROVED APPROVED
Null INITIATE APPROVAL INITIATE APPROVAL
INCOMPLETE INCOMPLETE INCOMPLETE
INCOMPLETE APPROVED INCOMPLETE
INCOMPLETE INITIATE APPROVAL INITIATE APPROVAL
APPROVED INCOMPLETE APPROVED
APPROVED APPROVED APPROVED
APPROVED INITIATE APPROVAL APPROVED

You can import Standard purchase orders with an INCOMPLETE status and then automatically initiate the PO Approval Workflow for these imported documents. Specifying a status of Incomplete or leaving the status Null in the interface data, and specifying a value of Initiate Approval for the Approval Status runtime parameter can achieve this.

Standard purchase orders can also be imported with an APPROVED status. Specifying a status of Approved in the interface data or leaving the status Null in the interface data, and specifying a value of Approved for the Approval Status runtime parameter can achieve this. The PO Approval Workflow is not initiated.

Batch ID (Optional)
Enter a valid batch ID, that is a unique identifier for the group of documents in this submission. If you don't enter a Batch ID, one is generated for you when the process runs.
Import Standard Purchase Orders对应的后台程序为SQL*Plus类型的POXPDOI
订单Import Program的后台逻辑
1.首先从PO_HEADERS_INTERFACE处理一条记录
2.根据INTERFACE_HEADER_ID,再处理行接口记录PO_LINES_INTERFACE,以及 PO_DISTRIBUTIONS_INTERFACE。都处理完之后,又从PO_HEADERS_INTERFACE表中Pick下一个订单头数据。
  • In between , If the program gets an error while processing a record, the program writes the error details to the PO_INTERFACE_ERRORS table and increments the record's error counter.
  • Therefore, the Purchasing Documents Open Interface saves or errors out on a line-byline basis.
  • This means that if an error is found in a document line, only that line is rolled back (not submitted to Purchasing), and we will be able to find the error in the PO_INTERFACE_ERRORS table.
  • You should be aware , because the Purchasing Documents Open Interface can accept partial documents as it saves or errors out line by line.
  • If an error is found in a header, none of its lines are processed.
  • The Purchasing Documents Open Interface rolls back the header, does not process its lines, and does the following:
    • Sets the PROCESS_CODE column value to REJECTED in the PO_HEADERS_INTERFACE table.
    • Writes out the record identification number and the details of the error to the PO_INTERFACE_ERRORS table.
    • Begins processing the next header record.
  • If no processing errors are found during processing, the header record and all successfully submitted child records are loaded into Purchasing, and then flagged as processed by setting the PROCESS_CODE column to ACCEPTED.

As mention earlier, To check for records in error, the Purchasing Interface Errors Report can be run to provide information as to the cause of the error.

Diagnose Problems With Importing Standard Purchase Orders
如果Import Standard Purchase Orders运行后报错,可使用Purchasing Interface Errors Report来查错,这个Report实际上就是PO_INTERFACE_ERRORS里的内容。
如果订单没有导入成功,可以使用下边的SQL查看错误信息,
Select * from PO_INTERFACE_ERRORS where interface_type = 'PO_DOCS_OPEN_INTERFACE' order by creation_date desc;
TRACING
To trace the Import Standard Purchase Orders program from 11.5.10 onwards, do the following :
1 - Navigate to System Administrator responsibility
2 - Navigate to Profiles->System
3 - Query the Profile Option Concurrent: Allow Debugging and set it to Yes at User level
4 - Navigate to Purchasing responsibility
5 - From the Requests form, choose the Import Standard Purchase Orders program and set the required Parameters
6 - Click the Debug button
7 - Check the SQL Trace checkbox and specify Trace with Binds and Waits
8 - Submit the Concurrent program
9 - Retrieve the trace file created.

LOGGING
In order to create a FND Debug Log for the Import Standard Purchase Orders program, the following steps need to be followed :
1 - Using a SQL client run the following query and Note down this log_seq. :
select max(log_sequence) from fnd_log_messages;
2 - Set the following profiles at the user level:
FND: Debug Log Enabled = YES
FND: Debug Log Filename = NULL
FND: Debug Log Level = STATEMENT
FND: Debug Log Module = %
3 - Run Import Standard Purchase Orders program
4. Using a SQL client run the following query :
    Select * from fnd_log_messages
    where log_sequence > &log_seq_noted_above
    order by log_sequence
The output of this query can indicate errors that were encountered during the Import Standard Purchase Orders program.

 
Key Fields in Interface Tables
PO_HEADERS_INTERFACE
PROCESS_CODE: Set it to PENDING. After processing it shows as ACCEPTED, REJECTED or NOTIFIED.
如果订单头出错,那么Program不会处理订单行中的内容,订单头接口表中PROCESS_CODE字段会被设置为REJECTED,如果没错则PROCESS_CODE字段为ACCEPTED
For blanket purchase agreements and standard purchase orders only, when the supplier sends an updated price/sales catalog, the Purchasing Documents Open Interface sets the PROCESS_CODE column to NOTIFIED for those lines with prices that exceed your price tolerance. For these price updates only, the Purchasing Documents Open Interface waits for you to accept or reject the price increase in the Exceeded Price Tolerances window before completing or rejecting the price change. 

ACTION: ORIGINAL, REPLACE or UPDATE.
      ORIGINAL: Original is one in which all information is new in your system.
      REPLACE: Replaces already-created blanket purchase agreements or catalog quotations with new documents containing the new information. First, it looks for documents that have same document type

                    (DOCUMENT_TYPE_CODE), supplier (VENDOR_ID)  and supplier document number (VENDOR_DOC_ NUM) with the existing supplier document number (VENDOR_ORDER _NUM) as the replacement document
      UPDATE: Updates Unit Price, Item Description, UOM, Price Breaks, Expiration Date
For More Fields Descrption,Check This Blog

DOCUMENT_TYPE_CODE:  STANDARD, BLANKET , QUOTATION
Interface Scripts Examples
a - PO with a single line :

INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
1,
'PENDING',
'ORIGINAL', -- Indicates this is a new document
204, -- Org id for operating unit Vision Operations
'STANDARD', -- Indicates a standard PO is being imported
'USD', -- The currency to be used in the PO
57, -- The ID of the buyer
'Office Supplies, Inc.', -- Supplier name
'OFFICESUPPLIES', -- Supplier Site
'V1- New York City', -- Ship to location name
'V1- New York City', -- Bill to location name
'TestPO'); -- Reference that can be tied to the imported PO INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM96713', -- Item to imported on the PO line
'Ea', -- Unit of Measure
1,
50, -- Line price in specified currency
'V1', -- Inventory Organization which will receive the shipment
'V1- New York City' ); -- Ship to location name commit;

b - PO with one line and one distribution :

INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
2,
'PENDING',
'ORIGINAL',
204,
'STANDARD',
'USD',
57, -- Your buyer id
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City',
'V1- New York City',
'TestPO'); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM96713',
'Ea',
1,
50,
'V1',
'V1- New York City' ); INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po_headers_interface_s.currval,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
1,
1,
12975); -- Code Combination ID for the Charge Account to be used on the Distribution commit;

c - PO with two lines :

INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
3,
'PENDING',
'ORIGINAL',
204,
'STANDARD',
'USD',
57,
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City',
'V1- New York City',
'TestPO'); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM96713',
'Ea',
1,
50,
'V1',
'V1- New York City' ); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
2,
1,
'Goods',
'CM96713',
'Ea',
1,
80,
'V1',
'V1- New York City' ); commit;

d - PO with one line and two shipments :

INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
4,
'PENDING',
'ORIGINAL',
204,
'STANDARD',
'USD',
57,
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City',
'V1- New York City',
'TestPO'); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location,
promised_date)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM96713',
'Ea',
1,
50,
'V1',
'V1- New York City',
sysdate+1); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location,
promised_date)
VALUES
(apps.po_lines_interface_s.NEXTVAL,
apps.po_headers_interface_s.CURRVAL,
1,
2,
'Goods',
'CM96713',
'Ea',
2,
50,
'V1',
'V1- New York City',
sysdate+5); commit;

e - PO with one line, one shipment and two distributions :

INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
5,
'PENDING',
'ORIGINAL',
204,
'STANDARD',
'USD',
57,
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City',
'V1- New York City',
'TestPO'); INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
ship_to_organization_code,
ship_to_location,
promised_date)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM96713',
'Ea',
5,
50,
'V1',
'V1- New York City',
sysdate+1); INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po_headers_interface_s.currval,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
1,
1,
12975); INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po_headers_interface_s.currval,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
2,
4,
12976); commit

推荐阅读

转载请注明出处:http://blog.csdn.net/pan_tian/article/details/12202365

Purchase Document Open Interface(PDOI)的更多相关文章

  1. RAC的QA

    RAC: Frequently Asked Questions [ID 220970.1]   修改时间 13-JAN-2011     类型 FAQ     状态 PUBLISHED   Appli ...

  2. SAP事务码 一

    SE80 -- edit source code. SE24 -- class create or display. SFP -- created and maintained independent ...

  3. spring源码分析(一)IoC、DI

    创建日期:2016.08.06 修改日期:2016.08.07 - 2016.08.12 交流QQ:992591601 参考书籍:<spring源码深度解析>.<spring技术内幕 ...

  4. SAP ECC FI配置文档

    SAP ECC 6.0 Configuration Document Financial Accounting (FI) Table of Content TOC \O "1-2" ...

  5. C#之你懂得的反射

    前言:反射在C#中虽然不常用(如果不需要动态加载xx.dll),但是有时候却是设计某个程序或者完成某类功能比较好用的技术.比如:一个支持动态扩展的程序,这样就需要动态加载dll,动态创建加载dll的程 ...

  6. obj-c编程15[Cocoa实例03]:MVC以及归档化演示样例

    前面的博文里介绍了归档和解档,这里我们把它实际应用到一个简单的代码中去,将它作为一个多文档应用程序的打开和保存的背后支持.另外这里介绍一下MVC思想,这个在不论什么语言里都会有,它是一种设计思想,主要 ...

  7. WEB 技术分类 Javascript DOM(Element Node) BOM

    Web technology for developers   Web 技术文档 备注:本文介绍web technology的分类,各自职责,因为之前一直就没有搞明白各种技术.各种名词究竟是属于哪个范 ...

  8. Spring读取xml配置文件的原理与实现

    本篇博文的目录: 一:前言 二:spring的配置文件 三:依赖的第三方库.使用技术.代码布局 四:Document实现 五:获取Element的实现 六:解析Element元素 七:Bean创造器 ...

  9. 自己动手编写IOC框架(一)

    博客创建了2年多了,一直没敢写点东西,怕技术不够误导了别人.2年多后的今天我已经很有信心能够为需要帮助的人做点微薄的贡献了.这是我第一次写博客,先自我介绍一下.本人网名泪滴,一个非常伤心的名字,生活中 ...

随机推荐

  1. MeasureSpec

    在自定义View和ViewGroup的时候,我们经常会遇到int型的MeasureSpec来表示一个组件的大小,这个变量里面不仅有组件的尺寸大小,还有大小的模式. 这个大小的模式,有点难以理解.在系统 ...

  2. Xml解析之——Java/Android/Python

    Xml解析之——Java/Android/Python 一.Xml文件 test.xml <note> <to>George</to> <from>Jo ...

  3. iOS 中的传值方式

    一. 属性传值   将A页面所拥有的信息通过属性传递到B页面使用 很常用的传值,也很方便,但是要拿到类的属性.例如: B页面定义了一个naviTitle属性,在A页面中直接通过属性赋值将A页面中的值传 ...

  4. Python md5 sha1 的使用

    版本: Python 2.7 说明: Python 内置的 hashlib 模块中有 md5 和 sha1 加密方法,可以直接使用. md5加密 import hashlib data = 'This ...

  5. id class

    id 选择器可以为标有特定 id 的 HTML 元素指定特定的样式. HTML元素以id属性来设置id选择器,CSS 中 id 选择器以 "#" 来定义. 以下的样式规则应用于元素 ...

  6. WebAPI接口测试之matthewcv.WebApiTestClient

    WebAPI接口测试之matthewcv.WebApiTestClient matthewcv.WebApiTestClient 1.安装matthewcv.WebApiTestClient包 打开v ...

  7. Phaser开源2d引擎 javascript/html5游戏框架

    功能特点(Features) 易维护代码(Easy Asset Loading) Phaser可以加载图片,音频文件,数据文件,文本文件和自动解析精灵图和纹理地图集数据(出口纹理封隔器或Flash C ...

  8. VS2013安装过程截图

    ================================================================ VS 2013 中新增了很多提高开发人员工作效率的新功能,比如自动补全 ...

  9. MLlib-协同过滤

    协同过滤 显示vs隐式反馈 参数调整 实例 教程 协同过滤 协同过滤是推荐系统的常用方法.可以填充user-item相关矩阵中的缺失值.MLlib支持基于模型的协同过滤,即使用能够预测缺失值的一个隐藏 ...

  10. springboot工程读取配置文件application.yml的写法

    现在流行springboot框架的项目,里面的默认配置文件为application.yml,我们怎样读取这个配置文件呢? 先贴上我得配置文件吧 目录结构 里面内容 1 写读取配置文件的工具类 @Con ...