Adding Custom XML Tech Brief
Adding Custom XML Tech Brief
This document was prepared to assist the customer in the use of Oracle HRMS. Its contents may not be used for any
other purpose without written permission. The material contained herein is supplied without representation or
warranty of any kind including any implied warranties or merchantability. Oracle Corporation assumes no
responsibility and shall have no liability of any kind from the supply or use of this document and the material it
contains.
This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the
information herein; these changes will be incorporated in new editions of the publication.
These are licensed materials for internal and customer use only, all rights reserved, including the right to photocopy,
reproduce, translate, or make other reproductions of this document or any part thereof.
All other products or company names are used for identification purposes only, and may be trademarks of their
respective owners.
Page 2
Using custom XML with Oracle US & Canadian Payroll Reports
Contents
Overview...................................................................................................................................................................... 4
Action Information Category ............................................................................................................................ 4
Document Type................................................................................................................................................. 6
Debugging .................................................................................................................................................................. 23
Appendix.................................................................................................................................................................... 24
Page 3
Using custom XML with Oracle US & Canadian Payroll Reports
Overview
Newer processes like Check/Cheque Writer (XML), Third Party Check/Cheque Writer (XML),
Deposit Advice (XML) and PDF Payslip for the US & Canadian Payroll localizations are
generated through the BI Publisher interface. The BI Publisher engine accepts an XML file along
with an RTF template as input parameters and produces a PDF document as output.
A majority of the data elements that may be required in the report/process are part of the generated
XML file. Further, customers can customize the seeded RTF templates to get the desired look-
and-feel of the report output. However, customers also require the ability to add additional or
custom data to these XML based reports in order to print data elements that are not delivered by
the product. This document focuses on how such customization of these US and Canadian Payroll
XML based reports can be achieved. This functionality is available in Release 12.1 HRMS
Release Update Pack (RUP) 6 and later, except for use with the PDF Payslip which was delivered
previously with Release 12.1.3.
First, it is important to understand Pay Action Information Categories that the Payroll Archive
uses to store the data as well as the Document Types that are associated with the aforementioned
US and Canadian XML based Payroll reports.
Page 4
Using custom XML with Oracle US & Canadian Payroll Reports
Page 5
Using custom XML with Oracle US & Canadian Payroll Reports
Document Type
Each report/process is classified with a document type name. The following table provides a list of
reports along with its document type.
REPORT DOCUMENT TYPE
Check Writer (XML)
ARCHIVE_CHEQUE_WRITER
Canadian Cheque Writer (XML)
Third Party Check Writer (XML)
THIRD_PARTY_CHEQUE_WRITER
Canadian Third Party Cheque Writer (XML)
Deposit Advice (XML)
Canadian Deposit Advice (XML) PAYSLIP
Payslip for both US and CA
Note: The PDF Payslip follows a different approach to add custom XML code unlike the other
reports. This will be explained later in the document.
Process Flow
The XML file is structured as a hierarchy of tags, which will hold data to be displayed on the
report output. The logic for retrieving additional data elements into XML needs to be defined by
the customer as mentioned below. Customizing the report involves the following steps:
Creating the custom XML code
Assigning the custom procedure to the corresponding lookup value
Creating the custom template with the required XML tags
Registering the custom template with the corresponding payroll report
Running the report using the custom template
The custom code should be written in a package procedure with the following input parameters, in
the same order, to fetch the additional data elements required for the report:
i. Action Context ID
ii. Action Information Category
iii. Document Type
Adding a new data element, ‘Consolidation Set’, to the Check Writer (XML) process is being
provided as an example throughout this document in order to explain the steps required to
customize the report or process.
Page 6
Using custom XML with Oracle US & Canadian Payroll Reports
The addition of this custom data (Consolidation Set) to the Check Writer (XML) report is written
in a new package PAY_CUSTOM_XML_RULES as shown below.
The procedure CUSTOM_XML has the code to fetch the Consolidation Set information and insert
it into the XML file. Let’s say the Consolidation Set needs to be added under Action Information
Category ‘Employee Details’.
Create the package body PAY_CUSTOM_XML_RULES as shown below and make sure the
newly created package compiles successfully. It is also recommended that you follow general
PL/SQL coding standards for your custom code. To disable this custom code, please refer to the
Debugging section.
Page 7
Using custom XML with Oracle US & Canadian Payroll Reports
Page 8
Using custom XML with Oracle US & Canadian Payroll Reports
First, filter the data based on the document type depending on which report the custom data needs
to be added to, and then filter it based on the action information category under which the custom
data needs to be added. Using the current example, since data needs to be added to the Check
Writer (XML) report output, p_document_type parameter ‘ARCHIVE_CHEQUE_WRITER’ was
used. (For other reports, use the applicable document type from the table listed in the
‘Introduction’ section). Further, to add custom data under the EMPLOYEE DETAILS
p_action_information_category, parameter ‘EMPLOYEE DETAILS’ is used. (For other
categories, use the applicable p_action_information_category as required).
For Third Party Check Writer (XML), the only valid context is ‘US THIRD PARTY CHECKS’.
For Canadian Third Party Cheque Writer (XML) the only valid context is ‘CA THIRD PARTY
CHEQUES’. Using corresponding document types and action information categories the same
package can also be used to add custom data to other reports.
Note: Take care if using the under-score character and/or caps while using the action information
category and document type.
Page 9
Using custom XML with Oracle US & Canadian Payroll Reports
Payroll Archiver
More Yes
archived
contexts
No
XML
PDF output
Page 10
Using custom XML with Oracle US & Canadian Payroll Reports
The custom procedure written in part 1 need to be defined in the lookup type
PAY_CUSTOM_XML_CODE in order to be available during processing. The reports and their
corresponding lookup codes are listed below.
Note: For the PDF payslip, the custom procedure in the format
<package_name>.<procedure_name>, needs to be defined in SelfService Preferences under the
Business Group Classification as follows:
a. Switch to the US Super HRMS Manager (or equivalent custom) responsibility.
b. Go to Work Structures Organization Description.
c. Query your Business Group.
d. Under Business Group Classification, select SelfService Preference.
e. Define the custom procedure in the field ‘XML Code’ (using the format
<package_name>.<procedure.name>).
See the Appendix for more information regarding the PDF payslip.
Page 11
Using custom XML with Oracle US & Canadian Payroll Reports
Again, using current example, since custom data needs to be added to the Check Writer (XML)
report, the custom procedure pay_custom_xml_rules.custom_xml is added to the lookup code
US_ARCHIVE_CHECK_XML as shown below.
Page 12
Using custom XML with Oracle US & Canadian Payroll Reports
The BI Publisher Builder Add On can be used to edit/create an RTF template with the required
tags. Download a copy of the seeded template, make the required changes and save it as a custom
template. (Be sure not to update the seeded template definition directly.)
Here in our example, since custom data is added under the tag
CUSTOM_CONSOLIDATION_DATA, the template needs to be modified as follows:
Page 13
Using custom XML with Oracle US & Canadian Payroll Reports
In the above sample custom RTF template, Employee Number has been replaced with
Consolidation Set. Since custom data is available with the tag CONSOLIDATION_SET, which is
under CUSTOM_CONSOLIDATION_DATA (at same level as Employee Number), the tag
<?EMPLOYEE_NUMBER?> is replaced with tag
<?CUSTOM_CONSOLIDATION_DATA/CONSOLIDATION_SET?>
Note: 1. Be cautious about the XML levels while creating the custom template.
2. Before using this template a sample PDF can be previewed using the BI Publisher
Builder by loading sample XML data.
Page 14
Using custom XML with Oracle US & Canadian Payroll Reports
In order to register the template, it is necessary to know the concurrent program short names and
data definition for each report. The following table provides the necessary information for each
report.
CONCURRENT
REPORT PROGRAM DATA DEFINITION
SHORT NAME
Check Writer (XML) PAYARCHCHQW Check Writer XML
Canadian Cheque Writer (XML) PAYCAARCHCHQW Canadian Cheque Writer XML
Third Party Check Writer (XML) PAYUSTPCHQW Third Party Check Writer XML
Canadian Third Party Cheque Canadian Third Party Cheque
PAYCATPCHQW
Writer (XML) Writer XML
Deposit Advice (XML) PYUSDEPADVXML Deposit Advice XML
Canadian Deposit Advice (XML) PYCADEPADVXML Deposit Advice XML for CA
Payslip for US US Payslip Data Definition
Payslip for CA Canada Payslip Data Definition
In order to find the seeded data definition for each report (other than the PDF payslip), perform
the following:
a. Switch to the XML Publisher Administrator responsibility.
b. Click on Data Definition.
c. Input the concurrent program short name in the Code field.
d. Click Go.
Page 15
Using custom XML with Oracle US & Canadian Payroll Reports
Sample lookup:
Page 17
Using custom XML with Oracle US & Canadian Payroll Reports
ii. Template Group: Select the template group created in the Step 2.
Example: Custom Template for Check Writer (XML)
e. Click on OK and submit the request.
Sample submission:
Once the process has successfully completed, the custom template will be available for selection
when submitting the applicable report.
Note: For PDF Payslip, Steps 2 and 3 are not required. Once the template has been created using
the XML Publisher Administrator responsibility as mentioned in Step 1 it will then be available
for selection in SelfService Preferences. Select the custom template in SelfService Preference
under the Business Group classification as outlined below and save.
See Appendix for more information about using custom templates with PDF Payslip.
Page 18
Using custom XML with Oracle US & Canadian Payroll Reports
So far, a custom procedure has been written and assigned to a corresponding lookup code, and a
custom template has been created to add the additional custom data that has been fetched through
the custom procedure. This template group has been created and registered with the corresponding
concurrent program so that it is now available for selection when submitting the report.
When submitting the report, select the template group from the list of values. (For PDF Payslip,
the template that is defined in SelfService Preferences will be used.)
Multiple custom templates can be created, grouped and registered with the corresponding report
so that they can be used to display the required additional custom data.
Page 19
Using custom XML with Oracle US & Canadian Payroll Reports
Sample Outputs
Snippet of the XML output from the Check Writer (XML) report using seeded report:
Page 20
Using custom XML with Oracle US & Canadian Payroll Reports
Page 21
Using custom XML with Oracle US & Canadian Payroll Reports
Sample of the Check Writer (XML) output using seeded XML data:
Sample of the Check Writer (XML) output using custom XML data:
Page 22
Using custom XML with Oracle US & Canadian Payroll Reports
Debugging
1. If the custom XML code is not being used when running the report, check the profile
option 'PAY: Disable Custom XML Code (Yes/No)'. It should be set to ‘No’ or left blank
in order for the custom code to work. Please note that if any issue is encountered in any
of the processes having custom code, then Oracle Support and/or Development will
require that you run the process by setting this profile option to ‘Yes’ in order to
determine if the process works without the custom code. Please note that issues with
custom code will not be supported by Oracle Support/Development.
a. Switch to the System Administrator responsibility.
b. Navigate to Profile System Common
c. Search for 'PAY: Disable Custom XML Code (Yes/No)' at site level.
d. Set to Yes/No as per the requirement. (The default is ‘no’.)
2. The following query should provide the correct custom XML procedure that has been
defined for the report. If not, check the applicable value in the lookup definition form.
SELECT description
FROM fnd_lookup_values
WHERE lookup_type = 'PAY_CUSTOM_XML_CODE'
AND language = 'US'
AND lookup_code = <lookup_code corresponding to the process>
3. If the custom XML data still doesn’t appear in the xml output, check that the correct
Document Type and Action Information Category were used (also pay attention to any
underscore characters and/or caps that may be used).
4. If the custom data that is produced in the XML output is incorrect, check the
functions/cursors/logic that has been used in the custom procedure to fetch the custom
data.
5. If custom data is produced in the XML output, but not in the PDF output, check the tags
that were used, the XML levels and the template that has been picked up by the process.
The PDF output can also be previewed using the applicable custom template after
loading a sample XML file to the BI Publisher Builder add on.
Page 23
Using custom XML with Oracle US & Canadian Payroll Reports
Appendix
Absence of this rule for your legislation will result in the Oracle Applications Framework (or HTML)
based payslip being generated. If Rule Mode is set to ‘OAF’ then Oracle Applications Framework based
payslip will be generated. Usage of the custom XML code and custom XML template are applicable only
for the PDF based payslip, which is only available in Release 12.1.3 and later.
2. Configure the Self Service Preferences available at the Business Group level. It comprises the following
segments:
a. Document Type – This specifies the type of document for which the following segments will be
configured. Payslip should be chosen from the list of values attached to this segment.
b. Online – Selecting Yes/No determines whether the online payslip is viewable by employees working
under the current business group.
c. Paper – This segment does not apply to the online payslip.
d. Template – Select the custom template to be used for formatting the online PDF payslip. You need to
register the custom template in 'BI Publisher Administrator' responsibility as highlighted above in
Section 4. The data definition used for payslip is '<legislation code> Payslip Data Definition'.
Note: Only Step 1 of Section 4 applies when registering the custom template for the online PDF
payslip; steps 2 and 3 of Section 4 are not required.
e. XML Code –If you wish to append the custom data to the existing XML output, you can create an
XML generation procedure and specify it in this segment in the format of
<package_name>.<procedure_name>.
f. Effective Date – This date provides a smooth migration to the PDF Payslip for the US and Canadian
localizations from the existing Oracle Applications Framework based online payslip architecture. All
payslips prior to this date will be displayed using the OAF architecture while PDF based payslip will
be generated for payslips effective on or after this date.
g. Payslip Employer Address – Select which Employer Address should be displayed on the payslip
(options are ‘GRE Address’ or ’HR Organization’ address). By default, the HR Organization address
is displayed.
h. Display Payslip GRE Addr From – If ‘GRE address’ is selected in the previous field, the GRE address
will be shown on the payslip after this date.
Page 24
Using custom XML with Oracle US & Canadian Payroll Reports
Note: The segments ‘Template’, ‘XML Code’ and ‘Effective Date’ are specific to PDF based payslip
(when the custom template and custom code are defined). The remaining fields are common to both
OAF and PDF (XML) based payslips.
The above PDF Payslip parameters can be overridden at Organization and Location levels. The precedence
goes to the lower level, meaning Location settings will override Organization and Business Group settings
and Organization will override Business Group settings. Defining Self Service Preferences at all three
levels is acceptable: e.g. Users may specify a custom template at Location level while specifying custom
XML Code at the Business Group level . The only constraint is that the custom template and effective date
must be specified in Self Service Preferences for at least one of the levels. Non-compliance of this
constraint will result in generation of the OAF payslip and not the PDF payslip.
3. After completing the above configuration, the custom payslip is now ready for viewing through Self
Service. The Online payslip is available through the Payslip function under the Employee Self-Service
responsibility. The Payslip from the most recent pay period is automatically displayed after clicking the
Payslip function. Users can choose other pay periods from the drop-down list available under the Choose
Payslip region.
The following matrix shows the application behaviour with respect to Template and Effective Date segments.
Entered Date Less than or equal to system date PDF payslip is generated
Page 25
Using custom XML with Oracle US & Canadian Payroll Reports
Important Note: Custom template and custom code are applicable only to the PDF payslip.
Page 26
Using custom XML with Oracle US & Canadian Payroll Reports
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
www.oracle.com
Page 27