Anil's Blog is Best Viewed on GOOGLE CHROME

Friday, March 4, 2016

Controller Extension in R12.2.x

Deploying Customizations in Oracle E-Business Suite Release 12.2

This article describes how to deploy customizations in an Oracle E-Business Suite Release 12.2 environment.

A little bit background before we move onto the exact steps required to move the customization.

An Oracle E-Business Suite Release 12.2 installation now includes two editions (versions) of the application code and seed data.

The "Run Edition" is the code and data used by the running application. As a developer, you will connect to the Run Edition whenever you are engaged in normal development activity on the system.

The "Patch Edition" is an alternate copy of Oracle E-Business Suite code and seed data that is updated by Online Patching. End users cannot access the Oracle E-Business Suite Patch Edition, but as a developer you may need to connect to the Patch Edition of a system when applying patches or debugging problems with Online Patch execution.

The Oracle E-Business Suite application-tier files are installed in a base directory of the customer's choosing. Within that base directory you will now find three important sub-directories:

fs1 - file system 1 (either run or patch edition)
fs2 - file system 2 (alternate of file system 1)
fs_ne - non-editioned file system, for data files

The fs1 and fs2 directories contain the Run Edition and Patch Edition files for Oracle E-Business Suite. The "run" and "patch" file system designation will switch back and forth between fs1 and fs2 for each patching cycle.

Connecting to the Run Edition

Oracle E-Business Suite Release 12.2.2 and higher includes a script to set the run or patch edition environment by edition type. The script is called "EBSapps.env" and is found in the base directory of an Oracle E-Business Suite application-tier installation.

Login to Putty:-

1. Connect to the run edition file system on your development environment. Run EBSapps.env to find the run instance.

$ source /u01/R122_EBS/EBSapps.env run

E-Business Suite Environment Information
RUN File System : /u01/R122_EBS/fs2/EBSapps/appl
PATCH File System : /u01/R122_EBS/fs1/EBSapps/appl
Non-Editioned File System : /u01/R122_EBS/fs_ne
DB Host: Service/SID: gbzd122x

 Here you can see that FS2 is the RUN instance so we have to move our Controller/View Object/Any Java/Xml file to FS2.

cd /u01/R122_EBS/fs2/EBSapps/appl
cd $JAVA_TOP/xx_top/oracle/apps/fnd/framework/webui/

As an instance I am moving xxEmpCo (Controller) file to above path. Once files is moved you can run JAVAC to compile the JAVA file.

2. After you copy any custom files under the $JAVA_TOP directory, run the adcgnjar utility.
The adcgnjar utility does not require any parameters on the command line. When prompted, enter the user name and password of the APPS user.

3.Stop & Start managed servers using using the command. When prompted enter the weblogic password.

$ $ADMIN_SCRIPTS_HOME stop oacore_server1
$ $ADMIN_SCRIPTS_HOME start oacore_server1

Note : If for any reason you have modified seeded .JSP/XML/JAVA file the we need to run "Generate product JAR files" from adadmin which will regenerate product jar files for Oracle applications.

We use the adcgnjar utility for any custom Java or BC4J code for Oracle Application Framework, Oracle CRM Technology Foundation (JTT), Oracle Web Applications Desktop Integrator (BNE), custom servlets, or other custom Java code. This utility generates and signs a file named customall.jar file containing the custom Java and BC4J code and extensions.


Dynamic View Object through Personalization | R12.2 New Feature

               Create View Object through Personalization

This post will help you to understand on how we can create a view object with the help of OAF personalization.

1. Set 'Personalize Self-Service Defn' & 'FND: Personalization Region Link Enabled' Profile options so that you can get the personalization link.

2. In R12.2 we get the personalize link through the Setting icon as seen below.

3. Then navigate to any oaf page and click on 'Personalize Page' and then click on 'Model Personalization'

 4. Click on create button to create a Dynamic View Object. We can only create a dynamic read-only view instance that encapsulates a database query, to the root application module of the current OA Framework-based page.

Once you create a new dynamic view instance, you can also enable, disable, or delete the view instance, or delete the model personalization from the root application module.

5. Now specify a name for the view instance and enter the SQL query for the view instance.

 6. Select Apply to save the changes.

 7.  Then I have created a Advance Table and three columns through personalization only to see the data which I have defined in above view object. Columns are - User Name,

 8.  Now as per below screenshots you can see that a view only table region get added to existing OAF page and also it is showing the data.


Sunday, January 11, 2015

Integrate XML Publisher Report with OAF

In this example we are going to integrate a simple XML publisher report with OAF. The business scenario is something like that we have a OAF page and on click of "Print" button we want to call a XML publisher report.

1. Create a OAF page with table region and print button to call a XML publisher report.

2. Designed XML report template. here I have not mentioned steps to register the XML report in Oracle apps.

Controller Code
Here we are handling the print button action and calling the XML report.
    public void processFormRequest(OAPageContext pageContext, 
                                   OAWebBean webBean) {
        super.processFormRequest(pageContext, webBean);
        if (pageContext.getParameter("Print") != null) {

            System.out.println("Print Button clicked");

            printReport(pageContext, webBean, "pdf");


    public void printReport(OAPageContext pageContext, OAWebBean webBean, 
                            String outputType) {

        OAApplicationModule lo_am = pageContext.getApplicationModule(webBean);
        String ls_extensionType = "pdf"; //Setting the output extension type
        byte l_outputType = 0;
        l_outputType = TemplateHelper.OUTPUT_TYPE_PDF;

        DataObject lo_sessionDictionary = 
        HttpServletResponse lo_response = 
        try {
            ServletOutputStream lo_outputStream = 

            // setting the report name & output type
            String lo_contentDisposition = 
                "attachment;filename=OrderDetails." + ls_extensionType;

            System.out.println("Calling XML generation method");

            XMLNode xmlNode = 
            // Calling getOrderReportDetailsXML method to get the XML for the VO query

            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

            System.out.println("After calling XML generation method" + 
            //Above sop will return the XML output which will help you in designing the template.
            ByteArrayInputStream lo_inputStream = 
                new ByteArrayInputStream(outputStream.toByteArray());
            ByteArrayOutputStream lo_outputFile = new ByteArrayOutputStream();
            // Pass the Template code and Application short name
            try {
                                               "PA", "XX_ORDER_DT", 
                                               lo_inputStream, l_outputType, 
                                               null, lo_outputFile);

            } catch (XDOException xe) {
                throw new OAException("Exception:" + xe.getMessage());


            byte[] l_bytes = lo_outputFile.toByteArray();

            lo_outputStream.write(l_bytes, 0, l_bytes.length);
        } catch (Exception e) {
            throw new OAException(e.getMessage(), OAException.ERROR);


Application Module Code

 This method will return the XML output of the VO query attached to the page.

   public XMLNode getOrderReportDetailsXML() {
        //XMLNode lo_xmlNode;
       System.out.println("Inside the AM Method");
        OrderReportDetailsVOImpl vo = getOrderReportDetailsVO1();
          XMLNode  lo_xmlNode = (XMLNode)vo.writeXML(-1, 0L);

//OL Stands for XMLInterface.XML_OPT_ALL_ROWS which means to includes all rows in the view object's row set in the XML.

        return lo_xmlNode;

Report Output