Single Template with Multiple Layout change based on Parameter in Oracle

Single Template with Multiple Layout change based on Parameter in Oracle


CREATE OR REPLACE PROCEDURE APPS.XXSD_SINGLE_TEM_MULTI_LAYOUT  (
RETCODE OUT VARCHAR2,
ERRBUF OUT VARCHAR2,
P_DEPT_NO IN VARCHAR2 )
AS

CURSOR C1 IS

select * from SCOTT.EMP A where deptno = P_DEPT_NO;


BEGIN
 
      fnd_file.put_line (fnd_file.output, '<?xml version="1.0"?>');
      fnd_file.put_line (fnd_file.output, '<GL_HDR>');
      fnd_file.put_line (fnd_file.output,'<P_DEPT_NO>' || P_DEPT_NO || '</P_DEPT_NO>' );

      FOR I IN C1 LOOP
         fnd_file.put_line (fnd_file.output, '<G_LINES>');
         fnd_file.put_line (fnd_file.output,'<EMPNO>' || I.EMPNO || '</EMPNO>' );
         fnd_file.put_line (fnd_file.output,'<ENAME>' || I.ENAME || '</ENAME>' );
         fnd_file.put_line (fnd_file.output,'<JOB>' || I.JOB || '</JOB>' );
         fnd_file.put_line (fnd_file.output,'<MGR>' || I.MGR || '</MGR>' );
         fnd_file.put_line (fnd_file.output,'<HIREDATE>' || I.HIREDATE || '</HIREDATE>' );
         fnd_file.put_line (fnd_file.output,'<SAL>' || I.SAL || '</SAL>' );
         fnd_file.put_line (fnd_file.output,'<DEPTNO>' || I.DEPTNO || '</DEPTNO>' );
         fnd_file.put_line (fnd_file.output, '</G_LINES>');
      END LOOP;

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

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

END;


--=================================================

P_DEPT_NO
<?if: P_DEPT_NO = ’10’?>
Empno
Ename
Job
Mgr
Hiredate
Sal
Deptno
F EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
DEPTNO E
<?end if?> <?if: P_DEPT_NO = ’20’?>
Empno
Ename
Job
Mgr
Hiredate
Sal
Deptno
F EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
DEPTNO E
<?end if?> <?if: P_DEPT_NO = ’30’?>
Empno
Ename
Job
Mgr
Hiredate
Sal
Deptno
F EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
DEPTNO E
<?end if?> <?if: P_DEPT_NO = ’40’?>
Empno
Ename
Job
Mgr
Hiredate
Sal
Deptno
F EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
DEPTNO E
<?end if?>
--====================================================

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