PO Communication Methods Technical Brief
PO Communication Methods Technical Brief
PO Communication Methods Technical Brief
Communication Methods
An Oracle Technical Brief
March 2008
Article On Purchasing Communication Methods
Introduction.............................................................................................
..........5
1.0
Print..........................................................................................................
.....5
Choosing the format of document for
communication..........................5
Text
Format..............................................................................................
5
PDF...................................................................................................
.........6
Setting up
.......................................................................................................6
Report
parameters.........................................................................................6
Launching Printed PO report from
Approval..........................................7
Printed Purchase Order report output
......................................................9
2.0
Fax............................................................................................................
.....9
How it works?
...............................................................................................9
Text
Format..............................................................................................
9
PDF
Format............................................................................................1
0
Sample
Output............................................................................................10
Output when the format is
text............................................................10
Article On Purchasing Communication Methods Page 2
Output when the format is
PDF..........................................................11
Fax codes control file
............................................................................11
Setup
steps...................................................................................................1
1
Select the communication method as ‘Fax’ for supplier site
...........12
Faxing at the end of
approval...............................................................12
3.0
Email........................................................................................................
...12
How it works?
.............................................................................................12
Features of Oracle
Workflow...............................................................12
HTML
format.........................................................................................13
PDF
format.............................................................................................1
4
Setup
steps...................................................................................................1
4
Supplier Site
............................................................................................14
Set the Profile
Options..........................................................................15
Create and Approve
PO........................................................................15
What happens in
Approval?......................................................................16
Sample Purchase Order
Emails................................................................17
Important Queries for Email Purchase
Orders......................................17
Script to check the workflow status and po_wf_debug
data...........17
To check the AdHocUser
Setup..........................................................17
To check the Mail
status........................................................................18 To Verify the
Article On Purchasing Communication Methods Page 3
Mail content from sqlplus............................................18 R12
feature to support communication of nontext attachments
through
email:..............................................................................................18
View Attachments in PDF
PO.................................................................18
Communicate Attachments via
Email.....................................................19
4.0 PDF – In
depth.........................................................................................19
What is XML?
.............................................................................................19
What is
XSL?...............................................................................................20
XSL consists of three
parts:..................................................................20
XSLT = XSL
Transformations............................................................20
XSLT Uses
XPath:.................................................................................20
XSL-
FO:.......................................................................................................
20
XML
Publisher............................................................................................2
1
Advantages of PDF over Text
format.....................................................21
Prereq for PDF Document
Generation..................................................22
Overview of the PDF document generation
solution...........................22
XML
Generation....................................................................................2
3
XSL Style
Sheets.....................................................................................23
Generate Documents API
....................................................................24
Generate PDF Document
(genDoc)...................................................25
XDO API’s
.............................................................................................27
INTRODUCTION
In business world, communication of documents between legal entities is
crucial.
They play an important role in driving the business. Oracle Advanced
Procurement Suite of Applications supports variety of communication methods
starting traditional Postal mails to the recent PDF document communicated
through Email and automatic communication of documents through XML and
EDI.
Print
Fax
Email
XML EDI
1.0 PRINT
This is one of the traditional communication methods. The legal documents
[Purchase orders and Purchase agreements] are printed on pre-printed
stationeries and sent to suppliers though normal postal service.
Text Format
The Printed Purchase Order report [Landscape and Portrait] generates the
document in text format. The document is printed on a printer setup in the
system. The document can be printed on pre-printed stationeries, which has
the company logo and other required legal declarations [like confidential etc].
To support this the report output we will not hard code any headings/labels.
PDF
Setting up
Minimum steps for printing are:
• Setup the Printer
Report parameters
Print Selection
This parameter determines what type of documents needs to be
printed. This parameter can have the following values: New, Changed,
All.
New: Print only the new documents, which are never been
communicated.
Changed: Print only Changed documents that have been
communicated at least once in the past.
All: Print all the documents.
Purchase Order Numbers From/To
Provide the range of document Numbers to Print.
Release Numbers From/To
Provide the range of Release Numbers to Print
Release Dates From/To
Provide the range of release dates to print. This is applicable only for
Releases.
Approved
Whether to Print the Approved documents or all documents.
Test
How it works?
Text Format
The fax server is configured as a printer in application. Buyer will choose this fax
server (printer) while submitting the fax request.
To fax, the buyer submits the Printed PO report with Fax parameter as ‘Yes’. In
addition the fax number is also provided as parameter. The report prints the
document wrapping inside the Fax Control codes. The report output is directed
to the fax server (printer).
Fax server interprets the control codes and starts transmission when it
encounters the Start control codes. The transmission is terminated when the
fax server encounters the end control codes.
PDF Format
The fax should be capable of transmitting the PDF documents. The server is
configured to listen to a directory in the system in Oracle applications network.
Whenever a new control file is generated in this directory, fax server will pick
up the control file and transmit the document to the specified location.
To fax the document, the buyer will submit the request ‘PO Output for
Communication’ with Fax as parameter. This program generates the PDF
Article On Purchasing Communication Methods Page 11
document and also generates a control codes file. The control codes file will be
placed in the directory specified in the profile option ‘PO: Fax Output Directory
for the PO Document’
Since the fax server is configured to listen to this directory, once the control file
is generated the fax server will transmit the document.
Sample Output
Setup steps
At the end of approval process, buyer can optionally choose to fax the
document. This option is available in the Approval window. Buyer needs to
check the fax check box and to fill up the fax number. Then at the end of
approval process depending on the document format chosen, corresponding
output will be generated and faxed to the suppliers automatically.
3.0 EMAIL
Next communication method is email. Emailing the Purchasing documents is an
easy to use, cheaper and reliable communication method. Oracle Purchasing
supports emailing purchasing documents to suppliers
How it works?
Oracle Purchasing leverages the Oracle Workflow’s capabilities to email the
Purchasing Documents. Oracle Workflow provides a facility to email the
notifications to the specified workflow user. Purchasing uses this concept to
send the Purchasing documents to the suppliers. The document can be sent in
HTML or in the PDF format.
Po_Email_Header 'PLSQL:
PO_EMAIL_GENERATE.GENERATE_HEADER/'||
To_Char (Documentid) || ':' || Documenttypecode
Po_Email_Body 'PLSQLCLOB:
PO_EMAIL_GENERATE.GENERATE_HTML/'||
To_Char (Documentid) || ':' || Documenttypecode
Po_Terms_Condition 'PLSQLCLOB:
s PO_EMAIL_GENERATE.GENERATE_TERMS/'||
L_Itemtype || ':' || L_Itemkey
Working Principle
Setup steps
Supplier Site
While creating the Supplier site, make sure to provide the correct language of
the supplier site. Choose the default communication method as Email and
provide the default email address to use in the E-mail field.
Now we need to set few profile options to complete the Email PO setup.
Navigate to: Sysadmin=>Profiles=>System
Set the profile option PO: Secondary Email address to a generic Email address
([email protected]) to which also the purchase order will be sent.
This back up Email can be used for internal reference or to forward to supplier
in case if it is missed some how.
Set the PO: In File Path profile option to a UNIX directory in which the terms
and conditions file will be placed. Make sure that the directory required
permissions.
Login to Unix and place the terms and conditions in the above-mentioned
directory.
Set the PO: Terms and Conditions filename option to a valid file name.
When the Mail is sent the above file will be attached to the Email. First the
system will search for file named FileName_<SupplierLang>. If it is not found
then it will search for file named FileName_<BaseLang>. If that is also not found
then it will search for file named FileName.
The buyer can optionally choose to email the Purchase order at the end of
approval process. This option is available in the Approval window. If the Email
option is chosen then at the end of approval process a notification will be
generated for the supplier. This notification will be emailed to the supplier
email address specified in the approval window.
While sending the document, the general Terms and Conditions also added
form the location mentioned in the above profile options.
At the time of starting of the workflow, the Email address entered in the
approval window is populated in to the workflow attribute EMAIL_ADDRESS.
In addition to the supplier address, the document also can be copied to an
internal Email address. The profile option ‘PO: Secondary Email Address’ holds
the secondary email address to which the document will be sent. This is used as
a backup copy. Incase if the supplier does not receive the original copy of the
Email, then the secondary copy can be forwarded to them.
Script to check the workflow status and po_wf_debug data. Get the Item
Type and Item Key from the po_headers_all table.
Run the wfstat from $FND_TOP/sql using the above Item_Type and Item_key
@wfstat.sql POAPPRV <ITEM_KEY>. Spool the output for reference.
Get the AdHocUserName from the wfstat output in the User Column for
EMAIL_PO_NOTIFICATION activity.
…
22-AUG-03 22:59:52
EMAIL_DOC_PROCESS/EMAIL_PO_NOTIFICATION COMPLETE
#NULL HYDERABAD2252 40455 O
…
In the above HYDERABAD2252 is AdHocUser name and 40455 is Email
notification id.
Run the following SQL to verify the notification status. This should be ‘SENT’
and not ‘FAIL’. If it is ‘OPEN’, it means the notification mailer is not yet sent the
mail.
SELECT status, mail_status FROM
wf_notifications
WHERE notification_id = &NotificationId
Run the bde_wf_notif.sql with the Email Purchase Order Notification id to verify
the Email content in the sqlplus.
The PDF PO can be accessed from the following forms: Enter PO, Enter
Releases, PO Summary, and Approval Notification. This pdf would display the
names of the attachments according to the level they reference. All HTML files
and web pages will appear as hyperlinks. When the user clicks on one of these
hyperlinks, a new window should open with the attachment. All other types of
attachments would be classified as type “File”. Their contents cannot be viewed
directly from the purchase order.
What is XML?
XML (Extensible Markup Language) is a standard for creating markup languages,
which describe the structure of data. It is not a fixed set of elements
like HTML, but rather, it is like SGML (Standard Generalized Markup Language)
in that it is a meta language, or a language for describing languages.
XML enables authors to define their own tags. XML is a formal specification of
the World Wide Web Consortium.
Please refer http://www.w3schools.com/xml/ for more information on XML
What is XSL?
XSL stands for Extensible Style sheet Language.XSL describes how the XML
document should be displayed.
XSL-FO:
XSL-FO stands for Extensible Style sheet Language Formatting Objects.XSL-FO is
an XML-based markup language describing the formatting of XML data for
Article On Purchasing Communication Methods Page 21
output to screen, paper or other media. XSL-FO documents are XML files with
output information. They contain information about the output layout and
output contents. XSL-FO documents are stored in files with a .fo or a .fob file
extension.
It is also quite common to see XSL-FO documents stored with an .xml extension,
because this makes them more accessible to XML editors.
XML Publisher
Oracle XML Publisher is a new java based product available within the
technology stack of the E-Business suite. Utilizing a set of familiar desktop tools
such as Adobe Acrobat and Microsoft Word users can create and maintain their
own report formats based on development delivered xml data extracts. XML
Publisher will then convert these documents to the XSL-FO format. Users can
also obtain 3rd party provided PDF forms e.g. government tax forms and merge
xml data generated from the E-Business Suite to fill the forms with the required
data.
Buyers will be able to view the Purchasing documents online through View
Documents before communicating to the supplier. Also the same PDF
format will be accessible through iSupplier Portal too.
Please note that at this point, Oracle Purchasing does not support the Planned
Purchase order and Scheduled Release documents in PDF format.
To generate the PDF, the data is collected in the form of XML. For purchasing
documents we might need two different XML documents; One XML for
purchasing document and another XML for the contract terms document
The following business views are used to get the xml data. The XML is merely a
select * from these views: po_headers_xml, po_lines_xml,
po_line_locations_xml, po_distribution_xml, po_headers_archive_xml,
po_lines_archive_xml, po_line_locations_archive_xml,
po_distribution_archive_xml.
Oracle purchasing seeds standard style sheets with frequently used layout. The
following are the seeded style sheets.
• Standard Purchase Order Style sheet
• Blanket Agreement Style sheet
• Contract Agreement Style sheet
Article On Purchasing Communication Methods Page 24
• Blanket Release Style sheet
In addition to the XSL style sheets, purchasing also supports PDF templates.
These PDF templates can be easily created using the Acrobat Writer.
The following are the important class variables and their purpose.
m_documentId //represents document id (po_header_id or po_release_id)
m_documentType m_languageCode m_revisionNum m_documentSubtype
//if required m_orgId m_authorizationStatus m_withTerms // “Y”,”N”,”C”
m_storeFlag // “Y”, “N”.”Y” indicates that PDF document needs to be stored in
the repository
m_PDF // has the generated pdf as a BLOB/Stream based on XMLPublisher
API’s m_POXML // PO data as a CLOB m_POXSL // this will have the po
stylesheet in the form of BLOB/Stream based on Template Repository API’s
m_POHasTermsConditions //indicates whether the po has Terms and
Conditions m_POIsSigned //indicates whether the po has been signed atleast
once or not m_archiveOn // print or communicate m_amendmentProfile
m_viewOrCommunicate //view or Communicate m_documentTemplateType
//XSLFO or TEMPLATE (pdf template) m_contractsXML m_contractsXSL
m_fileName m_documentTemplateID
m_connection
m_testFlag
m_regenFlag
Constructors
Methods
GetDocument () //which checks in the repository whether the pdf file exists or
not
GetPOXML () //generates the XML for the given document
After generating the XML data and retrieving the XSL from the database
Generate Documents API calls the XDO APIs to generate the PDF document.
This API takes the XML and XSL as parameters and generates the pdf. Below is
If the document and contract uses different types of layout (style sheet, pdf
template), the generate pdf follows the below logic to generate the pdf
document.
Setup Steps
Purchasing Options
In the Setup->Purchasing options screen choose PDF value for the ‘PO Output
format’ field. This value is used to determine the format in which the document
needs to be communicated.
For each document type, buyers can choose the layout in which the pdf would
be generated. The layout can be selected for the document as well as for the
contract terms. The layout can be a seeded or a customized one. These layouts
are stored in the XML Publisher repository.
Navigate to Setup->Purchasing->Document Types and associate the style sheets
as shown below:
Also optionally the buyers can choose the language of communication as well
decide whether to communicate the terms and conditions or not.
One important argument to note is the ‘Test’ flag. This can be Yes, No or Debug.
The values Yes and No has the same meaning as the Printed Purchase Order
report. If the value for this flag is passed as Debug, then the XML and XSL
contents are printed in the log file. Also the XML Publisher APIs are not called.
This option is very useful to debug any issues with this program. This can be
used to separate the issues between purchasing, Procurement Contracts and
XML Publisher.
But important point to note is, the customer cannot customize the seeded style
sheets. They need to make a copy of the seeded style sheet and then customize
it as per their requirement.
After duplicate the style sheet, they can download the same from XML
Publisher.
Now click on ‘Update’ to update the template file with throne you have
modified
Now the modified style sheet should be selected in the Document Types form.
Incase if there is any issues with the customized style sheet, the customer can
test the PDF generation using the seeded style sheet. This will help them in
identifying whether issue is with the style sheet or with the code.
5.0 XML
XML is one of the automatic methods of communication used by Purchasing to
send the Purchase orders to the suppliers. This communication method
leverages Business Events Feature of Oracle workflow for communication.
Business Events
The Oracle Workflow Business Event System is an application service that
leverages the Oracle Advanced Queuing (AQ) infrastructure to communicate
business events between systems. The Business Event System consists of the
Event Manager and workflow process event activities.
Article On Purchasing Communication Methods Page 38
The Event Manager contains a registry of business events, systems, named
communication agents within those systems, and subscriptions indicating that
an event is significant to a particular system. Events can be raised locally or
received from an external system or the local system through AQ. When a local
event occurs, the subscribing code is executed in the same transaction as the
code that raised the event, unless the subscriptions are deferred.
Subscriptions can include the following types of processing:
• Executing custom code on the event information
• Sending event information to a workflow process
• Sending event information to other queues or systems
You can set up subscriptions, which cause messages to be sent from one system
to another when business events occur. In this way, you can use the Event
Manager to implement point–to–point messaging integration.
XML Gateway does not support all the document types. XML Gateway supports
only the following purchasing documents.
• The workflow even manager dequeues the AQ for events and looks out
for the subscriptions. In this case the POXML workflow is subscribed to
this event. This workflow receives the event with document header id and
does the necessary checks to ensure that XML is chosen in the PO
approval window and the trading partner is setup and then raises an
event ‘Raise XML
Poevent’
• The Event is received by the below process and generates the XML
document. Additionally, XML Gateway provides optional data mapping
that enables the buyer to convert certain data in the XML document
before transmitting it to the supplier.
XML Gateway uses the following two models to send the XML documents
to the supplier
• Model1: XML documents are sent to the supplier by the way of the
Oracle Exchange
• Model2: XML documents are sent to the supplier directly.
The setup for Oracle XML Gateway by the buyer includes entering data in the
Trading Partner Setup window. Select the XML Gateway responsibility.
In the Trading Partner Details region, enter information for the New PO
document as follows
Transaction Type
It is the standard product short code for the base Oracle Application. Type PO
is for Purchasing, and subtype PRO is for Process PO (i.e. a new purchasing
document). For change order transmission POCO subtype should be selected.
The last letter of the subtype signifies the direction of messaging.
Standard Code
This code represents the XML format to be used. Oracle supports most widely
accepted OAG standard. This is best suited for any B2B applications
communication.
Note: The Open Applications Group, Inc. (OAGi) is a not-for-profit
open standards group building process-based XML standards for both
B2B and A2A integration. The Open Applications Group was formed in
late 1994 as the first postEDI organization focusing on improving the
state of application integration.
Website: http://www.openapplications.org/
External Transaction Type
External Transaction Type and subtype are the primary external identifier for
the XML message. For new purchasing document, text ‘SOP’ is used.
Map
This is the name of the map created using the XML Gateway Message Designer.
Select PROCESS_PO_007 from the LOV. (Although you can customize this map,
Oracle does not support the customizations.)
Connection/Hub
This option is used to select whether it is a direct communication to the
supplier site or through a hub like Oracle Exchange. If it is DIRECT
communication method, then the following details must be furnished: Protocol,
Address where the xml document should be posted by the Transport Agent and
the username/password for authentication in the destination server.
This is used to define the XML Message and Process Log Directory. This
directory should be listed as one of the utl_file_dir. Also make sure that the
directory has correct permission settings.
ECX_OAG_LOGICALID
This is used by the sending application to enter the Identifier in the XML
message.
The supplier company needs to perform all necessary setup to enable the
supplier’s system to receive the XML documents transmitted by the buyer
Article On Purchasing Communication Methods Page 43
directly. The supplier should use the same OAGI standard XML documents used
by the buyer company. In addition, the supplier needs to use the same
Extensions DTD as used by the buyer company to ensure all information
transmitted by the buyer is received. The Extensions DTD specifies fields used
by Oracle to provide additional information.
6.0 EDI
Introduction
Electronic Data Interchange (EDI) is the computer-to-computer exchange of
structured information, by agreed message standards, from one computer
application to another by electronic means and with a minimum of human
intervention eliminating paper work. In common usage, EDI is understood to
mean specific interchange methods agreed upon by national or international
standards bodies for the transfer of business transaction data, with one
typical application being the automated purchase of goods and services.
How it works?
Oracle e-Commerce Gateway collects all of the business data needed to map to
a standard EDI transaction, which the receiving Trading Partner can interpret
properly into their receiving application using their equivalent of Oracle
eCommerce Gateway/Translator setup.
Oracle e-Commerce Gateway extracts outbound transaction data from
application tables and loads inbound transactions into the base Oracle
Application Open Interface tables.
During outbound flow the document first recorded in the Oracle system. Then
the e-Commerce Gateway collects the data and generates in to a flat file in
Oracle standard format. Then a third party translator converts the flat file in to
ASCII standard format. This file is then transmitted to the supplier site by
conventional means.
During inbound flow, the oracle host system administrator receives the flat file
(in ASCII format) from the trading partners. The EDI Translator converts this flat
file in to oracle standard format. Oracle e-Commerce Gateway processes flat
file and populates the business data into the open interface tables of Oracle
Applications.
The following table lists the transactions that integrate with Oracle Purchasing
Setup steps
Here is the flow for setting up and running e-Commerce Gateway for Oracle
Purchasing.
In the Define Trading Partner window, select the Assignment tab. Associate the
supplier and supplier site to the trading partner.
In the Define Trading Partner window, select the Details tab. select the
transaction as:
The Map field gets defaulted based on the transaction and transaction type if it
is already setup. This map gives the relation between business data fields and
the position of the fields in the flat file. E-Commerce gateway seeded
predefined standards.
In the Define Trading Partner window, select the Contact tab. The information
on the contact tab is optional. It contains contact data for the specified trading
partner. It may be used by the EDI Coordinator for the trading partner’s EDI
Coordinator’s contact data. This data is for reference only. It is not used by
Oracle e-Commerce Gateway.
The concurrent program will generate the EDI flat file from the PO data and will
write the file to the directory mentioned in the profile option
‘ECE:OUT_FILE_PATH ‘.
Oracle Corporation
World Headquarters
500 Oracle Parkway Redwood
Shores, CA 94065 U.S.A.
Worldwide Inquiries:
Phone: +1.650.506.7000 Fax:
+1.650.506.7200 oracle.com