Pages

OracleEBSpro is purely for knowledge sharing and learning purpose, with the main focus on Oracle E-Business Suite Product and other related Oracle Technologies.

I'm NOT responsible for any damages in whatever form caused by the usage of the content of this blog.

I share my Oracle knowledge through this blog. All my posts in this blog are based on my experience, reading oracle websites, books, forums and other blogs. I invite people to read and suggest ways to improve this blog.


Thursday, May 17, 2018

Format Customization in Oracle Payments using Extensibility Utility Package

From Oracle Accounts Payable, user submits the invoices to Oracle Payments as a Payment Process Request. Oracle Payments uses the invoice information submitted in the Payment Request to create Documents Payable and then groups them into Payments and Payment Instructions for processing payments. This processed information is then recorded in the database tables. The processed payment information is retrieved by Oracle Payments database views to generate the XML extract. The generated XML extract is used in conjunction with the RTF/ETEXT template by Business Intelligence Publisher to generate output.
Oracle Payments provides the IBY_FD_EXTRACT_EXT_PUB extensibility package to construct custom XML element structure that can be added to the payment XML extract generated by Oracle Payments. The package specification and body definition can be found in files ibyfdxes.pls and ibyfdxeb.pls respectively. These files are located in the $IBY_TOP/patch/115/sql directory. 
The package allows custom elements to be created at following levels.
  • Instruction
  • Payment
  • Document Payable
  • Document Payable Line
  • Payment Process Request
You cannot customize the package specification, but package body contains stubbed functions that you can customize. 
The five functions are as follows:
FUNCTION Get_Ins_Ext_Agg(p_payment_instruction_id IN NUMBER) RETURN XMLTYPE
This function allows XML element to be introduced at instruction level and run only once for the instruction.
FUNCTION Get_Pmt_Ext_Agg(p_payment_id IN NUMBER) RETURN XMLTYPE
This function allows XML element to be introduced at payment level and run once for each payment in the instruction.
FUNCTION Get_Doc_Ext_Agg(p_document_payable_id IN NUMBER) RETURN XMLTYPE
This function allows XML element to be introduced at document payable level and run once for each document payable in the instruction.
FUNCTION Get_Docline_Ext_Agg(p_document_payable_id IN NUMBER, p_line_number IN NUMBER) RETURN XMLTYPE
This function allows XML element to be introduced at document payable line level and run once for each document payable line in the instruction.
FUNCTION Get_Ppr_Ext_Agg(p_payment_service_request_id IN NUMBER) RETURN XMLTYPE
This function allows XML element to be introduced at document payable level and run once for each payment process request. 
The following table lists the functions you need to modify to add additional tags to each level of the XML file:

ML File Level
IBY_FD_EXTRACT_EXT_PUB Function To Modify
Example of Parameter Usage
OutboundPaymentInstruction
Get_Ins_Ext_Agg(p_payment_instruction_id IN NUMBER)
SELECT *
FROM iby_pay_instructions_all
WHERE payment_instruction_id = p_payment_instruction_id;
OutboundPayment
Get_Pmt_Ext_Agg(p_payment_id IN NUMBER)
SELECT *
FROM iby_payments_all ipa
WHERE ipa.payment_id = p_payment_id;
DocumentPayable
Get_Doc_Ext_Agg(p_document_payable_id IN NUMBER)
SELECT *
FROM iby_docs_payable_all dp WHERE dp.document_payable_id = P_document_payable_id;
DocumentPayableLine
Get_Docline_Ext_Agg(p_document_payable_id IN NUMBER, p_line_number IN NUMBER)
PaymentProcessProfile
Get_Ppr_Ext_Agg(p_payment_service_request_id IN NUMBER)
SELECT *
FROM iby_pay_service_requests WHERE payment_service_request_id = p_payment_service_request_id;


First determine which function within IBY_FD_EXTRACT_EXT_PUB should be modified. Then write a PL/SQL block similar to the structure given below into the package body function definition, replacing the lines “BEGIN” and “RETURN NULL”, and retaining all other lines:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<local_xml_variable>  XMLTYPE;
  CURSOR <cursor_name> (<cursor_parameter_name> IN NUMBER) IS
  SELECT XMLConcat(
           XMLElement("Extend",
             XMLElement("Name", '<xml_tag_name1>'),
             XMLElement("Value", <xml_tag_value2>)),
           XMLElement("Extend",
             XMLElement("Name", '<xml_tag_name2>'),
             XMLElement("Value", < xml_tag_value2>))
         )
   FROM <data_table_name>
 WHERE <table_identifier_column> = <cursor_parameter_name>;
BEGIN
  OPEN <cursor_name> (<function_parameter_name>);
  FETCH <cursor_name> INTO <local_xml_variable>;
  CLOSE <cursor_name>;
  RETURN <local_xml_variable>;
A sample xml file with extended tags will look like:
Then modify the eText template using the new custom elements. Use the following syntax to select the appropriate Name/Value pair.
…/Extend[Name='<xml_tag_name1>’]/Value
You can use BI Publisher Template Viewer to view the final eText Outputs.

References:
https://imdjkoch.wordpress.com/tag/iby_fd_extract_ext_pub/