8
FND_REQUEST Package FND_REQUEST.SET_OPTIONS (Client or Server) Syntax: function FND_REQUEST.SET_OPTIONS (implicit IN varchar2 default 'NO', protected IN varchar2 default 'NO', language IN varchar2 default NULL, territory IN varchar2 default NULL) return boolean; Description Optionally call before submitting a concurrent request to set request options. Returns TRUE on successful completion, and FALSE otherwise. Arguments (input) implicit Determines whether to display this concurrent request in the end-user Concurrent Requests form. (All requests are automatically displayed in the System Administrator's privileged Concurrent Requests form, regardless of the value of this argument.) Specify 'NO', 'YES', 'ERROR', or 'WARNING'. 'NO' allows the request to be viewed on the end-user Concurrent Requests form. 'YES' means that the request may be viewed only from the System Administrator's privileged Concurrent Requests form. 'ERROR' causes the request to be displayed in the end user Concurrent Requests form only if it fails. 'WARNING' allows the request to display in the end-user Concurrent Requests form only if it completes with a warning or an error. protected Indicates whether this concurrent request is protected against updates made using the Concurrent Requests form. 'YES' means the request is protected against updates; 'NO' means the request is not protected. language Indicates the NLS language. If left NULL, defaults to the current language. territory Indicates the language territory. If left NULL, defaults to the current language territory. FND_REQUEST.SET_REPEAT_OPTIONS (Client or Server) Summary function FND_REQUEST.SET_REPEAT_OPTIONS (repeat_time IN varchar2 default NULL, repeat_interval IN number default NULL, repeat_unit IN varchar2 default 'DAYS', repeat_type IN varchar2 default 'START'

Fnd Request

Embed Size (px)

Citation preview

Page 1: Fnd Request

FND_REQUEST Package

FND_REQUEST.SET_OPTIONS (Client or Server)

Syntax:function FND_REQUEST.SET_OPTIONS (implicit IN varchar2 default 'NO',

protected IN varchar2 default 'NO',

language IN varchar2 default NULL,

territory IN varchar2 default NULL)

return boolean;

DescriptionOptionally call before submitting a concurrent request to set request options. Returns TRUE on successful completion, and FALSE otherwise.Arguments (input)implicit Determines whether to display this concurrent request in the end-user

Concurrent Requests form. (All requests are automatically displayed in the System Administrator's privileged Concurrent Requests form, regardless of the value of this argument.) Specify 'NO', 'YES', 'ERROR', or 'WARNING'. 'NO' allows the request to be viewed on the end-user Concurrent Requests form. 'YES' means that the request may be viewed only from the System Administrator's privileged Concurrent Requests form. 'ERROR' causes the request to be displayed in the end user Concurrent Requests form only if it fails. 'WARNING' allows the request to display in the end-user Concurrent Requests form only if it completes with a warning or an error.

protected Indicates whether this concurrent request is protected against updates made using the Concurrent Requests form. 'YES' means the request is protected against updates; 'NO' means the request is not protected.

language Indicates the NLS language. If left NULL, defaults to the current language. territory Indicates the language territory. If left NULL, defaults to the current

language territory.

FND_REQUEST.SET_REPEAT_OPTIONS (Client or Server)

Summaryfunction FND_REQUEST.SET_REPEAT_OPTIONS (repeat_time IN varchar2 default NULL,

repeat_interval IN number default NULL,

repeat_unit IN varchar2 default 'DAYS',

repeat_type IN varchar2 default 'START'

Page 2: Fnd Request

repeat_end_time IN varchar2 default NULL)

return boolean;

DescriptionOptionally call before submitting a concurrent request to set repeat options. Returns TRUE on successful completion, and FALSE otherwise.Arguments (input)repeat_time Time of day to repeat the concurrent request, formatted as

HH24:MI or HH24:MI:SS. The only other parameter you may use with repeat_time is repeat_end_time.

repeat_interval Interval between resubmissions of the request. Use this parameter along with repeat_unit to specify the time between resubmissions. This parameter applies only when repeat_time is NULL.

repeat_unit The unit of time used along with repeat_interval to specify the time between resubmissions of the request. The available units are 'MINUTES', 'HOURS', 'DAYS', and 'MONTHS'. This parameter applies only when repeat_time is NULL.

repeat_type Determines whether to apply the resubmission interval from either the 'START' or the 'END' of the request's execution. This parameter applies only when repeat_time is NULL.

repeat_end_time The date and time to stop resubmitting the concurrent request, formatted as either: 'DD-MON-YYYY HH24:MI:SS' or 'DD-MON-RR HH24:MI:SS'

FND_REQUEST.SET_PRINT_OPTIONS (Client or Server)

Summaryfunction FND_REQUEST.SET_PRINT_OPTIONS (printer IN varchar2 default NULL,

style IN varchar2 default NULL,

copies IN number default NULL,

save_output IN boolean default TRUE,

print_together IN varchar2 default 'N')

return boolean;

DescriptionOptionally call before submitting a concurrent request to set print options. Returns TRUE on successful completion, and FALSE otherwise.

Attention: Some print options that are set at the program level (i.e., using the Concurrent Programs form) cannot be overridden using this procedure. See the following argument descriptions to determine which print options can be overridden.

Arguments (input)printer Name of the printer to which concurrent request output should be

Page 3: Fnd Request

sent. You cannot override this print option if it was already set using the Concurrent Programs form.

style Style used to print request output, for example 'Landscape' or 'Portrait'. (Valid print styles are defined using the Print Styles form.) If the Style option was already set using the Concurrent Programs form, and the Style Required check box is checked, you cannot override this print option.

copies Number of copies of request output to print. You can override this print option even if it was already set using the Concurrent Programs form.

save_output Indicates whether to save the output file. Valid values are TRUE and FALSE. You can override this print option even if it was already set using the Concurrent Programs form.

print_together This parameter applies only to requests that contain sub-requests. 'Y' indicates that output of sub-requests should not be printed until all sub-requests complete. 'N' indicates that the output of each sub-request should be printed as it completes.

FND_REQUEST.SUBMIT_REQUEST (Client or Server)

Summaryfunction FND_REQUEST.SUBMIT_REQUEST (application IN varchar2 default NULL,

program IN varchar2 default NULL,

description IN varchar2 default NULL,

start_time IN varchar2 default NULL,

sub_request IN boolean default FALSE

argument1,

argument2, ..., argument99,

argument100) return number;

DescriptionSubmits a concurrent request for processing by a concurrent manager. If the request completes successfully, this function returns the concurrent request ID; otherwise, it returns 0.

Attention: FND_REQUEST must know information about the user and responsibility from which the request is submitted. Therefore, this function only works from concurrent programs or forms within Oracle Applications.

The FND_REQUEST.SUBMIT_REQUEST function returns the concurrent request ID upon successful completion. It is then up to the caller to issue a commit to complete the request submission.

Page 4: Fnd Request

Your code should retrieve and handle the error message generated if there is a submission problem (the concurrent request ID returned is 0). Use FND_MESSAGE.RETRIEVE and FND_MESSAGE.ERROR to retrieve and display the error (if the request is submitted from the client side).Related Essays: Overview of Message Dictionary (See page )You must call FND_REQUEST.SET_MODE before calling FND_REQUEST.SUBMIT_REQUEST from a database trigger.If FND_REQUEST.SUBMIT_REQUEST fails from anywhere but a database trigger, database changes are rolled back up to the point of the function call. After a call to the FND_REQUEST.SUBMIT_REQUEST function, all setup parameters are reset to their default values.Arguments (input)application Short name of the application associated with the concurrent

request to be submitted. program Short name of the concurrent program (not the executable) for

which the request should be submitted. description Description of the request that is displayed in the Concurrent

Requests form (Optional.) start_time Time at which the request should start running, formatted as

HH24:MI or HH24:MI:SS (Optional.) sub_request Set to TRUE if the request is submitted from another request and

should be treated as a sub-request. Starting with Release 11, this parameter can be used if you are submitting requests from within a PL/SQL stored procedure concurrent program.

argument1...100 Arguments for the concurrent request; up to 100 arguments are permitted. If submitted from Oracle Forms, you must specify all 100 arguments.

FND_REQUEST.SET_MODE (Server)

Summaryfunction FND_REQUEST.SET_MODE (db_trigger IN boolean) return boolean;

DescriptionCall this function before calling FND_REQUEST.SUBMIT_REQUEST from a database trigger. Note that a failure in the database trigger call of FND_REQUEST.SUBMIT_REQUEST does not roll back changes. Arguments (input)db_trigger Set to TRUE if request is submitted from a database trigger.

Example Request Submissions

Example 1/* Submit a request from a form and commit*/

:parameter.req_id :=

Page 5: Fnd Request

FND_REQUEST.SUBMIT_REQUEST (

:blockname.appsname,

:blockname.program,

:blockname.description,

:blockname.start_time,

:blockname.sub_req = 'Y',

123, NAME_IN('ORDERS.ORDER_ID'), 'abc',

chr(0), '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '',

'', '', '', '', '', '', '', '', '', '');

IF :parameter.req_id = 0 THEN

FND_MESSAGE.RETRIEVE;

FND_MESSAGE.ERROR;

ELSE

IF :SYSTEM.FORM_STATUS != 'CHANGED' THEN

IF app_form.quietcommit THEN

/*form commits without asking user to save changes*/

fnd_message.set_name('SQLGL',

'GL_REQUEST_SUBMITTED');

fnd_message.set_TOKEN('REQUEST_ID',

TO_CHAR(:PARAMETER.REQ_ID), FALSE);

fnd_message.show;

Page 6: Fnd Request

ELSE

fnd_message.set_name('FND',

'CONC-REQUEST SUBMISSION FAILED');

fnd_message.error;

END IF;

ELSE

DO_KEY('COMMIT_FORM');

IF :SYSTEM.FORM_STATUS != 'CHANGED' THEN

/*commit was successful*/

fnd_message.set_name('SQLGL',

'GL_REQUEST_SUBMITTED');

fnd_message.set_TOKEN('REQUEST_ID',

TO_CHAR(:PARAMETER.REQ_ID), FALSE);

fnd_message.show;

END IF;

END IF;

END IF;

Example 2/* Submit a request where no setup is required */

declare

req_id number;

begin

req_id := FND_REQUEST.SUBMIT_REQUEST ('FND',

'FNDMDGEN', 'Message File Generator',

'01-NOV-02 00:00:00', FALSE, ...arguments...);

if (req_id = 0) then

/* Handle submission error */

FND_MESSAGE.RETRIEVE;

FND_MESSAGE.ERROR;

else

commit;

Page 7: Fnd Request

end if;

end;

Example 3/* Submit a request from a database trigger */

result := FND_REQUEST.SET_MODE(TRUE);

req_id := FND_REQUEST.SUBMIT_REQUEST (FND',

'FNDMDGEN', 'Message File Generator',

'01-NOV-02 00:00:00', FALSE, ...arguments...);

Example 4/* Submit a request inserting NULL arguments.

This call inserts 6 arguments with arguments 1, 3,

4, and 6 being NULL */

req_id := FND_REQUEST.SUBMIT_REQUEST ('FND',

'FNDPROG',

'Description of FNDPROG',

'01-FEB-01 00:00:00', FALSE,

'', 'arg2', '', NULL, arg5, '');

Example 5/* Submit a repeating request */

result := FND_REQUEST.SET_REPEAT_OPTIONS ('', 4, 'HOURS', 'END');

req_id := FND_REQUEST.SUBMIT_REQUEST ('CUS',

'CUSPOST', 'Custom Posting',

'01-APR-01 00:00:00', FALSE,

...arguments...);

Attention: You may not want to submit a request if FND_REQUEST.SET_REPEAT_OPTIONS returns failure. Thus, you may wish to test the result of FND_REQUEST.SET_REPEAT_OPTIONS before issuing the call to FND_REQUEST.SUBMIT_REQUEST.

Example 6/* Submit a request for 5 copies of a menu report */

result := FND_REQUEST.SET_PRINT_OPTIONS ('hqunx138',

'Landscape',

5,

Page 8: Fnd Request

'Yes',

FALSE);

req_id := FND_REQUEST.SUBMIT_REQUEST ('FND',

'FNDMNRMT',

'',

'',

'N', 0, 101);

Example 7/* Submit a protected request that repeats at noon */

result := FND_REQUEST.SET_OPTIONS ('YES');

result := FND_REQUEST.SET_REPEAT_OPTIONS ('12:00');

req_id := FND_REQUEST.SUBMIT_REQUEST ('CUS',

'CUSPOST', 'Custom Posting',

'01-APR-01 00:00:00', FALSE,

... args ...);