0% found this document useful (0 votes)
14 views5 pages

BI Publisher Procedure Registration Steps

Uploaded by

kapilraghav1221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

BI Publisher Procedure Registration Steps

Uploaded by

kapilraghav1221
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Procedure Registration Steps

1. Create a Procedure using SQL Developer

CREATE OR REPLACE PROCEDURE XXCTS_EMPLOYEE(ERRBUF OUT VARCHAR2, RETCODE OUT


VARCHAR2)
-- errbuf : Error Messages, retcode : Status of procedure Execution
-- The retcode has three values returned by the concurrent manager
-- 0–Success
-- 1–Success & warning
-- 2–Error

is
cursor EMP_CUR
is
SELECT PERSON_ID, FULL_NAME, DATE_OF_BIRTH
from PER_ALL_PEOPLE_F
WHERE PERSON_ID BETWEEN 194 AND 198;

-- Declare a Record
-- Record is a collection of fields
-- Record can be declared on the basis of a table / cursor
-- Declaring a Record based on a Cursor
EMP_REC EMP_CUR%ROWTYPE;
-- emp_rec is the name of the record
-- emp_rec will hold person_id, full_name and date_of_birth

--Declaring variables for Error Code and Error Message


V_ERROR_CODE NUMBER;
V_ERR_MESSAGE VARCHAR2(200);

BEGIN
OPEN EMP_CUR; -- It will the execute the query , active set gets created and
-- it will point to the row above the first row
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
FND_FILE.PUT_LINE(fnd_file.output,'<EmployeeRoot>');
LOOP
-- Fetch fetches one row from the Active Set and stores
-- it into the record
FETCH EMP_CUR
INTO EMP_REC;

-- STOP WHEN THE Records present in the Active Set are processed.
EXIT WHEN EMP_CUR%NOTFOUND;
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<EMPLOYEE>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PERSON_ID>' || EMP_REC.PERSON_ID ||
'</PERSON_ID>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<FULL_NAME>' || EMP_REC.FULL_NAME ||
'</FULL_NAME>');
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<DATE_OF_BIRTH>'|| EMP_REC.DATE_OF_BIRTH ||
'</DATE_OF_BIRTH>');
FND_FILE.PUT_LINE(fnd_file.output,'</EMPLOYEE>');
END LOOP;
FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</EmployeeRoot>');
CLOSE EMP_CUR; -- Memory is released.

EXCEPTION
-- Generic Exception Handler
WHEN OTHERS THEN
V_ERROR_CODE := SQLCODE;
-- SQLCode is a function returns the error code
-- SQLERRM is a function which return the message associated with the Error
-- ORA-01476: divisor is equal to zero
-- SQLCode gives 01476
-- SQLERRM gives divisor is equal to zero
-- SUBSTR gives the Substring of length 200 characters
V_ERR_MESSAGE := SUBSTR(SQLERRM,1,200);
FND_FILE.PUT_LINE(FND_FILE.LOG, 'Error Code :' || V_ERROR_CODE);
FND_FILE.PUT_LINE(FND_FILE.LOG,'Error Message :' || V_ERR_MESSAGE);
end;

2. Create Concurrent Executable


Login to system Administrator Responsibility
Navigate to Concurrentà Programà Executable

Save
3. Create Concurrent Program
Login to system Administrator Responsibility
Navigate to Concurrentà Programà Define

Save
4. Attach the concurrent program to the Request Group
Login to system Administrator Responsibility
Securityà ResponsibilityàRequest
Press F11
Put Group Name : All Reports
Put Application : Purchasing
Press Ctrl + F11
Create one blank row by pressing the “+” button
Save

5. Switch the Responsibility by pressing the button


Click on ViewàRequests
Click on Submit a New Requestà Single Request
Put the Concurrent Program Name and click on Submit
Click on No
Click on Find and check the status of your Request
If the status is Completed, Normal, click on View Output button and see the XML File
If the status is Completed, Error, click on View Log button and see the Log File which has the reason for
the Error.

You might also like