Saturday 4 June 2016

Calling XDO Data Engine... java.lang.NullPointerException

XDO Data Engine Version No: 5.6.3
Resp: 20420
Org ID : 204
Request ID: 5917401
All Parameters: p_OrgId=2:p_VendorId=144
Data Template Code: INV
Data Template Application Short Name: XDO
Debug Flag: N
{p_VendorId=144, p_OrgId=2}
Calling XDO Data Engine...
java.lang.NullPointerException
at oracle.apps.xdo.oa.util.DataTemplate.getDataTemplate(DataTemplate.java:379)
at oracle.apps.xdo.oa.util.DataTemplate.(DataTemplate.java:226)
at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:283)
at oracle.apps.fnd.cp.request.Run.main(Run.java:157)



The reason for this issue is that your Concurrent Program Short name and the Data Definition code are not same.

In my case both the values were same however in concurrent program is was "INV" and in the Data definition code it was "inv"

It is very important that the Concurrent program short name and the Data definition code Should match exactly with case otherwise you will find this issue.

Now in order to resolve this issue you go to your data definition and specify an end date for the data definition and save the changes. This will invalidate the data definition.


Trial Balance detail Report in Oracle Apps

Query to get the Trial Balace Detail Report is given below. We can also cross check the same with Account Analysis Report.
The Below query is taking by the seeded view GL_JE_JOURNAL_LINES_V.
SELECT
gccv.concatenated_segments
,ffvv.DESCRIPTION
,b.default_period_name PERIOD_NAME,
ps.period_year PERIOD_YEAR
,lr.SLA_LEDGER_ID
,b.name BATCH_NAME,
h.name HEADER_NAME,
h.je_source JE_SOURCE,
h.je_category JE_CATEGORY,
DECODE (lr.relationship_type_code,
‘BALANCE’, NULL,
lines.accounted_dr)
LINE_ACCOUNTED_DR,
DECODE (lr.relationship_type_code,
‘BALANCE’, NULL,
lines.accounted_cr)
LINE_ACCOUNTED_CR,
lines.description LINE_DESCRIPTION,
lr.target_ledger_name LEDGER_NAME,
lr.target_currency_code LEDGER_CURRENCY
FROM   gl_period_statuses ps,
gl_je_lines lines,
gl_je_headers h,
gl_je_batches b,
gl_ledger_relationships lr,
gl_code_combinations_kfv gccv,
fnd_flex_values_vl ffvv
WHERE   lr.source_ledger_id = lr.target_ledger_id
AND lr.application_id = 101
AND b.average_journal_flag = ‘N’
AND b.je_batch_id = h.je_batch_id
AND lines.code_combination_id in (select code_combination_id from gl_code_combinations_kfv where segment1 between :seg1low and :seg1high  and segment3 between :seg3low and :seg3high)
AND b.actual_flag = ‘A’
AND h.je_header_id = lines.je_header_id
AND h.ledger_id = lr.source_ledger_id
AND lines.period_name = ps.period_name
AND ps.ledger_id = lines.ledger_id
AND b.default_period_name between :p_period_start_name and :p_period_end_name
AND ps.application_id = 101
and gccv.code_combination_id = lines.code_combination_id
and ffvv.flex_value =  gccv.segment3

Getting Code Combination ID using fnd_flex_ext.get_ccid

Sometimes for Retrival of the Code Combinations the view(gl_code_combinations_kfv) will not be enough. We need a function to get the value so at that time we can use fnd_flex_ext.get_ccid to get the Code Combination.
select fnd_flex_ext.get_ccid(
‘SQLGL’, –Application Short Name
‘GL#’, –key_flex_code
50357, –structure_number   => this value we can obtain from this Query –select chart_of_accounts_id from gl_sets_of_books where set_of_books_id = 2021;
sysdate, –Validation Date
’01-00-11113-001-00-00′ –Concatenated Segments
) from dual;

Concurrent Request Completed with Warning

We are facing Issue while running report in TEST Instance.

Below is the Screenshot.
Completed Warning
While Checking the log
Log file Info

And by the Checking the OPP log file for the concurrent Program Im getting this as below
The Log file’s Location can be found by this Query
SELECT fcpp.concurrent_request_id req_id, fcp.node_name, fcp.logfile_name
FROM fnd_conc_pp_actions fcpp, fnd_concurrent_processes fcp
WHERE fcpp.processor_id = fcp.concurrent_process_id
AND fcpp.action_type = 6
AND fcpp.concurrent_request_id = <request_id>;
OPP file info
After doing some search I got this to Restart the OPP
– Log on to System Administrator Responsibility
– Navigate to Concurrent > Manager > Administer
– Scroll down and look for “Output Post Processor”
– Click on Activate
OPP Restarting
As the  Error is telling the about the path so to check the OPP path
Navigation
XML Publisher Responsibility –> Admisitration
Check the Below screenshot for the path defined
OPP path in Oracle apps
Once this is done now the report works correctly.

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