Tuesday, 8 September 2015

XML Publisher Report creation with DATA Template

Step 1: Create the table and insert records in the table from which you want to print the data

CREATE TABLE APPS.EMP
  (
    EMPNO NUMBER(4) NOT NULL,
    ENAME VARCHAR2(10),
    JOB   VARCHAR2(9),
    MGR   NUMBER(4),
    HIREDATE DATE,
    SAL    NUMBER(7, 2),
    COMM   NUMBER(7, 2),
    DEPTNO NUMBER(2)
  );

INSERT INTO APPS.EMP VALUES(7369, 'SMITH', 'CLERK', 7902,TO_DATE('17-DEC-1980', 'DD-MON-YYYY'), 800, NULL, 20);
INSERT INTO APPS.EMP VALUES(7499, 'ALLEN', 'SALESMAN', 7698,TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30);
INSERT INTO APPS.EMP VALUES(7521, 'WARD', 'SALESMAN', 7698,TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30);
INSERT INTO APPS.EMP VALUES(7566, 'JONES', 'MANAGER', 7839,TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20);
INSERT INTO APPS.EMP VALUES(7654, 'MARTIN', 'SALESMAN', 7698,TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30);
INSERT INTO APPS.EMP VALUES(7698, 'BLAKE', 'MANAGER', 7839,TO_DATE('1-MAY-1981', 'DD-MON-YYYY'), 2850, NULL, 30);
INSERT INTO APPS.EMP VALUES(7782, 'CLARK', 'MANAGER', 7839,TO_DATE('9-JUN-1981', 'DD-MON-YYYY'), 2450, NULL, 10);

Step 2: Create the data definition template

<dataTemplate name="Purchase_Order" description="template description" version="1.1">
        <parameters>
               <parameter name="dept_no" datatype="number"/>
        </parameters>
        <dataQuery>
<sqlStatement name="a"><![CDATA[select empno,ename,job,mgr,hiredate,sal,comm,deptno    from emp where deptno=nvl(:dept_no,deptno)]]>
</sqlStatement>
          </dataQuery>

         <dataStructure>
               <group name="new" source="a">
                                <element name="Employee_NUMBER" value="empno"/>
                                <element name="EMPLOYEE_NAME" value="ename"/>
                                <element name="JOB" value="job"/>
                                <element name="MGR" value="mgr"/>
                                <element name="HIREDATE" value="hiredate"/>
                                <element name="SALARY" value="sal"/>
                                <element name="COMMISION" value="comm"/>
                                <element name="DEPT_NO" value="deptno"/>
                </group>
         </dataStructure>
</dataTemplate>


Save the file with name emp.xml

Step 3: Create data definition in xml publisher and attach the data definition template to the data definition
Navigation: XML Publisher Administrator -> Data Definitions -> Create Data Definition






Step 4: Create Concurrent Program to generate the Data XML output. 

Navigation: System Administrator-> Concurrent-> Program->Define



Step 5: Assignment of concurrent program to responsibility

Navigation: System Administrator-> Security-> Responsibility->Request


Step 6: Execute the concurrent program

Navigation: Application Developer-> Concurrent-> Submit a New Request->Single Request



Output will come like this .click on page source and save the page as EMP_Data.xml


Step 7: Creation of RTF Template
             Prerequisite: You have to install XMLP Template Builder

 a) Open Microsoft-word file.
 b) Click on Add-Ins and then Load XML Data. Give the path of EMP_Data.xml file.







Save the file as EMP_Template.rtf

Note :The designing of the report we are doing in this section.

Step 8: Registering the RTF Template

Navigation: XML Publisher Administrator -> Template -> Create Template


Note: The output format of the report we can change in default output type section.It may be in excel,html, pdf, rtf.

Step 9: Repeat Step 4 again and see the output


KEY FLEX FIELDS (KFF) Query

Query :


select  FIF.APPLICATION_ID  ,
        FIF.ID_FLEX_CODE    ,
        FIF.ID_FLEX_NAME    ,
        FIF.APPLICATION_TABLE_NAME ,
        FIF.DESCRIPTION     ,
        FIFS.ID_FLEX_NUM    ,
        FIFS.ID_FLEX_STRUCTURE_CODE  ,
        FIFSE.SEGMENT_NAME,
        FIFSE.SEGMENT_NUM,
        FIFSE.FLEX_VALUE_SET_ID
from    FND_ID_FLEXS FIF    ,
        FND_ID_FLEX_STRUCTURES FIFS ,
        FND_ID_FLEX_SEGMENTS FIFSE
where   FIF.APPLICATION_ID = FIFS.APPLICATION_ID
and     FIF.ID_FLEX_CODE   = FIFS.ID_FLEX_CODE
and     FIFSE.APPLICATION_ID = FIF.APPLICATION_ID
and     FIFSE.ID_FLEX_CODE = FIF.ID_FLEX_CODE
and     FIFSE.ID_FLEX_NUM = FIFS.ID_FLEX_NUM
and     FIF.ID_FLEX_CODE LIKE 'GL#'
and     FIF.ID_FLEX_NAME LIKE 'Accounting Flexfield';

Enable DFF on Customer form and segments


1. First find the DFF that is attached to the Customer form.

Application Developer > Flexfield > Descriptive > Register
Query for Table Name: HZ_CUST_ACCOUNTS
Make a note of Title. This is the DFF that is attached to the Customer form.

2.  Application Developer > Flexfield > Descriptive > Segments
Query for Title: Customer Information > Uncheck Freeze Flexfield Definition > Save
3. Click on Segments to add new field(s) and to map with ATTRIBUTE column(s)
Here i have added  'My Field' > Finally Save
4. check Freeze Flexfield Definition [Reversal of Step-2]

5. Open Customer form to see the DFF fields added.
Receivables Manager > Customers > Customers
In the Simple Search, Select Customer Name > Go

At the Header level click on Details

Now you can see the field (DFF) we have just added at the Header level!

FNDLOADS

  • Messages:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct
XX_MESSAGE_NAME.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME=’ICX’ MESSAGE_NAME=’XX_MESSAGE_NAME’
Or can download all the messages within an application
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct
XX_MESSAGE_NAME.ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME=’ICX’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct XX_MESSAGE_NAME.ldt
  • Lookups:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_LKP_NAME.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME=’ICX’ LOOKUP_TYPE=’XX_LKP_NAME’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct XX_LKP_NAME.ldt
  • Value Set:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_VALUE_SET_NAME.ldt VALUE_SET FLEX_VALUE_SET_NAME=’XX_VALUE_SET_NAME’
If value set has values then,
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XX_VALUE_SET_NAME.ldtVALUE_SET_VALUE FLEX_VALUE_SET_NAME=’XX_VALUE_SET_NAME’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct XX_VALUE_SET_NAME.ldt
  • Form Function:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_FORM_FUNCTION_NAME.ldtFUNCTION FUNCTION_NAME=’XX_FORM_FUNCTION_NAME’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_FORM_FUNCTION_NAME.ldt
  • Menu:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XX_MENU_NAME.ldt MENU MENU_NAME=’XX_MENU_NAME’
—–UPLOAD——-
FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afsload.lct XX_MENU_NAME.ldt
  • Responsibility:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XX_RESP_KEY.ldtFND_RESPONSIBILITY RESP_KEY=’XX_RESP_KEY’
—–UPLOAD——-
FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_RESP_KEY.ldt
  • Profile Option Definition:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XX_PROFILE_NAME.ldt PROFILE PROFILE_NAME=’XX_PROFILE_NAME’ APPLICATION_SHORT_NAME=’ICX’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XX_PROFILE_NAME.ldt
  • Request Group:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct XX_REPORT_GROUP_NAME.ldtREQUEST_GROUP REQUEST_GROUP_NAME=’XX_REPORT_GROUP_NAME’ APPLICATION_SHORT_NAME=’PO’
—–UPLOAD——-
FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct XX_REPORT_GROUP_NAME.ldt
  • Concurrent program:
—–DOWNLOAD—–
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_PRG_NAME.ldt PROGRAM APPLICATION_SHORT_NAME=’PO’ CONCURRENT_PROGRAM_NAME=’XX_CONC_PRG_NAME’
—–UPLOAD——-
FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CONC_PRG_NAME.ldt
  • Request Sets:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_REQ_SET_NAME.ldt REQ_SET REQUEST_SET_NAME=’XX_REQ_SET_NAME’
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_REQ_SET_NAME_LINK.ldtREQ_SET_LINKS REQUEST_SET_NAME=’XX_REQ_SET_NAME’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_REQ_SET_NAME.ldt
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_REQ_SET_NAME_LINK.ldt
  • Alert:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XX_ALERT_NAME.ldt ALR_ALERTS APPLICATION_SHORT_NAME=’PO’ ALERT_NAME=’XX_ALERT_NAME’
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct XX_ALERT_NAME.ldt CUSTOM_MODE=FORCE
  • Folders:
—–DOWNLOAD—–
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/fndfold.lct XX_FOLDER_NAME.ldt FND_FOLDERS NAME=’XX_FOLDER_NAME’
Or can download all the folders
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/fndfold.lct XX_ALL_FOLDER.ldt FND_FOLDERS
—–UPLOAD——-
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/fndfold.lct XX_FOLDER_NAME.ldtCUSTOM_MODE=FORCE