AOL - Oracle Application Object Library Training Manual PDF
AOL - Oracle Application Object Library Training Manual PDF
AOL is a collection of pre-built application components and facilities and it consists of forms,
subroutines, concurrent programs and reports, database tables and objects, messages, menus,
responsibilities, flex filed definitions, various guides and library functions.
Objective:
Register custom Application components.
Understand the security authorization features of Oracle Applications.
Run concurrent programs using Standard Report Submission.
Design and implement Key and Descriptive Flex fields.
Define and modify user profile options.
Agenda:
Setting Up Your Application.
Flex fields.
Profiles.
Register Functions:
A function is a part of an application functionality that is registered under a unique name for the
purpose of assigning /excluding it from a responsibility.
Application developers register functions when they develop forms.
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
Menus:
A menu is a hierarchical arrangement of application functions that is displayed in the navigator
window.
A menu consists of menu entries, which could be a submenu or a function.
Form functions are selected and navigated to using Navigator window.
Each responsibility has a menu associated with it.
Note the Menu name associated with a responsibility.
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
Menus (Contd.):
Concurrent Program Name, Responsibility Name and User Name for a concurrent request id?
SELECT fcr.request_id,
frv.responsibility_name,
fcpv.concurrent_program_name prog_short_name,
fcpv.user_concurrent_program_name con_prog_name,
fu.user_name requested_by
FROM fnd_concurrent_requests fcr,
fnd_concurrent_programs_vl fcpv,
fnd_user fu,
fnd_responsibility_vl frv
WHERE fcpv.concurrent_program_id = fcr.concurrent_program_id
AND fu.user_id = fcr.requested_by
AND frv.responsibility_id = fcr.responsibility_id
AND fcr.request_id = &req_id;
Concurrent Program:
A concurrent program is an executable file that runs simultaneously with online operations and with
other concurrent programs.
We need a concurrent program for ..
1. Any long running data intensive program
2. Operating system script
3. Oracle Reports
The various steps to define and register a concurrent program are.
4. Define concurrent program executable
5. Define concurrent program
6. Include the concurrent program in a request group
7. Run concurrent program through submit request form.
/*=============================================
CREATE CONCURRENT PROGRAM EXECUTABLE FROM BACKEND
==============================================*/
SELECT * FROM FND_APPLICATION_VL
WHERE 1=1
AND APPLICATION_SHORT_NAME LIKE 'XXCUST'
DECLARE
v_executable VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.executable (executable => 'XXAA Ar Aging
Report', application =>
'XXCUST Custom Application',
short_name =>
'XXAA_AR_AGING',
execution_method => 'Oracle
Reports',
execution_file_name =>
'XXAA_AR_AGING'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'succeefully created executable name is
'|| v_executable );
END;
/*=============================================
DELETE CONCURRENT PROGRAM EXECUTABLE FROM BACKEND
==============================================*/
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_program.delete_executable (executable_short_name =>
v_short_name,
application =>
'XXCUST Custom Application'
);
COMMIT;
DBMS_OUTPUT.put_line('Concurrent Program Executable succeefully
Deleted'|| v_short_name );
END;
Concurrent Program:
Define a concurrent program,
Choose an executable created, which will be executed once this concurrent program is
scheduled to run.
/*=============================================
CREATE CONCURRENT PROGRAM DEFINE FROM BACKEND
==============================================*/
SELECT * FROM FND_APPLICATION_VL
WHERE 1=1
AND APPLICATION_NAME = 'XXCUST Custom Application'
DECLARE
v_name VARCHAR2 (50) := 'XXAA Ar Aging Report';
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.REGISTER (program => v_name,
application => 'XXCUST
Custom Application',
enabled => 'Y',
short_name => v_short_name,
executable_short_name => v_short_name,
executable_application => 'XXCUST
Custom Application',
style => 'A4',
output_type => 'TEXT',
use_in_srs => 'Y'
);
COMMIT;
DBMS_OUTPUT.put_line ('succeefully created concurrent program '||
v_short_name );
END;
/*=============================================
DELETE CONCURRENT PROGRAM FROM BACKEND
==============================================*/
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_program.delete_program (program_short_name =>
v_short_name,
application => 'XXCUST
Custom Application'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Concurrent Program succeefully Deleted '
|| v_short_name );
END;
/*=============================================
CREATE PARAMETERS TO THE CONCURRENT PROGRAM FROM BACKEND
==============================================*/
DECLARE
v_cprogram VARCHAR2 (50) := 'XX_APPS88_HRMS';
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.parameter (program_short_name =>
v_cprogram,
application =>
'Human Resources',
SEQUENCE => 10,
parameter =>
'Employee Number',
enabled => 'Y',
value_set => '240
char',
display_size => 50,
description_size => 20,
concatenated_description_size => 20,
prompt =>
'P_EMPLOYEE_NUM',
token =>
'P_EMPLOYEE_NUM'
);
COMMIT;
DBMS_OUTPUT.put_line (' successfully created parameter for
concurrent program ' || v_cprogram );
EXCEPTION
WHEN OTHERS
THEN DBMS_OUTPUT.put_line ('error out here' || SQLCODE ||
SQLERRM);
END;
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
/*=============================================
DELETE PARAMETERS IN THE CONCURRENT PROGRAM FROM BACKEND
==============================================*/
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_program.DELETE_PARAMETER (program_short_name =>
v_short_name,
application => 'XXCUST
Custom Application',
parameter => 'P_DATE'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Parameter succeefully Deleted For The
Concurrent Program ' || v_short_name );
END;
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
/*=============================================
ADD CONCURRENT PROGRAM TO THE REQUEST GROUP FROM BACKEND
==============================================*/
SELECT * FROM FND_APPLICATION_VL
WHERE 1=1
AND APPLICATION_NAME = 'XXCUST Custom Application'
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.add_to_group (program_short_name =>
v_short_name,
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
----
>>==============================================================<<---
-
SELECT fcpt.user_concurrent_program_name,
frg.request_group_name,
fcp.concurrent_program_name,
frt.responsibility_name,
fat.application_name,
fa.application_short_name,
fa.basepath
FROM fnd_request_group_units frgu,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_request_groups frg,
fnd_executables fe,
fnd_responsibility fr,
fnd_responsibility_tl frt,
fnd_application_tl fat,
fnd_application fa
WHERE 1 = 1
AND fat.application_id = frgu.application_id
AND frgu.request_unit_id = fcp.concurrent_program_id
AND frgu.request_group_id = frg.request_group_id
AND fe.executable_id = fcp.executable_id
AND fcp.concurrent_program_id = fcpt.concurrent_program_id
AND frg.request_group_id = fr.request_group_id
AND fr.responsibility_id = frt.responsibility_id
AND fa.application_id = fat.application_id
AND fcpt.user_concurrent_program_name LIKE 'XXAA Ar Aging Report'
ORDER BY 6,4,3,2
;
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
----
>>==============================================================<<---
-
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
/*=============================================
DELETE CONCURRENT PROGRAM FROM THE REQUEST GROUP FROM BACKEND
==============================================*/
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.remove_from_group (program_short_name =>
v_short_name,
program_application => 'XXCUST
Custom Application',
request_group =>
'Receivables All',
group_application =>
'Receivables'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Successfully Deleted executable name is
' || v_short_name );
END;
/*===================================================================
=====*/
SELECT * FROM FND_APPLICATION_VL
WHERE 1=1
AND APPLICATION_NAME = 'XXCUST Custom Application'
DECLARE
v_name VARCHAR2 (50) := 'XXAA Ar Aging Report';
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.executable (executable => v_name,
application => 'XXCUST Custom
Application',
short_name => v_short_name,
execution_method => 'Oracle
Reports',
execution_file_name => v_short_name
);
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
COMMIT;
DBMS_OUTPUT.put_line ( 'succeefully created executable name is
'|| v_short_name );
END;
--->>>===========================================================
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_program.delete_executable (executable_short_name =>
v_short_name,
application =>
'XXCUST Custom Application'
);
COMMIT;
DBMS_OUTPUT.put_line('Concurrent Program Executable succeefully
Deleted'|| v_short_name );
END;
/*===================================================================
=====*/
DECLARE
v_name VARCHAR2 (50) := 'XXAA Ar Aging Report';
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.REGISTER (program => v_name,
application => 'XXCUST
Custom Application',
enabled => 'Y',
short_name => v_short_name,
executable_short_name => v_short_name,
executable_application => 'XXCUST
Custom Application',
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
--->>>===========================================================
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING';
BEGIN
fnd_program.delete_program (program_short_name =>
v_short_name,
application => 'XXCUST
Custom Application'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Concurrent Program succeefully Deleted '
|| v_short_name );
END;
/*===================================================================
=====*/
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.parameter (program_short_name =>
v_short_name,
application =>
'XXCUST Custom Application',
SEQUENCE => 10,
parameter => 'As
Of Date',
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
--->>>===========================================================
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_program.DELETE_PARAMETER (program_short_name =>
v_short_name,
application => 'XXCUST
Custom Application',
parameter => 'P_DATE'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Parameter succeefully Deleted For The
Concurrent Program ' || v_short_name );
END;
/*===================================================================
=====*/
WHERE 1=1
AND request_group_name like 'Receivables All'
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.add_to_group (program_short_name =>
v_short_name,
program_application => 'XXCUST
Custom Application',
request_group => 'Receivables
All',
group_application =>
'Receivables'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'succeefully attached concurrent program
to request group' || v_short_name );
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE || SQLERRM);
END;
SELECT fcpt.user_concurrent_program_name,
frg.request_group_name,
fcp.concurrent_program_name,
frt.responsibility_name,
fat.application_name,
fa.application_short_name,
fa.basepath
FROM fnd_request_group_units frgu,
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_request_groups frg,
fnd_executables fe,
fnd_responsibility fr,
fnd_responsibility_tl frt,
fnd_application_tl fat,
fnd_application fa
WHERE 1 = 1
AND fat.application_id = frgu.application_id
AND frgu.request_unit_id = fcp.concurrent_program_id
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
--->>>===========================================================
DECLARE
v_short_name VARCHAR2 (50) := 'XXAA_AR_AGING'; --> Conc Program
Short Name
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.remove_from_group (program_short_name =>
v_short_name,
program_application => 'XXCUST
Custom Application',
request_group =>
'Receivables All',
group_application =>
'Receivables'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'Successfully Deleted executable name is
' || v_short_name );
END;
/*===================================================================
=====*/
SRS Form:
Then use SRS (Standard Report Submission) form for running and monitoring your
application’s reports/concurrent programs at specific time interval.
This lets user specify run and print options and parameter value for reports and concurrent
programs.
Use fnd_file.put_line(fnd_file.log, ‘any message’) to show message in conc program log file.
A concurrent request proceeds through three, possibly four, life cycle stages or phases:
Pending Request is waiting to be run
Running Request is running
Completed Request has finished
Inactive Request cannot be run.
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
here you specify the points at which business events are enabled. The possible points are:
Request Submitted
Request On Hold
Request Resumed
Request Running
Program Completed
Post Processing Started
Post Processing Ended
Request Completed.
But make sure you set the profile "Concurrent: Business Intelligence Integration Enable". You will
need to set "Yes" to enable Business Events from Concurrent Processing System
Within each phase, a request’s condition or status may change. Below appears a listing of each phase
and the various states that a concurrent request can go through.
Phase: RUNNING:
Normal: Request is running normally.
Paused: Parent request pauses for all its child requests to complete.
Resuming: All requests submitted by the same parent request have completed
running. The Parent request is waiting to be restarted.
Terminating: Running request is terminated, by selecting Terminate in the Status field of the
Request Details zone.
Phase: COMPLETED:
Normal: Request completes normally.
Error: Request failed to complete successfully.
Warning: Request completes with warnings. For example, a report is generated successfully
but fails to print.
Cancelled: Pending or Inactive request is cancelled, by selecting Cancel in the Status field of
the Request Details zone.
Terminated: Running request is terminated, by selecting Terminate in the Status field of the
Request Details zone.
Phase: INACTIVE:
Disabled: Program to run request is not enabled. Contact your system administrator.
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
On Hold: Pending request is placed on hold, by selecting Hold in the Status field of the Request
Details zone.
No Manager: No manager is defined to run the request. Check with your system administrator.
Request Set:
Request Sets are a method of grouping multiple reports and/or concurrent programs by business
function with common run and print options.
The various tasks of the request set are linked together to determine the execution order,
whether the tasks execute sequentially or in parallel.
Stage is a component of a request set used to group requests within the set. All requests in a
stage are run in parallel, while stages themselves are run sequentially in the set.
Tasks that must operate separately are created in different stages.
After defining the initial stage for execution, all subsequent stages are defined under the three
completion status codes for the previous stage.
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
SELECT cpt.user_concurrent_program_name,
cpt.description,
cp.concurrent_program_name,
a.application_short_name,
e.executable_name,
cp.creation_date,
uc.user_name creator,
cp.last_update_date,
ulu.user_name updater,
cp.enabled_flag,
cp.run_alone_flag,
cp.srs_flag,
cp.print_flag,
cp.save_output_flag,
cp.required_style,
cp.output_print_style,
cp.printer_name,
cp.minimum_width,
cp.minimum_length,
cp.output_file_type,
cp.enable_trace,
cp.restart,
cp.nls_compliant,
cp.request_set_flag
FROM applsys.fnd_concurrent_programs cp,
applsys.fnd_concurrent_programs_tl cpt,
applsys.fnd_application a,
applsys.fnd_executables e,
applsys.fnd_user uc,
applsys.fnd_user ulu
WHERE cp.creation_date > TO_DATE ('17-MAY-1995') -- Enter
Creation Date
AND cp.application_id = cpt.application_id
AND cp.concurrent_program_id = cpt.concurrent_program_id
AND cpt.LANGUAGE = SYS_CONTEXT ('USERENV', 'LANG')
AND cp.application_id = a.application_id
AND cp.executable_application_id = e.application_id
AND cp.executable_id = e.executable_id
AND cp.created_by = uc.user_id
AND cp.last_updated_by = ulu.user_id
AND cpt.user_concurrent_program_name = 'Payables Open Interface
Import'
ORDER BY cp.concurrent_program_name
applsys.fnd_descr_flex_column_usages cu,
applsys.fnd_flex_value_sets vs
WHERE cp.creation_date > TO_DATE ('17-MAY-1995') --Enter
Creation Date
AND cu.application_id = cp.application_id
AND cu.descriptive_flexfield_name = '$SRS$.' ||
cp.concurrent_program_name
AND cu.flex_value_set_id = vs.flex_value_set_id
AND cp.concurrent_program_id = :concurrent_program_id --(Enter
CONCURRENT_PROGRAM_ID of CONCURRENT_PROGRAM)
ORDER BY cp.concurrent_program_name,
cu.column_seq_num
applsys.fnd_request_group_units rgu,
applsys.fnd_request_groups rg,
applsys.fnd_application rga,
applsys.fnd_application ea
WHERE e.application_id LIKE '%'-- Enter Application ID
AND e.executable_name LIKE '%' -- Enter Executable Name
AND cp.executable_application_id = e.application_id
AND cp.executable_id = e.executable_id
AND cp.enabled_flag = 'Y'
AND rgu.request_unit_id = cp.concurrent_program_id
AND rgu.unit_application_id = cp.application_id
AND rgu.request_unit_type = 'P'
AND rg.application_id = rgu.application_id
AND rg.request_group_id = rgu.request_group_id
AND rga.application_id = rgu.application_id
AND ea.application_id = e.application_id
/*=============================================
CREATE APPLICATIONS USER FROM BACKEND
==============================================*/
DECLARE
v_user_name VARCHAR2 (30) := UPPER ('Raju');
v_password VARCHAR2 (30) := '******';
v_email VARCHAR2 (30) := UPPER
('raju@appsassociates.com.com');
BEGIN
fnd_user_pkg.createuser (x_user_name =>
v_user_name,
x_owner => NULL,
x_unencrypted_password => v_password,
x_start_date => SYSDATE,
x_end_date => NULL,
x_email_address => v_email
);
COMMIT;
DBMS_OUTPUT.put_line ('User:' || v_user_name || 'Created
Successfully');
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'Unable to create User due to' ||
SQLCODE || ' ' || SUBSTR (SQLERRM, 1, 100) );
ROLLBACK;
END;
/*=============================================
PASSWORD RESET FOR THE APPLICATIONS USER FROM BACKEND
==============================================*/
DECLARE
v_user_name VARCHAR2 (30) := UPPER ('RAJU');
v_new_password VARCHAR2 (30) := '********';
v_status BOOLEAN;
BEGIN
v_status :=
fnd_user_pkg.changepassword (username => v_user_name,
newpassword => v_new_password
);
IF v_status = TRUE
THEN
DBMS_OUTPUT.put_line ( 'The password reset successfully for the
User:' || v_user_name );
COMMIT;
ELSE
DBMS_OUTPUT.put_line ( 'Unable to reset password due to' ||
SQLCODE || ' ' || SUBSTR (SQLERRM, 1, 100) );
ROLLBACK;
END IF;
END;
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
/*=============================================
Assign the Responsibilities to User from Backend
==============================================*/
DECLARE
V_username VARCHAR2 (30) := UPPER ('RAJU');
cursor cur is
SELECT r.responsibility_key,
a.application_short_name,
r.responsibility_name
FROM fnd_responsibility_vl r,
fnd_application_vl a
WHERE a.application_id = r.application_id
AND responsibility_name IN
('Application Developer'
,'Functional Administrator'
,'XML Publisher Administrator'
,'System Administrator'
,'General Ledger, Vision Operations (USA)'
,'Inventory, Vision Operations (USA)'
,'Payables, Vision Operations (USA)'
,'Receivables, Vision Operations (USA)'
,'Purchasing, Vision Operations (USA)'
)
;
BEGIN
DBMS_OUTPUT.put_line ( rec.responsibility_name ||
'Responsibility Assigned to' || v_username );
COMMIT;
END LOOP;
EXCEPTION
WHEN OTHERS
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
Global Segments:
In Order management, if you want to add some extra Order line information, then query the
DFF for “Additional Line Attribute information”
Go to Global Data Elements context field.
Click segments to view the DFF segments.
If you use a reference field, the value of that field populates its own column. For example, if the
reference field on the form is the "Country" field, it populates the "country" column in the table.
However, the reference field value also populates the structure (context) column in the table,
since that value specifies which structure the flex field displays.
Value Sets:
This Query gives details of value sets that are based on a oracle application tables:
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
Profiles:
User Profile:
A profile is a set of changeable options that affects the way your application runs
System Profile Options
1. Set by the System administrator
2. User cannot change
3. Any change in the system profile becomes effective only when the user logs on again or
change responsibility
Personal Profile Options
1. Set by the System Administrator
2. User can change the option values
3. Any changes become effective immediately
You need to create a profile in Application Developer responsibility and then assign its system
and personal values.
Values
• Navigate to
Sysadmin Profiles
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
User Profile:
User Profile Levels
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
A value set at the higher level overrides the one set at the lower level. “User” is the highest
level.
After implementation System Administrator sets the default profile values at the site level
Option values are dynamically set at the run time.
/*==========================
PACKAGE SPECIFICATION
===========================*/
CREATE OR REPLACE PACKAGE apps.xxaa_fnd_concprg_registration
AS
v_executable VARCHAR2 (50) := 'XXAA_AR_AGING';
v_application VARCHAR2 (20) := 'Receivables';
v_cprogram VARCHAR2 (50) := 'XXAA_AR_AGING';
v_exec NUMBER (2);
v_cp NUMBER (2);
v_req_id NUMBER (10);
PROCEDURE xxaa_fnd_concprg_executable;
PROCEDURE xxaa_fnd_concprg_define;
PROCEDURE xxaa_fnd_concprg_parameter;
PROCEDURE xxaa_fnd_concprg_addtogroup;
PROCEDURE xxaa_fnd_concprg_submit;
PROCEDURE xxaa_fnd_concprg_wait_request;
PROCEDURE xxaa_fnd_concprg_main;
END;
/
/*==========================
PACKAGE BODY
===========================*/
CREATE OR REPLACE PACKAGE BODY apps.xxaa_fnd_concprg_registration
AS
/*
Author : Raju Ch
Created_Date :
Last_Update_by :
Last_Updated_Date :
Purpose : Used Register Concurrent Program into apps (by
creating Executable, Define and Submit the Concurrent Program)
*/
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_executable
IS
BEGIN
SELECT COUNT (*)
INTO v_exec
FROM fnd_executables
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
IF v_exec = 0
THEN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_define
IS
BEGIN
SELECT COUNT (*)
INTO v_exec
FROM fnd_executables
WHERE executable_name = v_executable;
IF v_exec = 1
THEN
--DBMS_OUTPUT.PUT_LINE ('succeefully created executable name is
'||V_EXECUTABLE) ;
SELECT COUNT (*)
INTO v_cp
FROM fnd_concurrent_programs
WHERE concurrent_program_name = v_cprogram;
IF v_cp = 0
THEN
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_parameter
IS
BEGIN
SELECT COUNT (*)
INTO v_cp
FROM fnd_concurrent_programs
WHERE concurrent_program_name = v_cprogram;
IF v_cp = 1
THEN
BEGIN
--DBMS_OUTPUT.PUT_LINE ('succeefully created concurrent
program '||V_EXECUTABLE) ;
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
BEGIN
fnd_program.parameter
(program_short_name => v_cprogram,
application => v_application,
SEQUENCE => 20,
parameter => 'Date To',
enabled => 'Y',
value_set => '240 char',
display_size => 50,
description_size => 20,
concatenated_description_size => 20,
prompt => 'Date To',
token => 'P_DATE_TO'
);
COMMIT;
DBMS_OUTPUT.put_line ('successfully created parameter for
concurrent program ' || v_cprogram );
EXCEPTION
WHEN OTHERS
THEN
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_addtogroup
IS
BEGIN
SELECT COUNT (*)
INTO v_cp
FROM fnd_concurrent_programs
WHERE concurrent_program_name = v_cprogram;
IF v_cp = 1
THEN
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
fnd_program.add_to_group
(program_short_name => v_cprogram,
program_application => v_application,
request_group => 'Receivables All',
group_application => 'Receivables'
);
COMMIT;
DBMS_OUTPUT.put_line
('succeefully attached concurrent program to request
group');
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE ||
SQLERRM);
END;
ELSE
DBMS_OUTPUT.put_line ( 'concurrent program ' || v_cprogram || '
IS NOT CREATED' );
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE || SQLERRM);
END xxaa_fnd_concprg_addtogroup;
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_submit
IS
BEGIN
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
v_req_id :=
fnd_request.submit_request (application => 'AR',
program => v_cprogram,
argument1 => '10',
argument2 => '1000'
);
COMMIT;
DBMS_OUTPUT.put_line ( 'successfully submitted. request id is'
|| v_req_id );
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE || SQLERRM);
END;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE || SQLERRM);
END xxaa_fnd_concprg_submit;
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_wait_request
IS
v_req_id2 NUMBER (2);
v_phase VARCHAR2 (10);
v_status VARCHAR2 (10);
v_phase1 VARCHAR2 (10);
v_status1 VARCHAR2 (10);
v_phase2 VARCHAR2 (10);
v_status2 VARCHAR2 (10);
v_b BOOLEAN;
AOL – Oracle Application Object Library Training Manual Raju Chinthapatla
BEGIN
SELECT COUNT (*)
INTO v_req_id2
FROM fnd_concurrent_requests
WHERE request_id = v_req_id;
IF v_req_id2 = 1
THEN
--DBMS_OUTPUT.PUT_LINE ('succeefully submitted request id is
'||V_REQ_ID) ;
BEGIN
fnd_global.apps_initialize (user_id => 1318,
resp_id => 21623,
resp_appl_id => 660
);
v_b :=
fnd_concurrent.wait_for_request (request_id =>
v_req_id,
INTERVAL => 60,
max_wait => 0,
phase => v_phase,
status => v_status,
apps88_phase => v_phase1,
apps88_status => v_status1,
MESSAGE => v_phase2
);
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('error out here' || SQLCODE ||
SQLERRM);
END;
ELSE
DBMS_OUTPUT.put_line (v_req_id || v_phase || ' ' || v_status);
END IF;
ELSE
DBMS_OUTPUT.put_line ('ERROR FOR SUBMITION THE REQUEST. REQUEST
ID IS ' || v_req_id );
END IF;
END xxaa_fnd_concprg_wait_request;
----->>>=======================================================
PROCEDURE xxaa_fnd_concprg_main
IS
BEGIN
xxaa_fnd_concprg_registration.xxaa_fnd_concprg_executable;
xxaa_fnd_concprg_registration.xxaa_fnd_concprg_define;
xxaa_fnd_concprg_registration.xxaa_fnd_concprg_parameter;
xxaa_fnd_concprg_registration.xxaa_fnd_concprg_addtogroup;
-- xxaa_fnd_concprg_registration.xxaa_fnd_concprg_submit;
-- xxaa_fnd_concprg_registration.xxaa_fnd_concprg_wait_request;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('ERROR OUT HERE' || SQLCODE || SQLERRM);
END xxaa_fnd_concprg_main;
----->>>=======================================================
END xxaa_fnd_concprg_registration;
/