Saturday, 4 June 2016

Registering a PLSQL stored procedure as concurrent program

To register a PLSQL procedure as concurrent program we have four steps
Step : 1 → Create Executable
Step : 2 → Create concurrent program and link to Executable
Step : 3 → Create Parameters and link Value Sets
Step : 4 → Assign the registered Concurrent Program to a request group
Step : 1 → Create Executable
Concurrent is a program that user will invoke directly from the oracle apps. Imagine that each time to run a package or procedure a customer has to login to his database and running and for that we have to educate the client. Instead of this, registering a concurrent is best method to run the API because user will be assigned to responsibility and then he can run the program. It is a way to deliver to customer.
To register a program as concurrent open Oracle apps and go to the following Navigation
The Navigation is
Login into Oracle Applications –> Go to Application Developer Responsibility –> Concurrent –> Executable
This Executable is for running a program.
1
FIELDS:
  • Executable: This is User Understandable Name
  • Short Name: This is Unique and for system reference
  • Application: Under which application you want to register this Conc. Program
  • Description: Description
  • Execution Method: Based on this field, your file has to be placed in respective directory or database.
  • Execution File Name: This is the actual Report file name. If you register a PL/SQL Procedure in a package you have to give the packagename.procedure. You don’t need to specify any parameters in procedure here.
Action: Save
Step : 2 → Create concurrent program and link to Executable
The Navigation is
Application Developer –> Concurrent –> Program
2
FIELDS:
  • Program: User Understandable Program Name
  • Short Name: This should be unique name and for system reference
  • Application: Enter the application under which you want to register this conc.prog
  • Executable Name: Enter the User Understandable Executable Name
  • Method: This will be populated automatically from Executable Definition
  • Output Format: Select the format of the output you want
  • Output Style: Select A4 to print on A4 Paper
  • Printer: You can default any printer or you can enter while submitting concurrent program. 
Make sure you link the Executable’s short name and Concurrent program’s Executable name.
Step : 3 → Create Parameters and link Value Sets
Create Parameters and it is Better to Create Value Set
To create parameter the Navigation is
Application Developer –> Application –> Validation → Set
3
There are many types to get List of Values. So I go with the table.
To get data from table,select validation type as table and click the Edit Information Button Enter the Value and ID to be passed.
4
Linking value set to parameter and the Navigation is
Application Developer –> Concurrent –> Program
Enter the following here. And click on parameters to define parameters and in parameter form you can also enter default type
5
The above is Example for creating a parameter.
Just observe the below screenshot. Here There is a selection in Enabled. If it is
Checked then the parameter gets enabled and When the Display button is checked we can see the display in Oracle apps concurrent page.We can also give the Default type.
6
The below is another sample of a parameter. It is better to choose FND_DATE_STANDARD and we have to check for the format. This format is (DD-MON-YYYY)
7
To Enter a Date and if we are not in need of Value Set
Number : Click on LOV in Value Set and search by typing %Num%
Char : Click on LOV in Value Set and search by typing %CHAR%
DateTime : Click on LOV in Value Set and search by typing %Stan%Date%
8
Query to Check for Concurrent and the info about the Log file
select cp.plsql_dir, cp.plsql_out, cp.plsql_log
from fnd_concurrent_requests cr, fnd_concurrent_processes cp
where cp.concurrent_process_id = cr.controlling_manager — and cr.request_id = <running request id>
Till now we have created a Executable and Concurrent Program. Now our Objective is to attach inside a request group to run the concurrent.
Step : 4 → Assign the registered Concurrent Program to a request group
Now select a responsibility for which the concurrent has to run and that responsibility has the Request set. We have to make sure that we attach the concurrent program to the responsibility. I have chosen the Responsibility as Global HRMS Manager. Now when you query it you will get the Request group as shown in the below screenshot.
The Navigation is
System Administrator –> Security –> Responsibility → Define
9
Now you have to attach this to a Request Group and make it run.
Get the Request group and attach you concurrent here.
The Navigation is
System Administrator –> Security –> Responsibility → Request
10
Now go to your Responsibility to run concurrent program.
Note:
When you are using your custom application it may not be in Data group(standard). You may not get it listed while searching in the submit request.
So Just go to the Below Navigation and check the responsibility Data group. In the below screen shot it is above the marking. The mark represents the Request group and top of it si Data group. So if your application is in Data group then you can see in Request Group.
Refer till two below screen shots.
11
To add to Request group go to the Data group and Query the attached name. In my case it is standard.
12
Note over
13
Submit a new Request and run your concurrent. Here you may be prompted the parameter. Just Remember we had three parameters and we disabled the one so now we got two left.
14
15
After submission we get the Request Id for our reference.
16
Now we have our output. We can view the output but ours is a procedure so there will be nothing. But we can view the log whether this program worked or not.

Register Custom Application In Oracle Applications

As a standard practice when ever you need to write custom code/forms/reports in Oracle Applications you must put then under custom application TOP. This is to avoid impact of patching on custom objects. If we put custom object under stand TOP it might create issue and after patching it may start malfunctioning. If we have all custom code at one place it easy to maintain as we know exactly how many custom objects we have and where they are.
Before staring you need to first decide what should be your application name and short name. Here we go ....
SCHEMA NAME    : C_APPS
TOP NAME       : C_APPS_TOP
Application    : Custom Application
Data Group     : Standard
Request Group  : Custom Request Group
#1 – Create directory under application top
  • Login to Application Server and Source the environment variable. 
    login as: oracle
    oracle@192.168.56.200's password:
    Last login: Sun Feb  2 12:53:38 2014 from 192.168.56.1
    [oracle@ebsapp ~]$ 
    [oracle@ebsapp ~]$ pwd
    /home/oracle
    [oracle@ebsapp ~]$ . /u01/E-BIZ/apps/apps_st/appl/APPSVIS_ebsapp.env
    [oracle@ebsapp ~]$ cd $APPL_TOP
    [oracle@ebsapp appl]$ pwd
    /u01/E-BIZ/apps/apps_st/appl
    [oracle@ebsapp appl]$
  • Create following directories under APPL_TOP
    mkdir c_apps 
    mkdir c_apps/12.0.0 
    mkdir c_apps/12.0.0/admin 
    mkdir c_apps/12.0.0/admin/sql 
    mkdir c_apps/12.0.0/admin/odf 
    mkdir c_apps/12.0.0/sql 
    mkdir c_apps/12.0.0/bin 
    mkdir c_apps/12.0.0/reports 
    mkdir c_apps/12.0.0/reports/US 
    mkdir c_apps/12.0.0/forms 
    mkdir c_apps/12.0.0/forms/US 
    mkdir c_apps/12.0.0/lib 
    mkdir c_apps/12.0.0/out 
    mkdir c_apps/12.0.0/log
#2 – Create an entry to the application tier Context File
  • Modify Context File as Follows
    Sample Entry
    <AD_TOP oa_var="s_adtop" oa_type="PROD_TOP" oa_enabled="TRUE">/u01/E-BIZ/apps/apps_st/appl/ad/12.0.0</AD_TOP>
    New Entry
    <C_APPS_TOP oa_var="s_asftop" oa_type="PROD_TOP" oa_enabled="FALSE">/u01/E-BIZ/apps/apps_st/appl/c_apps/12.0.0</C_APPS_TOP>
#3 – Stop Application Services
  • Execute the script - adstpall.sh
    [oracle@ebsapp appl]$ cd $ADMIN_SCRIPTS_HOME
    [oracle@ebsapp scripts]$ sh adstpall.sh apps/apps
    
    You are running adstpall.sh version 120.10.12010000.4
    
    The logfile for this session is located at /u01/E-BIZ/inst/apps/VIS_ebsapp/logs/appl/admin/log/adstpall.log
    Executing service control script:
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/jtffmctl.sh stop
    ****************************************************
    Executing service control script:
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adcmctl.sh stop
    ****************************************************
    You are running adcmctl.sh version 120.17.12010000.5
    
    Shutting down concurrent managers for VIS ...
    ORACLE Password:
    Submitted request 5821348 for CONCURRENT FND SHUTDOWN
    adcmctl.sh: exiting with status 0
    ****************************************************
    Executing service control script:
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adoafmctl.sh stop
    
    *********
    *********
    *********
    All enabled services on this node are stopped.
    
    adstpall.sh:Exiting with status 0
    adstpall.sh: check the logfile /u01/E-BIZ/inst/apps/VIS_ebsapp/logs/appl/admin/log/adstpall.log for more information ...
    
    [oracle@ebsapp scripts]$
#4 – Run Autoconfig
  • Execute the script adautocfg.sh
    [oracle@ebsapp scripts]$ sh adautocfg.sh
    Enter the APPS user password:
    
    The log file for this session is located at: /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/log/02021607/adconfig.log
    
    AutoConfig is configuring the Applications environment...
    AutoConfig will consider the custom templates if present.
     Using CONFIG_HOME location : /u01/E-BIZ/inst/apps/VIS_ebsapp
     Classpath                  : /u01/E-BIZ/apps/apps_st/comn/java/lib/appsborg2.zip:/u01/E-BIZ/apps/apps_st/comn/java/classes
     Using Context file         : /u01/E-BIZ/inst/apps/VIS_ebsapp/appl/admin/VIS_ebsapp.xml
    
    Context Value Management will now update the Context file
            Updating Context file...COMPLETED
            Attempting upload of Context file and templates to database...COMPLETED
    
    Configuring templates from all of the product tops...
            Configuring AD_TOP........COMPLETED
            Configuring FND_TOP.......COMPLETED
            Configuring ICX_TOP.......COMPLETED
            Configuring MSC_TOP.......COMPLETED
            Configuring IEO_TOP.......COMPLETED
            Configuring BIS_TOP.......COMPLETED
            Configuring AMS_TOP.......COMPLETED
            Configuring CCT_TOP.......COMPLETED
            Configuring WSH_TOP.......COMPLETED
            Configuring CLN_TOP.......COMPLETED
            Configuring OKE_TOP.......COMPLETED
            Configuring OKL_TOP.......COMPLETED
            Configuring OKS_TOP.......COMPLETED
            Configuring CSF_TOP.......COMPLETED
            Configuring IGS_TOP.......COMPLETED
            Configuring IBY_TOP.......COMPLETED
            Configuring JTF_TOP.......COMPLETED
            Configuring MWA_TOP.......COMPLETED
            Configuring CN_TOP........COMPLETED
            Configuring CSI_TOP.......COMPLETED
            Configuring WIP_TOP.......COMPLETED
            Configuring CSE_TOP.......COMPLETED
            Configuring EAM_TOP.......COMPLETED
            Configuring FTE_TOP.......COMPLETED
            Configuring ONT_TOP.......COMPLETED
            Configuring AR_TOP........COMPLETED
            Configuring AHL_TOP.......COMPLETED
            Configuring OZF_TOP.......COMPLETED
            Configuring IES_TOP.......COMPLETED
            Configuring CSD_TOP.......COMPLETED
            Configuring IGC_TOP.......COMPLETED
    
    AutoConfig completed successfully.
    [oracle@ebsapp scripts]$
#5 – Start Application Services
  • Execute the script adstrtal.sh
    [oracle@ebsapp scripts]$ sh adstrtal.sh apps/apps
    
    You are running adstrtal.sh version 120.15.12010000.3
    
    The logfile for this session is located at /u01/E-BIZ/inst/apps/VIS_ebsapp/logs/appl/admin/log/adstrtal.log
    Executing service control script:
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adopmnctl.sh start
    
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adalnctl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adapcctl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adoacorectl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adformsctl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adoafmctl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/adcmctl.sh start
    ****************************************************
    /u01/E-BIZ/inst/apps/VIS_ebsapp/admin/scripts/jtffmctl.sh start
    
    
    All enabled services for this node are started.
    
    adstrtal.sh: Exiting with status 0
    
    adstrtal.sh: check the logfile /u01/E-BIZ/inst/apps/VIS_ebsapp/logs/appl/admin/log/adstrtal.log for more information ...
    
    [oracle@ebsapp scripts]$
#6 – Validate The Directory
  • Logout from the current session and log back in. Validate if the directory is created or not.
    login as: oracle
    oracle@192.168.56.200's password:
    Last login: Sun Feb  2 15:24:22 2014 from 192.168.56.1
    [oracle@ebsapp ~]$ . /u01/E-BIZ/apps/apps_st/appl/APPSVIS_ebsapp.env
    [oracle@ebsapp ~]$ echo $C_APPS_TOP
    /u01/E-BIZ/apps/apps_st/appl/asf/12.0.0
    [oracle@ebsapp ~]$
#7 – Create Tablespace
  • Login as SYSTEM / SYSDBA to create tablespace. You can also use any other user who has grant to create tablespace.
    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 
    Connected as SYSTEM
    SQL> 
    SQL> create tablespace C_APPS datafile '/u01/E-BIZ/db/apps_st/data/c_apps.dbf'
      2  size 10M
      3  autoextend on next 10M
      4  maxsize 100M
      5  ;
    Tablespace created
    SQL> 
#8 – Create Schema
  • Schema Creation
    SQL> 
    SQL> create user c_apps identified by c_apps
      2  default tablespace C_APPS
      3  temporary tablespace temp
      4  quota unlimited on C_APPS;
    User created
    SQL> grant connect, resource to C_APPS;
    Grant succeeded
    SQL> 
#9 – Register Custom Schema in Application
  • Navigate to System Administrator –> Application –> Register
  • Application : Custom Application
  • Shot Name : C_APPS
  • Basepath : C_APPS_TOP
Image 024 Image 025
#10 – Register Oracle User in Application
  • Navigate to System Administrator –> Security –> Oracle –> Register
  • Database User Name : C_APPS (Name of the database user, Should be same user that we create earlier)
  • Password : c_apps (Password for database user, must be same password as we set while creation of user)
  • Privilege : Select valid privilege from LOV
    • Enabled : An enabled ORACLE username has full privileges (insert, query, update, and delete) to the database tables.
    • Restricted : A restricted ORACLE username has only query privileges to the database tables.
    • Disabled : No privileges to access database tables.
  • Install Group : Represent group of installation where 1 represent first group of installation , 2 represent second group of installation.. For custom application this field for reference only, currently not used any where.
Image 026 Image 028
#11 – Adding Application to Data Group
  • Navigate to System Administrator –> Security –> Oracle –> Data Group
  • Query for ‘Standard’ Data Group
  • Add the Custom Application and associate with APPS user.
Image 029 Image 030
#12 – Create Request Group
  • Navigate to System Administrator –> Responsibility –> Request
  • Group : Custom Request Group
  • Application : Custom Application
  • Code : C_APPS
  • Description : Custom Request Group
Image 031 Image 032

How To Bounce Apache Server in Oracle E-Business R12

Generally in day to days usage of Oracle Apps R12 we came up many issue which is resolved by bouncing Apache Server like :-
 - JSP page not loading
 - Changes in are not appearing after done with personalization
 - Some weird java error.
Its really easy to get this done and not a big mans job any more.

#1 Login to Unix prompt with right privilege that can let you stop and start the services. Source and the environment variable.
login as: invincibleapps
Using keyboard-interactive authentication.
Enter your PASSWORD:
Last login: Sun Sep  8 17:36:19 2013
You are now pointed to invincibleapps Apps environment
[invincibleapps@dev ~]$ . /d01/appldev/invincibleapps/apps/apps_st/appl/APPSinvincibleapps_dev.env
[invincibleapps@dev ~]$
#2 Move to directory $INST_TOP and go inside admin/scripts
[invincibleapps@dev ~]$ cd $INST_TOP
[invincibleapps@dev ~]$ cd admin/scripts
[invincibleapps@dev scripts]$

#3 Execute the command
[invincibleapps@dev scripts]$ sh adapcctl.sh stop
[invincibleapps@dev scripts]$ sh adapcctl.sh start

You are running adapcctl.sh version 120.7.12010000.2

Starting OPMN managed Oracle HTTP Server (OHS) instance ...
opmnctl: starting opmn managed processes...

adapcctl.sh: exiting with status 0

Register Custom Tables in Oracle Apps

All you technical people out there very well know the purpose of creating custom table. Its basically when we need to store data before pulling into standard table (In case of inbound interface) or putting extract of data to share with external entity (In case of outbound interface). All these activities can be accomplished without registering custom table in oracle apps.

If you have a need to use these custom tables in standard functionality in frond end like using in Alerts / Audits, you must register them. Otherwise your custom table will not be visible in front end.
Lets start this by creating a sample custom table.
Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 
Connected as c_apps
 
SQL> 
SQL> CREATE TABLE C_FND_INTERFACES
  2  ( INTERFACE_ID            NUMBER               NOT NULL PRIMARY KEY,
  3    SERVICE_CHANNEL         VARCHAR2(64 BYTE)    NOT NULL,
  4    SOURCE                  VARCHAR2(64 BYTE) NOT NULL,
  5    ATTRIBUTE1              VARCHAR2(2000 BYTE),
  6    ATTRIBUTE2              VARCHAR2(2000 BYTE),  7    ATTRIBUTE3              VARCHAR2(2000 BYTE),
  8    ATTRIBUTE4              VARCHAR2(2000 BYTE),
  9    ATTRIBUTE5              VARCHAR2(2000 BYTE),
 10    ATTRIBUTE6              VARCHAR2(2000 BYTE),
 11    ATTRIBUTE7              VARCHAR2(2000 BYTE),
 12    ATTRIBUTE8              VARCHAR2(2000 BYTE),
 13    ATTRIBUTE9              VARCHAR2(2000 BYTE),
 14    ATTRIBUTE10             VARCHAR2(2000 BYTE),
 15    STATUS                  VARCHAR2(50 BYTE)    NOT NULL,
 16    ERROR_MESSAGE           VARCHAR2(2000 BYTE),
 17    CREATED_BY              NUMBER               NOT NULL,
 18    CREATION_DATE           DATE                 NOT NULL,
 19    LAST_UPDATED_BY         NUMBER               NOT NULL,
 20    LAST_UPDATE_DATE        DATE                 NOT NULL,
 21    REQUEST_ID              NUMBER,
 22    BATCH_ID                NUMBER
 23  )
 24  TABLESPACE C_APPS
 25  PCTUSED    0
 26  PCTFREE    10
 27  INITRANS   1
 28  MAXTRANS   255
 29  STORAGE    (
 30              INITIAL          64K
 31              NEXT             1M
 32              MINEXTENTS       1
 33              MAXEXTENTS       UNLIMITED
 34              PCTINCREASE      0
 35              BUFFER_POOL      DEFAULT
 36             )
 37  LOGGING
 38  NOCACHE
 39  NOPARALLEL
 40  /
 
Table created
 
SQL> 

You would have noticed that table is created under custom schema. Make sure you create synonym under APPS schema.

There are 4 steps involved in registering table in Oracle Applications

#1 - Register Table
ad_dd.register_table 
(p_appl_short_name IN VARCHAR2, -- Application Short Name
 p_table_name      IN VARCHAR2, -- Table Name
 p_table_type      IN VARCHAR2, -- Table Type. Use 'T' if transaction table. 'S' for seed data table.
 p_next_extent     IN NUMBER DEFAULT 512,
 p_pct_free        IN NUMBER DEFAULT 10, -- % of space in each of the table block reserved for future updates(1-99)
 p_pct_used        IN NUMBER DEFAULT 70) -- MINimum percentage of used space IN each data block of the table (1-99)
                                       ; -- The sum of p_pct_free and p_pct_used must be less than 100
Sample Script
EXECUTE ad_dd.register_table 
(p_appl_short_name =>  'C_APPS',
 p_table_name      =>  'C_FND_INTERFACES',
 p_table_type      =>  'T',
 p_next_extent     =>  512,
 p_pct_free        =>  10,
 p_pct_used        =>  70);
                             
#2 - Register Column
ad_dd.register_column
(p_appl_short_name IN VARCHAR2, -- Application Short Name
 p_table_name      IN VARCHAR2, -- Table Name
 p_column_name     IN VARCHAR2, -- Column Name
 p_column_seq      IN NUMBER,   -- Sequence NUMBER of Column in table
 p_column_type     IN VARCHAR2, -- Column Type ('NUMBER', 'VARCHAR2', 'DATE', etc.).
 p_column_width    IN NUMBER,   -- Colum Size,Can use 9 for DATE columns, 38 for NUMBER columns
 p_nullable        IN VARCHAR2, -- Use 'N' if mandatory or 'Y' if it allows null values
 p_translate       IN VARCHAR2, -- 'N' if the values are not translated
 p_precision       IN NUMBER DEFAULT NULL, -- NUMBER of digits in a NUMBER    
 p_scale           IN NUMBER DEFAULT NULL);-- NUMBER of digits to the right of the decimal point
Sample Script
EXECUTE ad_dd.register_column
(p_appl_short_name =>   'C_APPS'
 p_table_name      =>   'C_FND_INTERFACES'
 p_column_name     =>   'interface_id'
 p_column_seq      =>   'c_fnd_interfaces_seq'
 p_column_type     =>   NUMBER
 p_column_width    =>   10
 p_nullable        =>   'N'
 p_translate       =>   'N'
 p_precision       =>   NULL
 p_scale           =>   NULL);
#3 - Register Primary Key
ad_dd.register_primary_key
(p_appl_short_name IN VARCHAR2,  -- Application Short Name
 p_key_name        IN VARCHAR2,  -- Primary Key Name
 p_table_name      IN VARCHAR2,  -- Table Name
 p_description     IN VARCHAR2,  -- Primary key Description
 p_key_type        IN VARCHAR2,  -- (D/S)Developer/Surrogate,DEFAULTs to null
 p_audit_flag      IN VARCHAR2,  -- (Y/N)DEFAULTs to null
 p_enabled_flag    IN VARCHAR2); -- (Y/N)DEFAULTs to null
Sample Script
EXECUTE ad_dd.register_primary_key
(p_appl_short_name =>   'C_APPS',
 p_key_name        =>   'INTERFACE_ID_PK',
 p_table_name      =>   'C_FND_INTERFACES',
 p_description     =>   'Interface ID Primary Key',
 p_key_type        =>   'S',
 p_audit_flag      =>   'Y',
 p_enabled_flag    =>   'Y');
#4 - Register Primary Key Column
ad_dd.register_primary_key_column
(p_appl_short_name IN VARCHAR2,
 p_key_name        IN VARCHAR2,
 p_tab_name        IN VARCHAR2,
 p_col_name        IN VARCHAR2,
 p_col_sequence    IN NUMBER);
Sample Script
EXECUTE ad_dd.register_primary_key_column
(p_appl_short_name =>  'C_APPS',
 p_key_name        =>  'INTERFACE_ID_PK',
 p_tab_name        =>  'C_FND_INTERFACES',
 p_col_name        =>  'INTERFACE_ID',
 p_col_sequence    =>  '1');
Let’s go and validate in application.
Navigate to Application Developer –> Application –> Database –> Table
F11 –> Enter your table_name ‘C_FND_INTERFACES’ –> Ctrl + F11.