How to create XML reports by using PLSQL Procedure with Examples

How to create XML reports by using PLSQL Procedure with Examples
--====================================================================

CREATE OR REPLACE PROCEDURE APPS.XXSD_RDF_TO_XML_PROC (
RETCODE OUT VARCHAR2,
ERRBUF OUT VARCHAR2,
P_VENDOR_TYPE IN VARCHAR2
 )
AS

--*==================================================+
--| PACKAGE XXSD_RDF_TO_XML_PROC
--+--------------------------------------------------------------------------+
--| DESCRIPTION This package is used to designed for xml  ( PROCEDURE base EXCEL REPORT)
--+--------------------------------------------------------------------------+
--| Author              | Date              | DESCRIPTION
--| MANOJ KUMAR | 31-JAN-2016 | FIRST AND FINAL Version
--+==================================================+

CURSOR C1 IS
SELECT SEGMENT1 VENDOR_CODE, VENDOR_NAME, VENDOR_TYPE_LOOKUP_CODE VENDOR_TYPE,START_DATE_ACTIVE 
FROM AP_SUPPLIERS
WHERE   VENDOR_TYPE_LOOKUP_CODE = P_VENDOR_TYPE;


   BEGIN
 
      fnd_file.put_line (fnd_file.output, '<?xml version="1.0"?>');
      fnd_file.put_line (fnd_file.output, '<RPT_HDR>');

      FOR I IN C1 LOOP
         fnd_file.put_line (fnd_file.output, '<RPT_LINES>');
         fnd_file.put_line (fnd_file.output,'<VENDOR_CODE>' || I.VENDOR_CODE || '</VENDOR_CODE>' );
         fnd_file.put_line (fnd_file.output,'<VENDOR_NAME>' || trim(REPLACE (I.VENDOR_NAME, '&', '&' || 'amp;')) || '</VENDOR_NAME>' );
         fnd_file.put_line (fnd_file.output,'<VENDOR_TYPE>' || I.VENDOR_TYPE || '</VENDOR_TYPE>' );
         fnd_file.put_line (fnd_file.output,'<START_DATE_ACTIVE>' || I.START_DATE_ACTIVE || '</START_DATE_ACTIVE>' );
         fnd_file.put_line (fnd_file.output, '</RPT_LINES>');
      END LOOP;

      fnd_file.put_line (fnd_file.output, '</RPT_HDR>');

   EXCEPTION WHEN OTHERS THEN fnd_file.put_line (fnd_file.LOG, 'Entered INTO exception' || SQLCODE || SQLERRM  );

END;
/


Comments

Popular posts from this blog

E-Text Report In Fusion | Types of E-Text reports

Supplier API's

How to pass default Parameter in cursor