- OracleApps Epicenter - http://www.oracleappshub.com -

Oracle API Availability – Concurrent Program

Posted By Sanjit Anand On August 7, 2007 @ 6:53 am In API Integration | 6 Comments

Many times, we need to submit concurrent requests and request sets from non SRS window like operating system or PL/sql . In Oracle Applications there are API’s to take these options. Here are some of the API's function and usage..

  • FND_REQUEST
    • This API is used Submit concurrent requests from backend. As we know there are couple of options avaible in oracle application to submit a concurrent requset like SRS, CONSCUB and FND's API. This is API offers some great functionality to use via PL/sql or any other technology like , Host Program or java program.
  • FND_CONCURRENT
    • Retrieve information about concurrent requests
    • Set information about concurrent requests
  • Set_Options ·
    • This is a function of boolen type
    • Set request options
    • This is Call before submitting the request

usage:

FND_REQUEST.SET_OPTIONS(IMPLICIT = > 'ERROR');

  • Set_Repeat_Options ·
    • Function, returns TRUE or FALSE
    • Set repeat options
    • Call before submitting the request
  • Set_Print_Options ·
    • Function, returns TRUE or FALSE
    • Set print options (note, some options can not be over-ridden)
    • Call before submitting the request

Called before submitting request if the printing of output has to be controlled with specific printer/style/copies etc., Optionally call for each program in the request set.

Usage :

fnd_submit.set_print_options(NULL,NULL,NULL,TRUE,'N');

or

  • fnd_request.set_print_options (printer =>'<printer name>',
    style =>'LANDSCAPE',
    copies=>1,
    save_output => TRUE,
    print_together => 'N')
  • Add_printer
    • Called after set print options to add a printer to the print list.Optionally call for each program in the request set.
    • Returns TRUE on successful completion, and FALSE otherwise

Usage

Function FND_SUBMIT.ADD_PRINTER (printer =>'Printer Name',
copies => null) ;

  • Submit_Request
    • Function, returns Request Id or 0·
    • If submitting from a form, all Arguments must be specified
  • Set_Mode (server only)
    • Function, returns TRUE or FALSE
    • Must use if request is submitted from a database trigger.
    • Call before submitting the request
    • Failure in the database trigger call of FND_SUBMIT.SUBMIT_SET does not rollback changes
  • Get_Request_Status
    • Function returns TRUE or FALSE
    • Returns status information in function output parameters
  • Wait_For_Request

When submitting concurrent requests using PL/SQL, it is often desired to have the parent process wait until all the child processes have completed before completing itself.

This function Wait for the request completion, then return the request phase/status and completion message to the caller. Also call sleep between database checks.

  • Function, returns TRUE or FALSE
  • Returns status information in function output parameters

FUNCTION WAIT_FOR_REQUEST (request_id IN number default NULL,
interval IN number default 60,
max_wait IN number default 0,
phase OUT varchar2,
status OUT varchar2,
dev_phase OUT varchar2,
dev_status OUT varchar2,
message OUT varchar2) return Boolean;

This API Wait for the request completion, then return the request phase/status and completion message to the caller. Also call sleep between database checks.

  • Arguments (input)
    • request_id :The request ID of the program to wait on.
    • interval :Time to wait between checks. This is the number of seconds to sleep. The default is 60 seconds.
    • max_wait :The maximum time in seconds to wait for the requests completion.
  • Arguments (output) :
    • phase :The user friendly request phase from FND_LOOKUPS.
    • status :The user friendly request status from FND_LOOKUPS.
    • dev_phase :The request phase as a constant string that can be used for program logic comparisons.
    • dev_status :The request status as a constant string that can be used for program logic comparisons.
    • message :The completion message supplied if the request has completed.

Usage

IF request_id = 0 THEN
fnd_file.put_line(fnd_file.log, 'Request Not Submitted.');
ELSE

call_status := fnd_concurrent.wait_for_request(request_id, v_interval, v_max_wait, request_phase, request_status, dev_request_phase, dev_request_status, request_status_mesg);

END IF;

IF call_status = TRUE THEN
IF dev_request_phase!= 'Completed' OR
dev_request_status IN ('Cancelled','Error','Terminated') THEN
DBMS_OUTPUT.PUT_LINE('STATUS=JOB FAILED');
END IF;
ELSE
DBMS_OUTPUT.PUT_LINE('WAIT FOR REQUEST FAILED - STATUS UNKNOWN');
DBMS_OUTPUT.PUT_LINE('STATUS=JOB FAILED');
END IF;

  • Set_Complete_Status (server only)
    • Function, returns TRUE or FALSE
    • Called from a concurrent program to set its own completion status
    • These have three status
      • NORMAL
      • WARNING
      • ERROR
  • Add_notification
    • Called before submission to add a user to the notify list.
    • Optionally call for each program in the reques set.
    • ReturnsTRUE on sucessful completion, and FALSE otherwise.

Usage
FND_SUBMIT.ADD_NOTIFICATION (user ==>'ANAND') ;

Make sure the name should be from fnd_user table

  • SET_NLS_OPTIONS
    • Called before submitting request to set request attributes.
    • Optionally call for each program in the request set.
    • Returns TRUE on successful completion, and FALSE otherwise.

Usage
FND_SUBMIT.SET_NLS_OPTIONS (language =>'US',
territory => NULL);


6 Comments (Open | Close)

6 Comments To "Oracle API Availability – Concurrent Program"

#1 Comment By krishnab On August 28, 2007 @ 3:10 am

In Oracle Apps Some tables ends with TL,VL,what is the significance of the TL and VL?

#2 Comment By krishnab On August 28, 2007 @ 3:11 am

What will happen If I am not giveing the Suspense accout while defineing the Set of Books in GL?

#3 Comment By krishnab On August 28, 2007 @ 3:11 am

What is the Use of User Exit in Oracle apps and when we are developeing the new report you need to pass one parameter called P_CONC_REQUEST_ID,what is the use of this parameter and is it mandatory.Can’t we develop report without this User exit’s and P_CONC_REQUEST_ID parameter

#4 Comment By krishnab On August 28, 2007 @ 3:13 am

How You Will display the key flexifields in your report?

#5 Comment By krishnab On August 28, 2007 @ 3:13 am

How you will Diaplay the Company LOGO In report.Can anyone knows please give solution?

#6 Comment By Gowri On April 7, 2008 @ 7:47 am

This is a very useful site. I have a question about concurrent request api’s discussed here. How we can specify the api engine to take parameters from their default value settings instead of supplying while submmitting the FND_Request.submit.

Thanks


Article printed from OracleApps Epicenter: http://www.oracleappshub.com

URL to article: http://www.oracleappshub.com/api/oracle-api-availability-concurrent-program/

Disclaimer The opinions expressed here represent solely my own represent personal conjecture based upon experience, practice and observation and does not represent the thoughts, intentions, plans or strategies of my current & previous employers and their clients. Copyright © 2007-2010 OracleApps Epicenter. All rights reserved.