Sei sulla pagina 1di 41

Oracle Applications

Release 11.5.10
Interfaces dans PO

Présentation technique
Consultant: Hamid KHALAF
16 juin 2005

Copyright Ó Oracle Corporation, 1998. All rights reserved.


Rappel : Reprises prévues dans PO

• Demande d’achats :

• Commandes (commande stand, cmde ouverte, prop. Prix)

• Catégories d’achats : Code catégorie (par data load)

• Employés (création + affectation au poste,…)

• Fournisseurs (A priori manuel) : Nvlle Interface stnd en 11.5.10

• Affectation des fournisseurs aux catégories / articles

1-2 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Tables de production : PO

• PO_REQUISITION_HEADERS_ALL : Demandes d’achats

• PO_REQUISITION_LINES_ALL : Lignes des DA

• PO_REQ_DISTIRIBUTIONS_ALL : Lignes d’imputations

• PO_HEADERS_ALL : Entêtes de commandes

• PO_LINES_ALL : Lignes de commandes

• PO_LINE_LOCATIONS_ALL : Lieux de livraisons

• PO_DISTRIBUTIONS_ALL : lignes d’imputations

1-3 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Tables d’interface: PO

• PO_REQUISITIONS_INTERFACE_ALL

• PO_REQ_DIST_INTERFACE_ALL

• PO_HEADERS_INTERFACE

• PO_LINES_INTERFACE

• PO_DISTRIBUTIONS_INTERFACE

• PO_INTERFACE_ERRORS

1-4 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Demandes d’achats (PO)
PO_REQUISITION_HEADERS_ALL
#* REQUISITION_HEADER_ID
* PREPARER_ID
* ORG_ID
o SEGMENT1

PO_REQUISITION_LINES_ALL
#* REQUISITION_LINE_ID
* REQUISITION_HEADER_ID
* LINE_NUM
* ORG_ID
o

PO_REQ_DISTRIBUTIONS_ALL
#* DISTRIBUTION_ID
* REQUISITION_LINE_ID
o CODE_COMBINATION_ID
o ORG_ID

1-5 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes (PO)
PO_HEADERS_ALL
#* PO_HEADER_ID
* AGENT_ID
* TYPE_LOOKUP_CODE
o VENDOR_ID
o SEGMENT1

PO_LINES_ALL
#* PO_LINE_ID
* PO_HEADER_ID
* LINE_NUM
* ORG_ID
o

PO_LINE_LOCATIONS_ALL PO_DISTRIBUTIONS_ALL
#* LINE_LOCATION_ID #* PO_DISTRIBUTION_ID
* PO_LINE_ID * PO_LINE_ID
o PO_HEADER_ID o PO_HEADER_ID
o ORG_ID o LINE_LICATION_ID

1-6 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Demandes d’achats : required data
Table PO_REQUISITIONS_INTERFACE_ALL
• INTERFACE_SOURCE_CODE
• DESTINATION_TYPE_CODE
• AUTHORIZATION_STATUS
• PREPARER_ID or PREPARER_NAME
• QUANTITY
• CHARGE_ACCOUNT_ID or charge account segment values
• DESTINATION_ORGANIZATION_ID or
DESTINATION_ORGANIZATION_CODE
• DELIVER_TO_LOCATION_ID or DELIVER_TO_LOCATION_CODE
• DELIVER_TO_REQUESTOR_ID or
DELIVER_TO_REQUESTOR_NAME
1-7 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Exemple d’insertion de DA
Table PO_REQUISITIONS_INTERFACE_ALL
insert into po_requisitions_interface_all (
interface_source_code,
source_type_code, -- origine
destination_type_code, -- type de destination
authorization_status,
preparer_name,
header_description,
item_description,
item_id
category_segment1, category_segment2,
category_segment3, category_segment4,
1-8 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Exemple d’insertion de DA
quantity,
unit_price,
charge_account_segment1, -- ou bien charge_account_id
charge_account_segment2,
charge_account_segment3,
charge_account_segment4,
charge_account_segment5,…11
unit_of_measure,
destination_organization_code, -- ou bien passer l’ID
deliver_to_location_code, -- ou bien ID
deliver_to_requestor_name, -- ou bien ID
autosource_flag,
org_id)
1-9 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Exemple d’insertion de DA
values (
'Demonstration of Import', -- interface_source_code
'VENDOR', -- source_type_code
'EXPENSE', -- destination_type_code
'APPROVED', -- authorization_status
‘KHALAF, Hamid', -- preparer_name
'Imported Requisition', -- header_description
'Imported Item', -- item_description
‘-', -- category_segment1
‘-', -- category_segment2
‘’ , ‘’ , -- category_segment3 , -- category_segment4
1, -- quantity
20, -- unit_price
1-10 Copyright Ó Oracle Corporation, 1998. All rights reserved.
'0010', -- charge_account_segment1
Exemple d’insertion de DA
‘3121100', -- charge_account_segment2
‘S4114', -- charge_account_segment3
‘K01SAM', -- charge_account_segment4
‘0', -- charge_account_segment5,…segment11
‘KILOGRAMME', -- unit_of_measure
‘PFM_OL', -- destination_organization_code
‘OCP', -- deliver_to_location_code
‘KHALAF, Hamid', -- deliver_to_requestor_name
'',
14); -- org_id
commit;

1-11 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Lancement de l’open interface standard
Importer des demandes d’approvisionnements

Erreurs de chargement

État exception d’importation des demandes


d’approvisionnement

1-12 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement

INSERT INTO PO_HEADERS_INTERFACE


( batch_id
, interface_header_id -- séquence standard
, interface_source_code
, action -- ORIGINAL pour cmde standard
, document_type_code
-- STANDARD,
-- BLANKET (cmde ouverte), or
-- QUOTATION (prop. De prix).
, document_num
, vendor_doc_num
, currency_code
, agent_id
, vendor_id ,
1-13 , vendor_site_id
Copyright Ó Oracle Corporation, 1998. All rights reserved.
Commandes : chargement

INSERT INTO PO_HEADERS_INTERFACE


ship_to_location_id
, bill_to_location_id
, org_id
, note_to_vendor
, comments
, last_update_date
, last_updated_by
, creation_date
, created_by
, last_update_login)

1-14 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement

-- interface_header_id
SELECT po_headers_interface_s.NEXTVAL
INTO gv_interface_header_id
FROM DUAL ;

1-15 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement

INSERT INTO PO_LINES_INTERFACE


( interface_header_id -- lien avec l’entête
, interface_line_id -- identifiant unique ligne
, line_num
, shipment_type
, shipment_num
, ship_to_organization_id
, ship_to_location_id
, item
, item_description
, vendor_product_num
, promised_date
, uom_code

1-16 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement

INSERT INTO PO_LINES_INTERFACE


, quantity
, unit_price
, note_to_vendor
, organization_id
, last_update_date
, last_updated_by
, creation_date
, created_by
, last_update_login

1-17 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement

-- interface_line_id
SELECT po_lines_interface_s.NEXTVAL
INTO gv_interface_line_id
FROM DUAL ;

1-18 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Commandes : chargement
INSERT INTO PO_DISTRIBUTIONS_INTERFACE
( interface_header_id
, interface_line_id
, interface_distribution_id
, distribution_num
, quantity_ordered
, deliver_to_location_id
, deliver_to_person_id
, charge_account_id
, destination_organization_id
, org_id
, last_update_date
, last_updated_by
, creation_date
, created_by
, last_update_login)
1-19 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Lancement de l’open interface

• Lancement :
Importer des commandes standard

• Erreurs de chargement : (dans PO_INTERFACE_ERRORS)


État des erreurs de l’interface des achats

On peut corriger les données, mettre la colonne process_code =


Null dans les tables d’interface, et lancer ensuite l’interface standard
d’importation.
update po_headers_interface
set process_code = null
where process_code = 'REJECTED';
update po_lines_interface
set process_code = null
where process_code = 'REJECTED';
1-20 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Mise à jour d’une commande
v_update_status := PO_CHANGE_API1_S.update_po
( v_latest_po -- PO Number
, NULL -- Release Number
, v_revision_num -- Revision Number
, v_line_num -- Line Number
,1 -- Shipment Number
, v_quantity -- Quantity
, v_unit_price -- Price
, v_promised_date -- Date
, 'Y' -- Launch Approvals
, NULL -- Update Source
, 'PO_UPDATE' -- Interface Type
, NULL -- Transaction ID
, '1.0' -- API Version
1-21 );
Copyright Ó Oracle Corporation, 1998. All rights reserved.
Mise à jour d’une commande
Exemple de mise à jour de unit_price et expiration_date
pour la commande ouverte / prop. prix existante :
Besoin d’alimenter la table : PO_HEADERS_INTERFACE
INTERFACE_HEADER_ID = po_headers_interface_s.nextval
ACTION = 'UPDATE'
ORG_ID
DOCUMENT_TYPE_CODE = 'BLANKET' or 'QUOTATION‘
VENDOR_ID, VENDOR_SITE_CODE, VENDOR_SITE_ID
PO_HEADER_ID or DOCUMENT_NUM
EFFECTIVE_DATE , EXPIRATION_DATE
VENDOR_DOC_NUM –
for blanket, it should be VENDOR_ORDER_NUM in po_headers_all
table
for quotation, it should be QUOTE_VENDOR_QUOTE_NUMBER in
the po_headers_all table
1-22 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Mise à jour d’une commande
Besoin d’alimenter la table : PO_LINES_INTERFACE
PO_LINES_INTERFACE
INTERFACE_LINE_ID = po_lines_interface_s.nextval
INTERFACE_HEADER_ID - same value as in the
po_headers_interface.
ACTION = 'UPDATE'
ORG_ID
PO_LINE_ID or LINE_NUM
PO_HEADER_ID or DOCUMENT_NUM
ITEM
TEM_DESCRIPTION –
make sure the item description is populated right.
UNIT_PRICE if you want to change
UNIT_OF_MEASURE
EXPIRATION_DATE if you want to change –
1-23 Copyright Ó Oracle Corporation, 1998. All rights reserved.
has to be <= EXPIRATION_DATE in the header.
Exemple d’ajout d’une nouvelle ligne
Pour la commande ouverte / prop. prix existante :
Besoin d’alimenter la table : PO_HEADERS_INTERFACE
INTERFACE_HEADER_ID = po_headers_interface_s.nextval
ACTION = 'UPDATE'
ORG_ID
DOCUMENT_TYPE_CODE = 'BLANKET' or 'QUOTATION‘
VENDOR_ID, VENDOR_SITE_CODE, VENDOR_SITE_ID
PO_HEADER_ID or DOCUMENT_NUM
-- the existing blanket / quotation number
EFFECTIVE_DATE -- existing
EXPIRATION_DATE -- existing
VENDOR_DOC_NUM –
for blanket, it should be VENDOR_ORDER_NUM of the existing
blanket
for quotation, it should be QUOTE_VENDOR_QUOTE_NUMBER of
1-24 Copyright Ó Oracle Corporation, 1998. All rights reserved.
the existing quotation
Exemple d’ajout d’une nouvelle ligne
Besoin d’alimenter la table : PO_LINES_INTERFACE
PO_LINES_INTERFACE
INTERFACE_LINE_ID = po_lines_interface_s.nextval
INTERFACE_HEADER_ID - same value as in the
po_headers_interface.
ACTION = ‘ADD'
PO_HEADER_ID or DOCUMENT_NUM
-- existing quotation / blanket number
ITEM_ID or ITEM
UNIT_PRICE if you want to change
UNIT_OF_MEASURE
EFFECTIVE_DATE
EXPIRATION_DATE

1-25 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Exemple de chargement d’une nouvelle
commande ouverte
insert into po_headers_interface (interface_header_id, action,
org_id, document_type_code, vendor_id, vendor_site_code,
vendor_site_id, effective_date, expiration_date,
Vendor_doc_num, load_sourcing_rules_flag)
values (po_headers_interface_s.nextval, 'ORIGINAL', 204,
'BLANKET', 21, 'SANTA CLARA', 41, '01-JAN-2001',
'01-JAN-2002', 'VENDOR02', 'Y');

1-26 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Exemple de chargement d’une nouvelle
commande ouverte
insert into po_lines_interface (interface_line_id,
interface_header_id, action, item, item_description,
unit_price, unit_of_measure, effective_date, expiration_date,
template_name)
values (po_lines_interface_s.nextval,
po_headers_interface_s.currval, 'ORIGINAL', 'BB54888',
'BB54888 Description', 10, 'Each', '01-JAN-2001', '01-
JAN-2002', 'Purchased Item');

1-27 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Programme de purge

Après le chargement réussi dans les tables Oracle, les données


restent dans les tables d’interface avec process_code =
‘ACCEPTED’.
Nom du traitement :
Purger données traitées par interface coopérative Oracle Purchasing

1-28 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Fournisseurs : nouvelle interface de la
11.5.10

Suppliers window PO_VENDORS

Supplier Sites window PO_VENDOR_SITES_ALL

Contacts tab
PO_VENDOR_CONTACTS
of the Supplier Sites window

1-29 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Fournisseurs : (suite)

Supplier
AP_SUPPLIERS_INT Open Interface PO_VENDORS
Import
(APXSUIMP)

Supplier Sites
AP_SUPPLIER_SITES_INT Open Interface PO_VENDOR_SITES_ALL
Import
(APXSSIMP)

Supplier Site Contacts


AP_SUP_SITE_CONTACT_I Open Interface PO_VENDOR_CONTACTS
NT
Import (APXSCIMP)

1-30 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Fournisseurs : (suite)

Three new reports were added:

Supplier Supplier Sites Supplier Site Contacts


Open Interface Open Interface Open Interface Import
Import Import

Suppliers Supplier Sites Supplier Site


Open Interface Open Interface Contacts Open
Import Execution Import Execution Interface Import
Report Report Execution Report

1-31 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Fournisseurs : Exemple

insert into AP_SUPPLIERS_INT


(vendor_interface_id,
vendor_name,
allow_awt_flag,
awt_group_name)
values
(AP_SUPPLIERS_INT_S.nextval,
‘OCP Test',
'Y',
'1099')
/

1-32 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Fournisseurs : Exemple
insert into AP_SUPPLIER_SITES_INT
(vendor_interface_id,
vendor_site_code,
address_line1,
city, state,
zip, pay_site_flag,
org_id)
Values (11000,
'SITE1',
'12233 Oracle Boulevard',
‘Aix en provence',
‘FR',
13100,
'Y',
14)
1-33 Copyright Ó Oracle Corporation, 1998. All rights reserved.
/
Fournisseurs : Exemple
insert into AP_SUP_SITE_CONTACT_INT
(vendor_site_id,
vendor_site_code,
org_id,
first_name,
last_name,
phone)
values
(4597,
'SITE1',
204,
'HAROLD',
'JOHNSON',
'800-555-1212')
/
1-34 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Fournisseurs : lancement de l’interface

• Importation de l’interface coopérative fournisseur


• Importation de l’interface coopérative des sites fournisseurs
• Importation de l’interface coopérative des contacts du site
fournisseur

1-35 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Employés
• HR_EMPLOYEE_API
• HR_PERSON_API
• HR_ASSIGNMENT_API

• Voir Note Metalink : 152028.1

1-36 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Employés : exemple
declare
l_emp_num varchar2(30) := '55555';
l_person_id NUMBER;
l_assignment_id NUMBER;
l_per_object_version_number NUMBER;
l_asg_object_version_number NUMBER;
l_per_effective_start_date DATE;
l_per_effective_end_date DATE;
l_full_name VARCHAR2(240);
l_per_comment_id NUMBER;
l_assignment_sequence NUMBER;
l_assignment_number VARCHAR2(30);
l_name_combination_warning BOOLEAN;
l_assign_payroll_warning BOOLEAN;
l_orig_hire_warning BOOLEAN;
1-37 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Employés
begin
HR_EMPLOYEE_API.CREATE_EMPLOYEE(
p_hire_date => TO_DATE('01-01-1966','DD-MM-YYYY'),
p_business_group_id => 1,
p_last_name => 'PERNET',
p_sex => 'M',
p_employee_number => l_emp_num,
p_person_id => l_person_id,
p_assignment_id => l_assignment_id,
p_per_object_version_number => l_per_object_version_number,
p_asg_object_version_number => l_asg_object_version_number,
p_per_effective_start_date => l_per_effective_start_date,
p_per_effective_end_date => l_per_effective_end_date,
p_full_name => l_full_name,
p_per_comment_id => l_per_comment_id,
1-38 Copyright Ó Oracle Corporation, 1998. All rights reserved.
Employés
begin
HR_EMPLOYEE_API.CREATE_EMPLOYEE(
p_assignment_sequence => l_assignment_sequence,
p_assignment_number => l_assignment_number,
p_name_combination_warning => l_name_combination_warning,
p_assign_payroll_warning => l_assign_payroll_warning,
p_orig_hire_warning => l_orig_hire_warning
);
end;

1-39 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Affectation des fournisseurs aux articles
/ catégories

Aucune interface standard


Étudier la possibilité offerte en standard :
« Liste des fournisseurs approuvés »

1-40 Copyright Ó Oracle Corporation, 1998. All rights reserved.


Documentation

• Oracle Manufacturing APIs and Open Interfaces


Manual, Release 11i

1-41 Copyright Ó Oracle Corporation, 1998. All rights reserved.

Potrebbero piacerti anche