Customising PO Output For Communication Report in Oracle Purchasing

PO Print PDF Report:

Oracle EBS provided  a standard functionality to print the PO report directly from the PO form itself by clicking tools menu and view PDF option. Once we select that option output will be rendered in PDF format in the browser instantly.

Internally it will run the concurrent program 'PO Output For Communication'. This concurrent program is of JAVA type which will uses the seeded package  'PO_COMMUNICATION_PVT'  for generating the XML data and later this XML data will be processed and formatted by using the XSL template of data definition 'Standard Purchase Order Data Source' in case of standard PO's.

Oracle by default will provide one standard BI publisher template for this. In case if we want to have custom layout for this report we can build a new template for the same data definition and this template has to be used while doing the setup for PO Document types.

Creating Custom Template and Setup this for PO Document type:
To create the custom Layout design for this PO report based on our requirements in how the report should display data in the final output, first we need to identify the data definition which is provided by oracle for different PO types.
For standard type PO's data definition is 'Standard Purchase Order Data Source'
For blanket type PO's data definition is  'Blanket Release Data Source'

If we want to have a custom template for standard PO's then we need to create a new BI publisher template(like XXTEST_TEMPLATE) of XSL-FO type and has to be aware on  XSL-FO and XSLT.  Once we create the new  XSL file as required we can create the BI publisher template.

After creating the the template we need setup for our Document type.
Po Document setup: In purchasing Document setup form (setup >>Purchasing >>Document Types) Define the document type layout as the XXTEST_TEMPLATE

Now if we view the report output for a particular standard PO we can see the output in the new designed layout.
Similarly we can have custom BI publisher templates for Blanket Releases and Contract purchase orders as well.

Generating the Sample XML Data to use it in while developing the XSL template file:
while creating a custom  XSL template we may need to test the XSL file  in BI publisher template viewer for this purpose we need the same XML data. This data we can generate it by running the concurrent program  'PO Output For Communication' (POXPOPDF)  manually from SRS window.

While submitting this concurrent program give the parameters as below to get the XML data in output.
Print Selection = All
Buyer name, Employee Number: Choose the buyer name (who created the PO)
Purchase Order Numbers From = PO Num
Purchase Order Numbers To = PO Num
Test = Debug (Running with Test flag as 'Debug' will only produce XML output if the PDF had not been generated successfully previously.)
Leave all other parameters blank.

This submitted request will give the output in XML.

Ways to Customise the Data Source of this Report:
As above explained layout changes(i.e how the output should appear) can customised by creating the custom template, but in some cases we may need to show the data which is currently not generated in the seeded XML output.
In such cases we can customise the package 'PO_COMMUNICATION_PVT' but in my case i felt it would be bit difficult to find out regression scenarios where in all this change will cause issues. In order to avoid this issues there is another simple approach where in we can customise the standard views from which  XML data is being generated.

There are multiple views which are being used by this seeded program to generate the  data source namely PO_HEADER_XML, PO_RELEASE_XML and PO_LINES_XML etc.,

If we add any new column in these views select list we can certainly see them in XML output from there we can use them in our XSL template in order to display them in the final output.

while customising this view better approach would be use sub selects in the view select clause to get the new data or else you can create a custom function and call them in the view select clause.

I hope this would be helpful in customising this PO output for communication report. If any required please do comment.


Popular posts from this blog

Oracle APPS Useful Queries

Scripts For Oracle Quote and Order Relation

How to Apply Timers In Forms