How To Create JAVA Concurrent Program


First of all ,create a sql query like following :-
select DISTINCT hou.NAME  C_PR_REQUESTER_DEPT ,
        TO_CHAR(PRHA.APPROVED_DATE,'DD/MON/YYYY') C_PR_RECEIVE_DATE,
        (prha.segment1||'//'||prla.LINE_NUM) C_PR_NUM_LINE_NO,
        prha.AUTHORIZATION_STATUS  C_STATUS,
         (select EMPLOYEE_NAME from po_action_history_v where object_id=PRHA.requisition_header_id and  SEQUENCE_NUM =
( select max(SEQUENCE_NUM) from po_action_history_v where object_id=PRHA.requisition_header_id))  C_LAST_ACTION_TAKEN_BY,
        pha.segment1 C_PO_NUMBER,
        TO_CHAR( PLLA.PROMISED_DATE,'DD/MON/YYYY') C_PROMISED_DATE ,
        plla.QUANTITY_RECEIVED C_QUANTITY_RECEIVED,
        pda.QUANTITY_DELIVERED C_QUANTITY_DELIVERED,
        pda.QUANTITY_ORDERED C_QUANTITY_ORDERED,
        rsh.RECEIPT_NUM  C_RECEIPT_NUM,
        tO_CHAR(pha.CREATION_DATE ,'DD/MON/YYYY')  C_PO_Date,
        pv.VENDOR_NAME C_SUPPLIER,
        prla.ITEM_DESCRIPTION C_ITEM_DESCRIPTION,
        p.full_name  C_Buyer_Name
from po_headers_all pha,
        po_lines_all pla,
        po_line_locations_all plla,
        po_requisition_headers_all prha,
        po_requisition_lines_all prla,
        po_req_distributions_all prda,
        po_distributions_all pda,
        rcv_transactions rt,
        rcv_shipment_headers rsh,
        HR_OPERATING_UNITS hou,
        PO_VENDORS pv,
        per_people_f p
where pha.po_header_id=pla.po_header_id
and pha.po_header_id=plla.po_header_id
and pla.po_line_id=plla.po_line_id
and prha.requisition_header_id=prla.requisition_header_id
and prla.requisition_line_id=prda.requisition_line_id
and pha.po_header_id=pda.po_header_id
and pda.req_distribution_id=prda.distribution_id
and pha.po_header_id=rt.po_header_id
and rt.shipment_header_id=rsh.shipment_header_id
and prla.org_id=hou.ORGANIZATION_ID
and pha.VENDOR_ID=pv.VENDOR_ID
and pha.AGENT_ID = P.PERSON_ID
and pha.segment1=:P_PO_NUM

Now insert this sql query in the xml tag file like,
<?xml version="1.0" encoding="UTF-8" ?>
<dataTemplate name="PO_DETAILS" description="po report uisng java conc" version="1.0">
                      <properties><property name="xml_tag_case" value="upper"/></properties>
            <parameters>
            <parameter name="P_PO_NUM"             dataType="varchar2"/>
            </parameters>                                                                                                                                           
     <dataQuery>
                     <sqlStatement name="Q_MAIN">
                        <![CDATA[
                                                                         
select DISTINCT hou.NAME  C_PR_REQUESTER_DEPT ,
        TO_CHAR(PRHA.APPROVED_DATE,'DD/MON/YYYY') C_PR_RECEIVE_DATE,
        (prha.segment1||'//'||prla.LINE_NUM) C_PR_NUM_LINE_NO,
        prha.AUTHORIZATION_STATUS  C_STATUS,
         (select EMPLOYEE_NAME from po_action_history_v where object_id=PRHA.requisition_header_id and  SEQUENCE_NUM =
( select max(SEQUENCE_NUM) from po_action_history_v where object_id=PRHA.requisition_header_id))  C_LAST_ACTION_TAKEN_BY,
        pha.segment1 C_PO_NUMBER,
        TO_CHAR( PLLA.PROMISED_DATE,'DD/MON/YYYY') C_PROMISED_DATE ,
        plla.QUANTITY_RECEIVED C_QUANTITY_RECEIVED,
        pda.QUANTITY_DELIVERED C_QUANTITY_DELIVERED,
        pda.QUANTITY_ORDERED C_QUANTITY_ORDERED,
        rsh.RECEIPT_NUM  C_RECEIPT_NUM,
        tO_CHAR(pha.CREATION_DATE ,'DD/MON/YYYY')  C_PO_Date,
        pv.VENDOR_NAME C_SUPPLIER,
        prla.ITEM_DESCRIPTION C_ITEM_DESCRIPTION,
        p.full_name  C_Buyer_Name
from po_headers_all pha,
        po_lines_all pla,
        po_line_locations_all plla,
        po_requisition_headers_all prha,
        po_requisition_lines_all prla,
        po_req_distributions_all prda,
        po_distributions_all pda,
        rcv_transactions rt,
        rcv_shipment_headers rsh,
        HR_OPERATING_UNITS hou,
        PO_VENDORS pv,
        per_people_f p
where pha.po_header_id=pla.po_header_id
and pha.po_header_id=plla.po_header_id
and pla.po_line_id=plla.po_line_id
and prha.requisition_header_id=prla.requisition_header_id
and prla.requisition_line_id=prda.requisition_line_id
and pha.po_header_id=pda.po_header_id
and pda.req_distribution_id=prda.distribution_id
and pha.po_header_id=rt.po_header_id
and rt.shipment_header_id=rsh.shipment_header_id
and prla.org_id=hou.ORGANIZATION_ID
and pha.VENDOR_ID=pv.VENDOR_ID
and pha.AGENT_ID = P.PERSON_ID
and pha.segment1=:P_PO_NUM

                        ]]>
       </sqlStatement>
                        </dataQuery>
                        <dataStructure>         
       <group name="G_HDR"  source="Q_MAIN">
         <element name="C_PR_REQUESTER_DEPT"              value="C_PR_REQUESTER_DEPT"           dataType="varchar2"/>
         <element name="C_PR_RECEIVE_DATE"                value="C_PR_RECEIVE_DATE"             dataType="varchar2"/>
         <element name="C_PR_NUM_LINE_NO"                 value="C_PR_NUM_LINE_NO"              dataType="varchar2"/>
                                                 <element name="C_STATUS"                         value="C_STATUS"                      dataType="varchar2"/>
                             <element name="C_LAST_ACTION_TAKEN_BY"           value="C_LAST_ACTION_TAKEN_BY"        dataType="varchar2"/>
                             <element name="C_PO_NUMBER"                      value="C_PO_NUMBER"                   dataType="varchar2"/>
                                                 <element name="C_PROMISED_DATE"                  value="C_PROMISED_DATE"               dataType="varchar2"/>
                                                 <element name="C_QUANTITY_RECEIVED"              value="C_QUANTITY_RECEIVED"           dataType="varchar2"/>
                       <element name="C_QUANTITY_DELIVERED"             value="C_QUANTITY_DELIVERED"          dataType="varchar2"/>
                             <element name="C_QUANTITY_ORDERED"               value="C_QUANTITY_ORDERED"            dataType="varchar2"/>
                                                 <element name="C_RECEIPT_NUM"                    value="C_RECEIPT_NUM"                 dataType="varchar2"/>
                                                 <element name="C_SUPPLIER"                       value="C_SUPPLIER"                    dataType="varchar2"/>
                                                 <element name="C_ITEM_DESCRIPTION"               value="C_ITEM_DESCRIPTION"            dataType="varchar2"/>
                                                 <element name="C_Buyer_Name"                     value="C_Buyer_Name"                  dataType="varchar2"/>
                                                                                               
     </group>
     </dataStructure>
</dataTemplate>
And save this as .xml file.
Now connect to the apps and switch the responsibility to SYSTEM ADMINISTRATOR
CONCURRENT->PROGRAM->DEFINE
(HERE WE DOES NOT NEED TO CREATE A EXECUTABLE FILE)
After creating concurrent program and defining parameter
Now, Switch the responsibility to xml publisher Administrator->Home->Data Definition
CREATE DATA DEFINITION
Now apply and pass the xml file at the data template
Now  we creating a data template and specifies the .rtf empty file. AND APPLY.

Now switch the responsibility to system administrator->security->responsibility->Request
Now add concurrent program to request group
Now switch the responsibility to Purchasing ,Vision Operation(USA)
Run the concurrent program
 
Now click on diagnostics button
Click on view xml then following xml will display
Save this file as a .xml file
Now load this generated xml file into empty provided .rtf file  .
Save this rtf.
Now attach this xml loaded rtf in data template in place of empty rtf.
Now search data template by either data template name or short name of concurrent program.
Now update
Now run concurrent program again
Now click on view output to see the output