Monday, 26 February 2018

L GENERATION STEPS FOR EXISTING oracle .rdf with oracle reports developer


 

XML GENERATION STEPS FOR EXISTING oracle .rdf reports (Which are not having xml)

Query the existing oracle reports  in system administrator Responsibility.

Concurrent è Program  è Defineè Press F11è Query the Report  


Concurrent è Program  è Defineè Press F11è Query the Report è Change the Out Put Format To XML. And save it.


 Run the report to generate XML. After Completion  of report go to from SRS window  Click On Diagnostics è View XML (For gathering the XML)



 

Save the XML with extension *.xml. (Use this  XML for creating RTF in BI Publisher )


 

 

Open M.S. Word Application for creating RTF In BI Publisher  Add-Ins  Tool


From the Data Men, Load the Xml Data which is saved on specific Location by existing Oracle Report created by you.

 

It will shows  that the data loaded successfully like following image.


 

Click on Insert menu èField Select appropriate one like following



Finally design the rtf as per your requirement and designing skil.


 

 

First create Data Definition in XML Publisher Administration Responsibility.

 Give the name of data definition sets(as per requirement)

Give the Code (it must be the same as Executable name of report )

Give the Application name as per

Give the Description if necessary

.

Second create the template in xml publisher administrator responsibility

Name as per your requirement

Code should match with data definition code

Application as per report

Data Definition – As u created in 1st step.

Type – RTF

Default Out Put type == Excel, rtf.pdf.html (as per your requirement)

Description – If anything necessary as per your requirement.

Template File  - Attach the RTF created in BI Publisheer.

Select the Language       - English           

Territory – Your country

Translatable – Enable


 

 

 

Monday, 7 August 2017

API Script to Cancel AP Invoices (Cancel AP Invoice API )




API Script to Cancel AP Invoices (Cancel AP Invoice API )


/* Formatted on 2017/07/08 18:15 (Formatter Plus v4.8.0) */
CREATE OR REPLACE PROCEDURE cancel_invoices (ip_operating_unit IN VARCHAR2)
AS
 l_resp_id NUMBER;
 l_appl_id NUMBER;
 l_user_id NUMBER := apps.fnd_global.user_id;
 l_org_id NUMBER := apps.fnd_global.org_id;
 l_message_name VARCHAR2 (1000);
 l_invoice_amount NUMBER;
 l_base_amount NUMBER;
 l_tax_amount NUMBER;
 l_temp_cancelled_amount NUMBER;
 l_cancelled_by VARCHAR2 (1000);
 l_cancelled_amount NUMBER;
 l_cancelled_date DATE;
 l_last_update_date DATE;
 l_original_prepayment_amount NUMBER;
 l_pay_curr_invoice_amount NUMBER;
 l_token VARCHAR2 (100);
 l_boolean BOOLEAN;
 err_msg VARCHAR2 (2000);

 CURSOR invoice_cur
 IS
 SELECT aia.invoice_id, aia.last_updated_by, aia.last_update_login,
 aia.gl_date, aia.invoice_num
 FROM xx_ap_invoices_conv_stg a,
 ap_invoices_all aia,
 ap_invoice_lines_all aila
 WHERE a.ls_inv_num = aia.invoice_num
 AND a.ls_org_id = aia.org_id
 AND aia.invoice_id = aila.invoice_id
 AND aia.org_id = aila.org_id
 AND aia.payment_status_flag = 'N'
 AND NVL (aila.cancelled_flag, 'N') <> 'Y';
--- AND aia.invoice_num = '65431';
BEGIN
 BEGIN
 SELECT DISTINCT fr.responsibility_id, frx.application_id
 INTO l_resp_id, l_appl_id
 FROM apps.fnd_responsibility frx,
 apps.fnd_responsibility_tl fr
 WHERE fr.responsibility_id = frx.responsibility_id
 AND UPPER (fr.responsibility_name) LIKE
 UPPER (DECODE (ip_operating_unit,
 'OU USA MA', 'Payables Manager',
 'OU USA WI', 'OU USA WI_Payables Manager',
 'OU Austria', 'OU AUSTRIA_Payables Manager',
 'OU China', 'OU CHINA_Payables Manager'
 )
 );

 DBMS_OUTPUT.put_line ('l_resp_id => ' || l_resp_id);
 DBMS_OUTPUT.put_line ('l_appl_id => ' || l_appl_id);
 EXCEPTION
 WHEN OTHERS
 THEN
 err_msg :=
 'Error Occured while Deriving responsibility id' || SQLERRM;
 apps.fnd_file.put_line
 (apps.fnd_file.output,
 'Error Occured while Deriving responsibility id'
 );
 END;

 mo_global.set_policy_context ('S', l_org_id);
 apps.fnd_global.apps_initialize (l_user_id, l_resp_id, l_appl_id);

 FOR l_inv_rec IN invoice_cur ----(l_org_id)
 LOOP
 DBMS_OUTPUT.put_line
 ( 'Calling API ap_cancel_pkg.ap_cancel_single_invoice to Cancel Invoice: '
 || l_inv_rec.invoice_num
 );
 DBMS_OUTPUT.put_line
 ('**************************************************************');
 l_boolean :=
 ap_cancel_pkg.ap_cancel_single_invoice
 (p_invoice_id => l_inv_rec.invoice_id,
 p_last_updated_by => l_inv_rec.last_updated_by,
 p_last_update_login => l_inv_rec.last_update_login,
 p_accounting_date => l_inv_rec.gl_date,
 p_message_name => l_message_name,
 p_invoice_amount => l_invoice_amount,
 p_base_amount => l_base_amount,
 p_temp_cancelled_amount => l_temp_cancelled_amount,
 p_cancelled_by => l_cancelled_by,
 p_cancelled_amount => l_cancelled_amount,
 p_cancelled_date => l_cancelled_date,
 p_last_update_date => l_last_update_date,
 p_original_prepayment_amount => l_original_prepayment_amount,
 p_pay_curr_invoice_amount => l_pay_curr_invoice_amount,
 p_token => l_token,
 p_calling_sequence => NULL
 );
 DBMS_OUTPUT.put_line ('l_message_name => ' || l_message_name);
 DBMS_OUTPUT.put_line ('l_invoice_amount => ' || l_invoice_amount);
 DBMS_OUTPUT.put_line ('l_base_amount => ' || l_base_amount);
 DBMS_OUTPUT.put_line ('l_tax_amount => ' || l_tax_amount);
 DBMS_OUTPUT.put_line ( 'l_temp_cancelled_amount => '
 || l_temp_cancelled_amount
 );
 DBMS_OUTPUT.put_line ('l_cancelled_by => ' || l_cancelled_by);
 DBMS_OUTPUT.put_line ('l_cancelled_amount => ' || l_cancelled_amount);
 DBMS_OUTPUT.put_line ('l_cancelled_date => ' || l_cancelled_date);
 DBMS_OUTPUT.put_line ('P_last_update_date => ' || l_last_update_date);
 DBMS_OUTPUT.put_line ( 'P_original_prepayment_amount => '
 || l_original_prepayment_amount
 );
 DBMS_OUTPUT.put_line ( 'l_pay_curr_invoice_amount => '
 || l_pay_curr_invoice_amount
 );

 IF l_boolean
 THEN
 DBMS_OUTPUT.put_line ( 'Successfully Cancelled the Invoice => '
 || l_inv_rec.invoice_num
 );
 COMMIT;
 ELSE
 DBMS_OUTPUT.put_line ( 'Failed to Cancel the Invoice => '
 || l_inv_rec.invoice_num
 );
 ROLLBACK;
 END IF;
 END LOOP;
END cancel_invoices;