Friday, February 6, 2015

Create a report and register it as Concurrent Program of type XML.

1.Create a table xx_emp_demo and insert two records into it.

create table xx_managers ( manager_no integer, manager_name varchar2(200) ) ;
insert into xx_managers ( manager_no, manager_name ) values ( 1000, 'Peter') ;
insert into xx_managers ( manager_no, manager_name ) values ( 1001, 'Martin') ;
commit; 


2.We will develop a Report that has all the columns from table emp.

Create a plain default Oracle Report using wizard in Oracle Reports.

This can be done using wizard with SQL “select * from emp”


Run and preview the report.

3.Add three user parameters P_CONC_REQUEST_ID,  P_RESPONSIBILITY_ID, P_USER_ID
Image
These parameters will make it possible to run a report as concurrent program.
Save the above RDF as XX_MANAGERS.rdf


4. FTP XX_MANAGERS.rdf  to $AR_TOP/reports/US
Silly it is, but for demo I will use standard Application [forgive me, but I am making it easier for you to run the source code].


5. Create Concurrent program executable for XMLP report, as if it is a normal report
Image

6. Create a concurrent program for the executable. Note that I have kept the shortname and the program name both as XX_MANAGERS.
IMPORTANT:- Note that format is XML.


Image

7. Register this program with Receivables request group.
DECLARE
BEGIN
FND_PROGRAM.add_to_group
    (
     PROGRAM_SHORT_NAME  =>'XX_MANAGERS'
    ,PROGRAM_APPLICATION =>'AR'
    ,REQUEST_GROUP       => 'Receivables All'
    ,GROUP_APPLICATION   =>'AR'
    ) ;    
  commit;
exception 
    when others then
           dbms_output.put_line('Object already exists'); 
END ;
/


8. Run the report and you will see an xml output appearing.
 Save the output as XX_MANAGERS_241106.xml on your computer. You will need to use menu /Tool/Copy to open this XML output in browser, and then save it as XX_MANAGERS_241106.xml on your PC.
Image


No comments: