Oracle EBS XML Publisher Data Template Generator (R12)
This generator writes an Oracle EBS R12 XML Publisher (BI Publisher) data template, the PL/SQL default package that holds its parameters and before-report trigger, and the registration steps that make it run as a concurrent program through XDODTEXE. Change the query, parameters and elements and every block updates.
Fill in
The value attribute must match a column alias in the SQL, in upper case.
1. Data template (XXPO_OPEN_PO.xml)
<?xml version="1.0" encoding="UTF-8"?>
<dataTemplate name="XXPO_OPEN_PO" description="Open approved purchase orders" defaultPackage="XXPO_OPEN_PO_PKG" version="1.0">
<parameters>
<parameter name="P_ORG_ID" dataType="number"/>
<parameter name="P_FROM_DATE" dataType="character"/>
</parameters>
<dataQuery>
<sqlStatement name="Q_MAIN">
<![CDATA[
SELECT poh.segment1 AS po_number,
sup.vendor_name AS supplier,
poh.creation_date AS po_date,
pol.line_num AS line_num,
pol.item_description AS item_description,
pol.quantity AS quantity,
pol.unit_price AS unit_price
FROM po_headers_all poh
JOIN po_lines_all pol ON pol.po_header_id = poh.po_header_id
JOIN ap_suppliers sup ON sup.vendor_id = poh.vendor_id
WHERE poh.org_id = :P_ORG_ID
AND poh.authorization_status = 'APPROVED'
AND NVL(poh.closed_code, 'OPEN') = 'OPEN'
AND poh.creation_date >= FND_DATE.CANONICAL_TO_DATE(:P_FROM_DATE)
ORDER BY poh.segment1, pol.line_num
]]>
</sqlStatement>
</dataQuery>
<dataTrigger name="beforeReport" source="XXPO_OPEN_PO_PKG.before_report"/>
<dataStructure>
<group name="G_PO_LINE" source="Q_MAIN">
<element name="PO_NUMBER" value="PO_NUMBER"/>
<element name="SUPPLIER" value="SUPPLIER"/>
<element name="PO_DATE" value="PO_DATE"/>
<element name="LINE_NUM" value="LINE_NUM"/>
<element name="ITEM_DESCRIPTION" value="ITEM_DESCRIPTION"/>
<element name="QUANTITY" value="QUANTITY"/>
<element name="UNIT_PRICE" value="UNIT_PRICE"/>
</group>
</dataStructure>
</dataTemplate>2. Default package (PL/SQL, run as APPS)
CREATE OR REPLACE PACKAGE XXPO_OPEN_PO_PKG AS
-- Global variables named exactly like the data template parameters
P_ORG_ID NUMBER;
P_FROM_DATE VARCHAR2(30);
FUNCTION before_report RETURN BOOLEAN;
END XXPO_OPEN_PO_PKG;
/
CREATE OR REPLACE PACKAGE BODY XXPO_OPEN_PO_PKG AS
FUNCTION before_report RETURN BOOLEAN IS
BEGIN
-- Example: set the operating unit context before the query runs
mo_global.set_policy_context('S', P_ORG_ID);
RETURN TRUE;
END before_report;
END XXPO_OPEN_PO_PKG;
/3. Registration steps
1. Concurrent program: Application Developer > Concurrent > Program. Short name XXPO_OPEN_PO, executable XDODTEXE (Data Template Executable, application XML Publisher, execution method Java Concurrent Program), output format XML. 2. Parameters: define P_ORG_ID and P_FROM_DATE with Token = P_ORG_ID and P_FROM_DATE. The token must equal the data template parameter name. For a date entered through FND_STANDARD_DATE, keep the dataType character and convert in SQL with FND_DATE.CANONICAL_TO_DATE. 3. Add the program to the request group of the responsibility that will run it. 4. XML Publisher Administrator > Data Definitions > Create: Code = XXPO_OPEN_PO (must equal the program short name), same application as the program. Upload XXPO_OPEN_PO.xml as the Data Template. 5. XML Publisher Administrator > Templates > Create: link to data definition XXPO_OPEN_PO, type RTF, upload the layout built in the Word Template Builder. 6. Run the program; the output post-processor merges the XML with the RTF.
4. Verify the registration
SELECT d.application_short_name, d.data_source_code, d.start_date FROM xdo_ds_definitions_b d WHERE d.data_source_code = 'XXPO_OPEN_PO'; SELECT t.template_code, t.template_type_code, t.default_language, t.start_date FROM xdo_templates_b t WHERE t.data_source_code = 'XXPO_OPEN_PO'; SELECT l.lob_code, l.lob_type, l.file_name, l.language, l.last_update_date FROM xdo_lobs l WHERE l.lob_code = 'XXPO_OPEN_PO';
Element and attribute names follow the Oracle XML Publisher data template schema for R12 (dataTemplate, parameters, dataQuery, sqlStatement, dataTrigger, dataStructure, group, element). Remove the dataTrigger line and the defaultPackage attribute if you do not need a trigger. Check the XDODTEXE executable definition and the XDO table columns on your instance before relying on block 4.
Get your data template reviewed
Send the template and the request log and we will point out the binding, date or context problem.
Optional. The tool and every export work without this. No spam.
How to use it
Start with the code, which must equal the concurrent program short name. Paste your SQL with bind variables named after the parameters (:P_ORG_ID), and list one element line per column alias in upper case. Save block 1 as an .xml file, compile block 2 as APPS, then follow block 3. To get sample XML for building the RTF layout, run the program once with output XML and no template, or open the XML from View Output, then load it into the Word Template Builder. The default query lists open approved purchase order lines from PO_HEADERS_ALL, PO_LINES_ALL and AP_SUPPLIERS so the template runs on Vision as a test.
- One sqlStatement can feed nested groups; add child groups inside the parent group for master-detail output.
- Keep element names stable once the RTF is built; the layout binds to them.
How the data template engine works
XDODTEXE is a seeded Java concurrent program executable that reads the data template registered against the program's data definition, binds the concurrent request parameters to the template parameters by name, fires triggers, executes the SQL and writes XML shaped by dataStructure. The beforeReport dataTrigger calls a PL/SQL function in the defaultPackage that must return BOOLEAN; returning FALSE stops the report. Parameters are passed to the package through global variables with the same names, which is why block 2 declares them in the package specification. Lexical parameters and afterReport triggers follow the same pattern.
Version differences and gotchas
The commonest failure is a token mismatch: if the concurrent program parameter token is not identical to the data template parameter name, the bind is null and the report returns no rows. The second is dates: concurrent manager passes dates from FND_STANDARD_DATE as canonical strings, so declare the parameter as character and convert with FND_DATE.CANONICAL_TO_DATE, as the default SQL does. A data definition code that differs from the program short name means the template is never found and you get raw XML. Element value attributes are matched to column aliases, so keep aliases upper case. Multi-org views or MO_GLOBAL context must be set in the trigger if the query uses secured synonyms.
How to check the result
Block 4 confirms the data definition, template and uploaded files exist in XDO_DS_DEFINITIONS_B, XDO_TEMPLATES_B and XDO_LOBS. If the request completes with a warning, open the request log: it lists the parameter values the request received, which shows a missing or mistyped value straight away; set the XML Publisher debug option if you also need the executed SQL. If the output post-processor fails, the XML output is still available from View Output, so you can test the RTF locally in Template Builder against that file.
Frequently Asked Questions
What is a data template in Oracle Apps R12?
It is an XML file that defines parameters, SQL queries, triggers and the output structure for an XML Publisher report. Registered against a data definition and run through the XDODTEXE executable, it replaces an Oracle Reports RDF as the data source, so the whole report is SQL plus an RTF layout without Reports Builder.
How do I create an XML Publisher report from a data template?
Create the concurrent program with executable XDODTEXE and output XML, add parameters whose tokens match the template parameters, create a data definition whose code equals the program short name and upload the data template, then create an RTF template against that data definition. Assign the program to a request group and run it.
How can I get sample XML for an Oracle EBS report?
Run the concurrent program with output format XML before any layout template is attached, then open View Output and save the XML. Load that file into the BI Publisher Template Builder for Word as sample data. The same XML is also retrievable as the request output file on the concurrent processing server.
Why does my data template report return no data?
Usually a parameter token does not match the data template parameter name, so the bind is null; or a date parameter arrives as a canonical string and fails conversion; or the operating unit context is not set for secured views. Check the request log for the parameter values, then fix the token, convert dates or set context in the beforeReport trigger.
If you would rather let users ask for this report in plain English and get it from EBS on your own servers, we can add that layer next to your existing XML Publisher reports.
Related Tools
Oracle EBS Concurrent Program Registration Request Template
A request form that captures everything an EBS developer needs to register a custom concurrent program: executable, execution method, parameters, request group and incompatibilities.
Developer ToolsOracle EBS Value Set, Lookup and DFF SQL Generator
Generate the queries that read value set definitions and values, rebuild a table-validated LOV, list FND lookup codes and map DFF segments to ATTRIBUTE columns.
OracleOracle EBS SQL for Concurrent Requests Generator
Build ready-to-run SQL for recent, running, pending and long-running concurrent requests from a few filter fields.
OracleOracle EBS Order-to-Cash (O2C) SQL Generator: Order to Delivery to Invoice to Receipt
Build a query that follows each Order Management line through Shipping, Receivables invoicing and cash application in Oracle EBS R12.
More Developer Tools tools
See all- Oracle EBS Onhand Quantity SQL Generator
- Oracle EBS BOM Explosion SQL Generator
- Oracle EBS Pending Transactions SQL Generator for Period Close
- Oracle EBS Public PL/SQL API Reference (OM, INV, PO, AP, AR, TCA, FND)
- Oracle EBS Forms Personalization Tables and Trigger Events Reference
- Oracle EBS Forms FRM Error Codes Reference (FRM-92101, FRM-40735)
- Oracle EBS XML Publisher RTF Template Syntax Reference
- Oracle EBS OE_ORDER_PUB.PROCESS_ORDER Script Generator
- Oracle EBS FND_REQUEST.SUBMIT_REQUEST Code Generator
Keep exploring
Free tools
- Oracle EBS XML Publisher RTF Template Syntax ReferenceSearchable list of the RTF template tags used in EBS XML Publisher (BI Publisher) reports, with examples for loops, grouping, conditions, date and number formatting, totals, variables and page layout.
- Oracle EBS FND_REQUEST.SUBMIT_REQUEST Code GeneratorFill in user, responsibility, program and arguments and get a PL/SQL block that submits a concurrent request from the database, optionally adds an XML Publisher layout and waits for completion.
- Oracle EBS PL/SQL Concurrent Program Generator (Package plus FND_PROGRAM Registration)Generates a PL/SQL concurrent program package (errbuf, retcode, date parameter, CSV output, error backtrace) and the FND_PROGRAM calls that register the executable, program, parameters, request group and incompatibility.
ERP fixes and how-tos
- Oracle EBS Standard Reports by Module and Sample XML for BI PublisherHow to find and run Oracle EBS standard reports by module, and how to get sample XML data to design a BI Publisher template for an EBS report.
- How to Create a BI Publisher Report in Oracle EBSBuild an Oracle EBS BI Publisher report end to end: write the data model, register the data definition, design the RTF template, and wire it to a concurrent program.
- How to set up BI Publisher output for a JD Edwards reportJDE BI means BI Publisher: how to attach an RTF template to a JD Edwards EnterpriseOne UBE version, what to configure first, and why it may print the old way.
Runs with your ERP
- BarTender and Oracle E-Business Suite: Label Printing from OracleHow BarTender prints labels from Oracle EBS using Oracle XML print requests and Integration Builder: methods, data flows, setup steps, pitfalls and AI help.
- Zebra Enterprise Connector with JD Edwards and Oracle EBS: XML to ZPL labelsHow Zebra's Enterprise Connector and XML-Direct Connect print barcode and RFID labels from Oracle EBS and JD Edwards by converting XML to ZPL: setup, pitfalls.
- Esker Order Management and Oracle E-Business SuiteHow Esker captures customer POs from email, fax and PDF and creates sales orders in Oracle EBS: integration, data flows, setup, pitfalls and a private AI layer.
AI on your ERP
- AI for Oracle E-Business Suite, Without Leaving On-PremHosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
- AI for Oracle EBS in Industrial Manufacturing: WIP, MRP, and BOM Questions Answered DirectlyAI for Oracle E-Business Suite in industrial manufacturing: WIP jobs, BOMs, MRP, inventory and purchasing answered in plain English, private and read-only.
Integrations
- How to use ChatGPT with Oracle E-Business SuiteUsing ChatGPT with Oracle E-Business Suite: export vs live access, custom GPT actions over ISG REST, enterprise data controls and when to keep data on-prem.
- How to connect Claude to Oracle E-Business SuiteConnect Claude to Oracle E-Business Suite via MCP, the Anthropic API, AWS Bedrock or Vertex, and know when an on-prem open-weight model is the better fit.