Sunday 8 January 2017

Application Object Library (AOL) :- Defined under the status code


Application Object Library (AOL)

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.

Setting Up Your Application:
§  Oracle Applications and custom applications that integrate with Oracle
§  Applications need to have a particular directory structure where its
§  Components must be available. Those components are,
1.      Forms
2.      Menus
3.      Programs
4.      Reports.

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.

                     

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.
         
        

SELECT * FROM FND_RESPONSIBILITY_TL
WHERE RESPONSIBILITY_NAME = 'Application Developer'

Menus (Contd.):          

SELECT * FROM FND_MENUS

SELECT * FROM FND_MENUS_TL

SELECT * FROM FND_MENU_ENTRIES

SELECT * FROM FND_MENU_ENTRIES_TL


            


§  Query the menu name to find the menu entries.
§  Add your functions as menu entries here or create a new menu with your functions and add that as a sub- menu here.
§  Now you switch the responsibility and check whether your menu entry is appearing in corresponding responsibility.


List of Menus Excluded from a given Responsibility:

SELECT        frv.responsibility_name
,fmv.user_menu_name
FROM            fnd_resp_functions frf
,fnd_menus_vl fmv
,fnd_responsibility_vl frv
WHERE         frf.rule_type =’M’
AND frf.action_id = fmv.menu_id
AND frf.responsibility_id = frv.responsibility_id
AND frv.responsibility_name = ‘&resp_name’;

List of Functions Excluded from a given responsibility:

SELECT        frv.responsibility_name
,fffv.user_function_name
FROM            fnd_resp_functions frf
,fnd_form_functions_vl fffv
,fnd_responsibility_vl frv
WHERE         frf.rule_type =’F’
AND frf.action_id = fffv.function_id
AND frf.responsibility_id = frv.responsibility_id
AND frv.responsibility_name = ‘&resp_name’;

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.

Concurrent Program Executable:

           

           

§  Enter a name for executable and short name.
§  Choose the application to which this
§  executable belongs such that the system will
§  Look for this file in that directory structure.
§  Enter the execution method as
  1. Flex Rpt                                 The execution file is written using the Flex Report API.
  2. Flex Sql                                  The execution file is written using the Flex Sql API.
  3. Host                                        The execution file is a host script.
  4. Oracle Reports                      The execution file is an Oracle Reports file.
  5. PL/SQL Stored Procedure   The execution file is a stored procedure.
  6. SQL*Loader                          the execution file is a SQL script.
  7. SQL*Plus                               the execution file is a SQL*Plus script.
  8. SQL*Report                          the execution file is a SQL*Report script.
  9. Spawned                                The execution file is a C or Pro*C program.
  10. Immediate                              The execution file is a program written to run as a            subroutine of the concurrent manager.
§  Enter the execution file name without the file extension.
§  For PL/SQL stored procedures enter the <package>.<procedure name> in the execution        file name. This procedure must have 2 out parameters of type varchar2 preferably with names errbuf and errout. These two parameters should be added before adding any other parameters.
/*=============================================
CREATE CONCURRENT PROGRAM EXECUTABLE FROM BACKEND
==============================================*/ 

DECLARE
    V_EXECUTABLE VARCHAR2 (50):='XX_LERP_HRMS_EXEC';
 BEGIN
 FND_GLOBAL.APPS_INITIALIZE (
USER_ID                   =>        1318,
                                                RESP_ID                     =>       21623,
                                                RESP_APPL_ID        =>        660);           
            FND_PROGRAM.EXECUTABLE (
                                Executable                                  =>        V_EXECUTABLE,
                                Application                                 =>        'Human Resources',
                                short_name                      =>        'XX_LERP_HRMS_EXEC_SN',
                                execution_method          =>        'Oracle Reports',
                                execution_file_name       =>        'XX_LERP_HRMS'
                                   );    
            COMMIT;
            DBMS_OUTPUT.PUT_LINE ('succeefully created executable name is '||V_EXECUTABLE) ;
        END;

SELECT * FROM fnd_executables
 WHERE execution_file_name='XX_LERP_HRMS'

/*=============================================
DELETE CONCURRENT PROGRAM EXECUTABLE FROM BACKEND
==============================================*/ 

DECLARE
V_EXECUTABLE        VARCHAR2 (30):='XXLERP_ORDER';
BEGIN
fnd_program.DELETE_EXECUTABLE(
                      executable_short_name             =>        V_EXECUTABLE,
                      application                                 =>         'Order Management'
                      );
COMMIT;
            DBMS_OUTPUT.PUT_LINE ('Concurrent Program Executable succeefully Deleted  '||V_EXECUTABLE) ;
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
==============================================*/ 

DECLARE
V_CPROGRAM VARCHAR2 (50):='XX_LERP_HRMS PROGRAM DETAILS';
BEGIN
FND_GLOBAL.APPS_INITIALIZE (
USER_ID                    =>       1318,
                                                RESP_ID                    =>        21623,
                                                RESP_APPL_ID        =>        660);           
                FND_PROGRAM.REGISTER    (
                                Program                           =>        V_CPROGRAM,
                                Application                     =>        'Human Resources',
                                Enabled                           =>        'Y',
                                short_name                      =>        'XX_LERP_HRMS_PRG_SN',
                                executable_short_name   =>        'XX_LERP_HRMS_EXEC_SN',
                                executable_application    =>        'Human Resources',
                                style                                 =>        'A4',
                                output_type                     =>        'TEXT',
                                use_in_srs                        =>         'Y'
                            ) ;
                COMMIT;
                DBMS_OUTPUT.PUT_LINE ('succeefully created concurrent program ‘||V_CPROGRAM);
            END;


SELECT * FROM fnd_concurrent_programs
WHERE concurrent_program_name='XX_LERP_HRMS PROGRAM DETAILS'

/*=============================================
DELETE CONCURRENT PROGRAM FROM BACKEND
==============================================*/ 

DECLARE
V_CPROGRAM        VARCHAR2 (30):='XXLERP_ORDER';
BEGIN
fnd_program.DELETE_PROGRAM(
                program_short_name          => V_CPROGRAM, 
                application                           =>  'Order Management'
                );
COMMIT;
            DBMS_OUTPUT.PUT_LINE ('Concurrent Program succeefully Deleted ‘||V_CPROGRAM) ;
END;

Define Concurrent Parameters:
§  The parameters are the placeholders for the input values to a concurrent program.
§  If the execution method of a concurrent program is Oracle Reports then each parameter is linked to the actual report parameter via the “Token” field in the parameters window
§  For PL/SQL stored procedures these parameters are passed to the program by position.
 Output formats of a concurrent program:
  • HTML.
  • PDF.
  • TEXT.
  • PS (Post Script).
  • PCL (HP’s Printer Control Language).

/*=============================================
CREATE PARAMETERS TO THE CONCURRENT PROGRAM FROM BACKEND
==============================================*/
DECLARE
V_CPROGRAM VARCHAR2 (50):='XX_L ERP_HRMS_PRG_SN';
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            r                                   =>        'P1',
                                enabled                                        =>        'Y',
                                value_set                                     =>        'lerp_P1',
                                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;

/*=============================================
DELETE PARAMETERS IN THE CONCURRENT PROGRAM FROM BACKEND
==============================================*/ 
DECLARE
V_EXECUTABLE        VARCHAR2 (30):='XXLERP_ORDER';
BEGIN
fnd_program.DELETE_PARAMETER(
program_short_name =>        V_EXECUTABLE,
                                    application                   =>        'Order Management',
                                    parameter                    =>        'P_ORDER_FROM'); 
COMMIT;
            DBMS_OUTPUT.PUT_LINE ('Parameter succeefully Deleted For The Concurrent Program '||V_EXECUTABLE) ;
END;

Define Request Group:
§  Note the Request group name for the responsibility, with which you want to attach the concurrent program.
   
    
SELECT * FROM fnd_responsibility_tl
WHERE responsibility_name = 'Application Developer';

SELECT * FROM fnd_request_groups
WHERE application_id=0
AND request_group_name='Application Developer Reports'.



Define Request Group (Contd.):
§  Query the request group and add your concurrent program to the group.
§  A request group is a collection of reports and concurrent programs.
§  A system administrator defines request group in order to control user access to reports and concurrent programs.

              

/*=============================================
ADD CONCURRENT PROGRAM TO THE REQUEST GROUP FROM BACKEND
==============================================*/ 

DECLARE
V_CPROGRAM VARCHAR2 (50):='XX_LERP_HRMS_PRG_SN';
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       =>        'Human Resources',
                                request_group                 =>        'OM Concurrent Programs',
                                group_application           =>        'Order Management' 
                            );
                COMMIT;
                DBMS_OUTPUT.PUT_LINE ('succeefully attached concurrent program  to request group'||V_CPROGRAM) ;
            EXCEPTION WHEN OTHERS THEN
                DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
            END;


/*=============================================
DELETE CONCURRENT PROGRAM FROM THE REQUEST GROUP FROM BACKEND
==============================================*/ 

DECLARE
V_EXECUTABLE        VARCHAR2 (30):='XXLERP_ORDER'; 
BEGIN
FND_GLOBAL.APPS_INITIALIZE (
USER_ID              =>    1318,
                                            RESP_ID              =>    21623,
                                            RESP_APPL_ID         =>    660);           
fnd_program.REMOVE_FROM_GROUP(
program_short_name              =>        V_EXECUTABLE,
                                    program_application               =>        ‘Order Management',
                                    request_group                         =>        ‘OM Concurrent Programs',
                                    group_application                   =>        ‘Order Management');
                                COMMIT;
            DBMS_OUTPUT.PUT_LINE ('Successfully Deleted executable name is '||V_EXECUTABLE) ;
END;


Concurrent Programs Assigned to a Request Group:

SELECT        fcpv.concurrent_program_name SHORT_NAME
,fcpv.user_concurrent_program_name CONC_PROG_NAME
,frg.request_group_name REQ_GROUP_NAME
FROM            fnd_concurrent_programs_vl fcpv
,fnd_request_groups frg
,fnd_request_group_units frgu
WHERE         fcpv.concurrent_program_id = frgu.request_unit_id
AND fcpv.enabled_flag = ‘Y’
AND frgu.request_group_id = frg.request_group_id
AND frg.request_group_name = ‘&request_group_name’;

Check if the concurrent program is assigned to a given responsibility:

SELECT        fcpv.concurrent_program_name SHORT_NAME
,fcpv.user_concurrent_program_name CONC_PROG_NAME
,frg.request_group_name REQ_GROUP_NAME
,frv.responsibility_name
FROM            fnd_concurrent_programs_vl fcpv
,fnd_request_groups frg
,fnd_request_group_units frgu
,fnd_responsibility_vl frv
WHERE         fcpv.concurrent_program_id = frgu.request_unit_id
AND fcpv.enabled_flag = ‘Y’
AND frgu.request_group_id = frg.request_group_id
AND frg.request_group_id = frv.request_group_id
AND frv.responsibility_name = ‘&resp_name’
AND fcpv.user_concurrent_program_name = ‘&con_prg_name’;

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.

Concurrent Programs Business Events:
In R12 for concurrent programs submission and completion has business events associated with them
in the concurrent program definition form there is a business events tab which displays the list of events associated

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. 

Concurrent Request Phase and Status
Phase: PENDING:
·         Normal: Request is waiting for the next available manager.
·         Standby: Program to run request is incompatible with other program(s) currently running.
·         Scheduled: Request is scheduled to start at a future time or date.
·         WaitingA child request is waiting for its Parent request to mark it ready to run.   
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.
·         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.


Useful FND Queries:
1. Concurrent Program Info

SELECT        fcpt.user_concurrent_program_name Concurrent_Program
                        ,fdfcu.column_seq_num Sequence_number
                        ,fdfcu.DEFAULT_VALUE default_value
                        ,fdfcut.form_left_prompt prompt
                        ,fdfcut.description description
                        ,ffvs.flex_value_set_name
                        ,fl.meaning
                        ,fe.executable_name
FROM            apps.fnd_concurrent_programs fcp
                        ,apps.fnd_concurrent_programs_tl fcpt
                        ,apps.fnd_concurrent_programs_tl fcpd
                        ,apps.fnd_descr_flex_col_usage_tl fdfcut
                        ,apps.fnd_descr_flex_column_usages fdfcu
                        ,apps.fnd_descr_flex_col_usage_tl fdfcud
                        ,apps.fnd_application fa
                        ,apps.fnd_flex_value_sets ffvs
                        ,apps.fnd_lookups fl
                        ,apps.fnd_executables fe
WHERE         fcpt.user_concurrent_program_name='Payables Open Interface Import'
AND               fcp.concurrent_program_id = fcpt.concurrent_program_id
AND               fcpt.concurrent_program_id = fcpd.concurrent_program_id
AND               fdfcut.application_id = fa.application_id
AND               fdfcut.descriptive_flex_context_code = 'Global Data Elements'
AND               fdfcut.descriptive_flexfield_name = '$SRS$.'||fcp.concurrent_program_name
AND               fdfcut.application_id = fdfcu.application_id
AND               fdfcut.descriptive_flex_context_code = fdfcu.descriptive_flex_context_code
AND               fdfcut.descriptive_flexfield_name = fdfcu.descriptive_flexfield_name
AND               fdfcut.application_column_name = fdfcu.application_column_name
AND               fdfcut.application_id = fdfcud.application_id
AND               fdfcut.descriptive_flex_context_code = fdfcud.descriptive_flex_context_code
AND               fdfcut.descriptive_flexfield_name = fdfcud.descriptive_flexfield_name
AND               fdfcut.application_column_name = fdfcud.application_column_name
AND               fdfcu.flex_value_set_id = ffvs.flex_value_set_id
AND               fcp.EXECUTION_METHOD_CODE = fl.lookup_code
AND               fl.lookup_type = 'CP_EXECUTION_METHOD_CODE'
AND               fcp.executable_id = fe.executable_id
ORDER BY 1, 2 ,3





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




2. Concurrent Program parameters

SELECT        cp.CONCURRENT_PROGRAM_NAME,
                        cu.*,
                        vs.FLEX_VALUE_SET_NAME
FROM            applsys.fnd_concurrent_programs cp,
                        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

3. Concurrent Request Details 


SELECT        p.concurrent_program_name,
                        pt.user_concurrent_program_name,
                        rt.responsibility_name,
                         r.*
FROM            applsys.fnd_concurrent_requests r,
                        applsys.fnd_concurrent_programs p,
                        applsys.fnd_concurrent_programs_tl pt,
                        applsys.fnd_responsibility rsp,
                        applsys.fnd_responsibility_tl rt
WHERE         r.request_id = &Request_ID -- Enter Request ID
AND               r.program_application_id = p.application_id
AND               r.concurrent_program_id = p.concurrent_program_id
AND               p.application_id = pt.application_id
AND               p.concurrent_program_id = pt.concurrent_program_id
AND               pt.language = sys_context('USERENV', 'LANG')
AND               r.responsibility_application_id = rsp.application_id
AND               r.responsibility_id = rsp.responsibility_id
AND               rsp.application_id = rt.application_id
AND               rsp.responsibility_id = rt.responsibility_id
AND               rt.language = sys_context('USERENV', 'LANG')

4. Request Group Details


SELECT        rga.application_short_name "Req Grp App",
                        rg.request_group_name "Request Group Name",
                        rg.request_group_code "Request Group Code",
                        rg.description "Request Group Desc",
                        cp.concurrent_program_name "Concurrent Program",
                        ea.application_short_name "Exec App",
                        e.executable_name "Executable",
                        rga.application_id "Req Grp App ID",
                        rg.request_group_id "Req Grp ID",
                        e.application_id "Exec App ID"
FROM            applsys.fnd_executables e,
                        applsys.fnd_concurrent_programs cp,
                        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

5. Request Set Details


SELECT        rst.USER_REQUEST_SET_NAME,
                        rs.REQUEST_SET_NAME,
                        rsst_start.USER_STAGE_NAME start_stage,
                        rss.DISPLAY_SEQUENCE stage_sequence,
                        rss.STAGE_NAME,
                        rss.REQUEST_SET_STAGE_ID,
                        rss.SUCCESS_LINK,
                        rss.WARNING_LINK,
                        rss.ERROR_LINK,
                        rsst.USER_STAGE_NAME,
                        rsst.DESCRIPTION stage_description,
                        rsp.sequence program_sequence,
                        cp.user_concurrent_program_name,
                        pa.*
FROM            applsys.fnd_request_sets_tl rst,
                        applsys.fnd_request_sets rs,
                        applsys.fnd_request_set_stages_tl rsst_start,
                        applsys.fnd_request_set_stages rss,
                        applsys.fnd_request_set_stages_tl rsst,
                        applsys.fnd_request_set_programs rsp,
                        applsys.fnd_concurrent_programs_tl cp,
                        applsys.fnd_request_set_program_args pa
WHERE         rs.REQUEST_SET_NAME like '%' -- Enter Request Set Name
AND               rs.application_id = rst.application_id
AND               rs.REQUEST_SET_ID = rst.REQUEST_SET_ID
AND               rst.language = sys_context('USERENV', 'LANG')
AND               rsst_start.SET_APPLICATION_ID = rs.application_id
AND               rsst_start.REQUEST_SET_ID = rs.REQUEST_SET_ID
AND               rsst_start.REQUEST_SET_STAGE_ID = rs.START_STAGE
AND               rsst_start.language = 'US'
AND               rss.SET_APPLICATION_ID = rs.application_id
AND               rss.REQUEST_SET_ID = rs.REQUEST_SET_ID
AND               rsst.SET_APPLICATION_ID = rss.SET_APPLICATION_ID
AND               rsst.REQUEST_SET_ID = rss.REQUEST_SET_ID
AND               rsst.REQUEST_SET_STAGE_ID = rss.REQUEST_SET_STAGE_ID
AND               rsst.language = 'US'
AND               rsp.SET_APPLICATION_ID = rss.SET_APPLICATION_ID
AND               rsp.REQUEST_SET_ID = rss.REQUEST_SET_ID
AND               rsp.REQUEST_SET_STAGE_ID = rss.REQUEST_SET_STAGE_ID
AND               rsp.program_application_id = cp.application_id
AND               rsp.concurrent_program_id = cp.concurrent_program_id
AND               cp.language = 'US'
AND               pa.application_id (+) = rsp.SET_APPLICATION_ID
AND               pa.REQUEST_SET_ID (+) = rsp.REQUEST_SET_ID
AND               pa.REQUEST_SET_PROGRAM_ID (+) = rsp.REQUEST_SET_PROGRAM_ID
ORDER BY   rst.USER_REQUEST_SET_NAME,
                        rss.DISPLAY_SEQUENCE,
                        rsp.sequence,
                        pa.DESCRIPTIVE_FLEX_APPL_ID,
pa.DESCRIPTIVE_FLEXFIELD_NAME,         pa.APPLICATION_COLUMN_NAME



1.Find Locks Info

SELECT sid, id1, id2, lmode, request, block
FROM v$lock
WHERE sid = &sid

2.Find Session Info


SELECT module, action, sid, serial# FROM v$session
WHERE action like '%%'


3.Find Lock Mode


SELECT a.sid, b.name, a.id1, a.lmode, a.request
FROM v$lock a, sys.obj$ b
WHERE b.obj# = a.id1

4.Find Locked Objects

SELECT oracle_username, os_user_name, session_id, process,
locked_mode, o.owner, o.object_type, o.object_name
FROM v$locked_object l,
sys.dba_objects o
WHERE l.object_id = o.object_id
order by o.owner, o.object_name, session_id

5.Control File Query

SELECT * FROM v$controlfile

6.Folder Info Query

SELECT b.application_short_name,
d.responsibility_name,
a.OBJECT,
c.NAME Folder_Name
FROM apps.fnd_default_folders a,
apps.fnd_application b,
apps.fnd_folders c,
apps.fnd_responsibility_vl d
WHERE a.application_id = b.application_id
AND a.folder_id = c.folder_id
AND d.responsibility_id = - (a.user_id)
AND d.responsibility_name LIKE '%%'
ORDER BY b.application_short_name,
d.responsibility_name;

Define Request Set:
     




Registering Custom Application:
§  Register your custom application with the Application Object Library.
§  Switch to System Administrator responsibility and open ‘Applications’ form.
§  Register a custom application with name, short name and Base path.
§  In UNIX, create a custom directory tree for your custom schema under APPL_TOP. First create a directory XXCUS which will serve as the base path then create other subdirectories as..
§  Modify the applications environment file to include the custom schema base path as XXCUS_TOP="/u02/oracle/visappl/XXCUS"
§  export XXCUS_TOP.



Registering Custom Schema:

§  First create a user in the database using SQL*Plus under the system account.
o   For example:
§  $ sqlplus system/system password.
§  SQL> create user XXCUS identified by CUST default table space USER_DATA temporary table space TEMP quota unlimited on USER_DATA quota unlimited on TEMP;
§  SQL> grant connect to XXCUS identified by CUST;
§  Then Register the user with the Application Object Library.
Log into Oracle Apps as the System Administrator and navigate to Security -> ORACLE -> Register.


      


Add custom schema to data group:
§  Log into Applications as the System Administrator and navigate to Security -> ORACLE-> Data Group.
§  It is recommend that you use the STANDARD data group and associate the custom schema with APPS.
§  Now you can create your custom tables, indexes and sequences in custom schema.
§  Then Grant ALL access to APPS.
§  Create Synonyms, views, triggers and Packages in APPS schema.
      

Responsibility:
§  A responsibility is a set of authority in Oracle Applications that lets users access only that functionality of the application appropriate to their role.
§  How much of an application’s functionality a user can use
§  What reports and concurrent program a user can access
§  Which application data these reports and concurrent programs can access.

  


Create Users and assign Responsibilities:

§  Switch to System Administrator responsibility
§  Navigate to Security-->User-->Define
§  Add or query a User.
§  Add responsibility to user as required.


     



/*=============================================
CREATE APPLICATIONS USER FROM BACKEND
==============================================*/
DECLARE
v_user_name   varchar2(30)    :=         upper('&Enter_User_Name');
v_password     varchar2(30)    :=         '&Enter_Password';
v_session_id    integer             :=         userenv('sessionid');
v_email            varchar2(30)    :=         upper('&Enter_Email_Id');
BEGIN
  fnd_user_pkg.createuser (
                        x_user_name                           =>        v_user_name,
                        x_owner                                  =>        null,
                        x_unencrypted_password       =>        v_password,
                        -- x_session_number               =>        v_session_id,
                        x_start_date                            =>        sysdate,
                        x_end_date                             =>        null,
                        x_email_address                     =>        v_email);
COMMIT;
DBMS_OUTPUT.put_line ('User:'||v_user_name||'Created Successfully');
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('&Enter_User_Name');
v_new_password varchar2(30):='&Enter_New_Password';
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;

Key Flex fields:
§  Most businesses use codes made up of meaningful segments to identify Account Number, Part number and other business entities, eg: a company might have a part number
”PAD–NR–YEL–8 1/2x14” indicating a notepad, narrow–ruled, yellow, and 14” by 8 1/2”.
§  A Flex field is a field which is made up of segments. 
§  Each segment has a name and a set of valid values.
§  A Key flex field identifies an entity.

                 
Register Key Flex fields:
§  Register your key flex field with Oracle Application Object Library.
§  Each key flex field has one corresponding table, known as the combinations table, where the flex field stores a list of the complete codes, with one column for each segment of the code.
§  There is a corresponding unique ID number (a code combination ID number or CCID) for that code which is also stored in the combination table.
§  A flex field structure is a specific configuration of segments. Same flex field can have multiple segment structure.
                        
Customize Key Flex field Segments:

§  A segment is a single sub–field within a flex field. You define the appearance and meaning of individual segments when customizing a flex field.
§  A segment is represented in your database as a single table column.
§  Flex field validates each segment against a set of valid values, which are mostly predefined
§  A flex field qualifier identifies a particular segment of a key flex field.

                       

Key Flex field Feature:
§  Dynamic Insertion:
§  The insertion of a new valid combination into a combinations table from a form other than the combinations form.
               
Key Flex field Cross validation:
Cross–Validation:
§  Cross–validation rules prevent users from creating new key flex field combinations that contain values that should not coexist in the same combination.

                     
Descriptive Flex fields:

§  Descriptive flex fields provide customizable "expansion space" on your forms. You can use descriptive flex fields to have additional information, important and unique to your business that would not otherwise be captured by the form.
§  A descriptive flex field appears on a form as a single-character, unnamed field enclosed in brackets.
§  Descriptive flex fields have two different types of segments, global and context-sensitive.
§  A global segment is a segment that always appears in the descriptive flex field pop-up window.
§  A context-sensitive segment is a segment that may or may not appear depending upon what other information is present in your form.

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.

   

Global Segments (Contd.):
§  Already used segments for the DFF will appear here
§  You can create a new record and use a previously unused attribute and make it enabled and displayed
§  Save and compile the flex field definition.
   

§  Navigate to Order Management, Enter orders screen.
§  Enter or query an order and go to line DFF
§  You can see the additional information you enabled now
§  The DFF data gets stored in attribute columns of the base table.

Context sensitive Segments:
§  A context-sensitive descriptive flex field can gather context information from either a field on the form, or from a special field (a context field) inside the descriptive flex field pop-up window.
§  If the descriptive flex field derives the context information from a form field, that field is called a reference field for the descriptive flex field.
§  In DFF Segments form check Displayed for the context.
§  Optionally change the prompt of context
§  Choose the reference field from LOV, which should be initially defined in Register DFF form.

                 
§  The reference field is same as a normal form field.
§  Reference fields provide a way to map the context-sensitivity of descriptive flex field information that has been captured to existing conditions in your business data.
                 

§  Descriptive flex field segments...
Ø  Multiple Structure
Ø  Reference field
Ø  Structure Column
  

§  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.
      

Benefits of Flex fields:

§  Flex fields provides features that are required to satisfy the following business needs:
1.      Customize your applications to conform to your current business practice for accounting codes, product codes, and other codes.
2.      Customize your applications to capture data that would not otherwise be tracked by your application.
3.      Have “intelligent fields” that are fields comprised of one or more segments, where each segment has both a value and a meaning.
4.      Rely upon your application to validate the values and the combination of values that you enter in intelligent fields (Cross Validation Rules).
5.      Have the structure of an intelligent field change depending on data in your form or application data.
6.      Customize data fields to your meet your business needs without programming.
7.      Query intelligent fields for very specific information.

Value Sets:

Ø  Use value set to:

§  Determine which values users can enter into flex field segments and concurrent program parameters.
§  Provide a list of valid values using list of values feature

Ø  Validation Type for Value Set:

§  None (not validated at all)
§  Table
§  Independent
§  Dependent

Table validated Value Sets:

§  Create a validation table in your database
§  Register your table with Oracle Application Object Library (as a table)
§  Create the necessary grants and synonyms
§  Define a value set that uses your validation table
§  Define your flex field structure to use that value set for a segment.
   

§  Create a value set with a name, format type and length.
§  Specify validation type as Table and click on details button
§  Enter the Application name (optional), table name.
§  Enter the column names which you want to display as value and meaning (optional)
§  Enter the column name which need to be stored in the database in ID field
§  Mention the data type of these columns
§  Enter where and order by clause as appropriate.

Independent/Dependent Value Sets:
         Create your independent value set first
         Create your dependent value set, specifying a default value
         Define your independent values
         Define your dependent values.


Validation Type for Value Set…

§  Dependent



Relationship between Value Sets:






This Query gives details of value sets that are based on a oracle application tables:

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.

§  User Profile Forms:
§  Define new user profile option at the time of developing a new application
§  Profile names must be unique
§  A profile option cannot be deleted.


Setting Profile Values:

Setting System Profile

Values
      Navigate to
      Sysadmin à Profiles


Setting Personal Profile
Values:

      Click on Menu Edit -> Preferences -> Profile.

     
User Profile:

Ø  User Profile Levels
§  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.

     

User Profile Routines:
Ø  User Profile routines that helps in retrieving option values are,
         FND_PROFILE.GET (name IN varchar2, value OUT varchar2) is a procedure.
         FND_PROFILE.VALUE (name IN varchar2) return varchar2 is a function.
Ø  Syntax  of referring a profile option value in value sets or concurrent program parameters  is :$PROFILES$.option_name
Ø  Seeded profiles are
     USERNAME
     USER_ID
     RESP_ID





/*==========================
PACKAGE SPECIFICATION
===========================*/

CREATE OR REPLACE PACKAGE APPS.XXLERP_FND_CONCPRG_REGISTRATION
AS
V_EXECUTABLE VARCHAR2 (50)          :=         'XXC_ORDER_DETAILS';
V_APPLICATION VARCHAR2 (20)         :=         'Order Management';
V_CPROGRAM VARCHAR2 (50)             :=         'ORDER_DETAILS_XXC';
V_EXEC NUMBER (2);
V_CP NUMBER (2);
V_REQ_ID NUMBER (10);
PROCEDURE XXC_FND_CONCPRG_EXECUTABLE;
PROCEDURE XXC_FND_CONCPRG_DEFINE;
PROCEDURE XXC_FND_CONCPRG_PARAMETER;
PROCEDURE XXC_FND_CONCPRG_ADDTOGROUP;
PROCEDURE XXC_FND_CONCPRG_SUBMIT;
PROCEDURE XXC_FND_CONCPRG_WAIT_REQUEST;
PROCEDURE XXC_FND_CONCPRG_MAIN;
END;
/

--------------------------------------------------

/*==========================
PACKAGE BODY
===========================*/


CREATE OR REPLACE PACKAGE BODY APPS.XXLERP_FND_CONCPRG_REGISTRATION
AS
/*         Author                         :           Logical ERP
Created_Date              :           21-JAN-2013
Last_Update_by         :           22-JAN-2013
Last_Updated_Date   :           22-JAN-2013
Purpose                       :           Used Register Concurrent Program into apps (by creating
                                                            Executable, Define and Submit the Concurrent Program)
*/
PROCEDURE XXC_FND_CONCPRG_EXECUTABLE
IS

BEGIN
   
        SELECT count (*) INTO V_EXEC
        FROM fnd_executables
        WHERE executable_name=V_EXECUTABLE;
       
        IF V_EXEC=0 THEN
           
            FND_GLOBAL.APPS_INITIALIZE (USER_ID          =>1318,
                                        RESP_ID          =>21623,
                                        RESP_APPL_ID     =>660);           
            FND_PROGRAM.EXECUTABLE (
Executable                              =>        V_EXECUTABLE,
Application                             =>       V_APPLICATION,
short_name                              =>        V_EXECUTABLE,
execution_method                  =>        'Oracle Reports',
execution_file_name               =>        V_EXECUTABLE
                                   );    
            COMMIT;
            DBMS_OUTPUT.PUT_LINE ('succeefully created executable name is '||V_EXECUTABLE) ;
        ELSE
                DBMS_OUTPUT.PUT_LINE ('this executable '||V_EXECUTABLE||'is already created');
        END IF;
       
EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
END XXC_FND_CONCPRG_EXECUTABLE;
  
PROCEDURE XXC_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
           
                FND_GLOBAL.APPS_INITIALIZE (USER_ID          =>1318,
                                            RESP_ID                                    =>       21623,
                                            RESP_APPL_ID                        =>       660);           
                FND_PROGRAM.REGISTER    (
                                Program                           =>        V_CPROGRAM,
                                Application                     =>        V_APPLICATION,
                                Enabled                           =>        'Y',
                                short_name                      =>        V_CPROGRAM,
                                executable_short_name   =>        V_EXECUTABLE,
                                executable_application    =>        V_APPLICATION,
                                Style                                =>        'A4',
                                output_type                     =>        'TEXT',
                                use_in_srs                        =>        'Y'
                            ) ;
                COMMIT;
                DBMS_OUTPUT.PUT_LINE ('succeefully created concurrent program ‘||V_CPROGRAM) ;
            ELSE
                DBMS_OUTPUT.PUT_LINE ('concurrent program is not created'||SQLCODE||SQLERRM);   
            END IF;
        ELSE
            DBMS_OUTPUT.PUT_LINE ('this executable'||V_EXECUTABLE||' is not created ');
        END IF;

EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
END XXC_FND_CONCPRG_DEFINE;

PROCEDURE XXC_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,
                                                    RESP_APPL_ID    =>660);
                                          
                        FND_PROGRAM.PARAMETER (
                                program_short_name                  =>        V_CPROGRAM,
                                Application                                 =>        V_APPLICATION,
                                Sequence                                     =>        10,
                                Parameter                                    =>        'P1',
                                Enabled                                       =>        'Y',
                                value_set                                     =>        'lerp_P1',
                                display_size                                 =>        50,
                                description_size                          =>        20,
                                concatenated_description_size   =>        20,
                                Prompt                                        =>        'P_ORDER1',
                                Token                                          =>        'P_ORDER1'
                                 );
                       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;                
                                        
                    BEGIN                     
                        FND_PROGRAM.PARAMETER (
                                program_short_name                  =>        V_CPROGRAM,
                                application                                   =>        V_APPLICATION,
                                sequence                                      =>        20,
                                parameter                                                =>        'P2',
                                enabled                                        =>        'Y',
                                value_set                                     =>        'lerp_P1',
                                display_size                                 =>        50,
                                description_size                          =>        20,
                                concatenated_description_size   =>        20,
                                prompt                                         =>        'P_ORDER2',
                                token                                           =>        'P_ORDER2'
                                 );
                    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;
          ELSE
            DBMS_OUTPUT.PUT_LINE ('concurrent program ‘||V_CPROGRAM||' is not created')  ;                             
          END IF;      

EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
END XXC_FND_CONCPRG_PARAMETER;

PROCEDURE XXC_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                 =>        'OM Concurrent Programs',
                                group_application           =>        'Order Management' 
                            );
                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');
        END IF;
       
EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
END XXC_FND_CONCPRG_ADDTOGROUP;

PROCEDURE XXC_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                 =>        'ont',
                                                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 XXC_FND_CONCPRG_SUBMIT;

PROCEDURE XXC_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;
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,
                                                            lerp_phase       =>        v_phase1,
                                                            lerp_status       =>        v_status1,
                                                            Message          =>        v_Phase2
                                                        );
                    COMMIT;
                   
                    EXCEPTION WHEN OTHERS THEN
                        DBMS_OUTPUT.PUT_LINE ('error out here'||SQLCODE||SQLERRM);
                    END;                                  
         
                    if v_phase='Completed'and v_status ='Normal' Then
                        DBMS_OUTPUT.PUT_LINE ( V_req_id ||' Sucessfully Completed With Status Normal');
                    ELSIF v_phase='Completed'and v_status ='Error' Then
                        DBMS_OUTPUT.PUT_LINE ( V_req_id ||' Sucessfully Completed With Status Error');
                    ELSIF v_phase='Completed'and v_status ='Warning' Then
                        DBMS_OUTPUT.PUT_LINE (V_req_id ||' Sucessfully Completed With Status Warning');
                    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 XXC_FND_CONCPRG_WAIT_REQUEST;

PROCEDURE XXC_FND_CONCPRG_MAIN
IS

BEGIN
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_EXECUTABLE;
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_DEFINE;
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_PARAMETER;
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_ADDTOGROUP;
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_SUBMIT;
        XXlerp_FND_CONCPRG_REGISTRATION.XXC_FND_CONCPRG_WAIT_REQUEST;
EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR OUT HERE'||SQLCODE||SQLERRM);
END XXC_FND_CONCPRG_MAIN;

END XXlerp_FND_CONCPRG_REGISTRATION;
/




No comments :