iExpenses OAF Customizations Document

141
TABLE OF CONTENTS DOCUMENT CONTROL....................................................2 OBJECTIVE..........................................................5 PRE REQUISITE...................................................... 5 DOCUMENT USAGE......................................................5 D2K FORM COMPARISON WITH OA FRAME WORK PAGES..........................11 JDEVELOPER SETUP USING WINDOWS:......................................17 IEXPENSES OBJECTS:................................................. 23 1. ADDING THE ADDITIONAL FIELD (DESCRIPTION) ON GENERAL INFORMATION PAGE:. .23 1.1 BEFORE CUSTOMIZATION............................................24 1.2 AFTER CUSTOMIZATION.............................................24 1.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:...........25 1.4 PROGRAM LOGIC:................................................26 1.5 TRAIN........................................................ 29 1.6 HOW TO IDENTIFY THE CONTROLLERS AND VIEW OBJECTS BEHIND THAT PAGE:...31 1.7 STEPS TO EXTEND THE VO.........................................33 1.8 STEPS TO SUBSTITUTE THE VO......................................41 1.9 STEPS TO CREATE CUSTOM CO:......................................47 1.10 PROGRAM LOGIC IN XXAPHEADERCO..................................49 1.11 SETUP....................................................... 51 2. PROJECT AND TASK NUMBERS ARE MANDATORY.............................56 2.1 BEFORE CUSTOMIZATION............................................57 2.2 AFTER CUSTOMIZATION.............................................58 2.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:...........59 2.5 PROGRAM LOGIC IN XXAPHEADERCO...................................65 2.6 SETUP........................................................ 66 3. INDIRECT PROJECTS LOV........................................... 68 3.1 BEFORE CUSTOMIZATION............................................69 3.2 AFTER CUSTOMIZATION.............................................69 3.2 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:...........70 3.4 SETUP........................................................ 79 4. DEFAULTING PROJECT AND TASK NUMBER AT REPORT LINE LEVEL..............80 4.1 BEFORE CUSTOMIZATION............................................81 4.2 AFTER CUSTOMIZATION.............................................82 4.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:...........84 4.4 LOGIC TO IMPLEMENT IN XXAPCASHANDOTHERCO..........................86

Transcript of iExpenses OAF Customizations Document

Page 1: iExpenses OAF Customizations Document

TABLE OF CONTENTS

DOCUMENT CONTROL...........................................................................................................................2OBJECTIVE.............................................................................................................................................5PRE REQUISITE......................................................................................................................................5DOCUMENT USAGE...............................................................................................................................5D2K FORM COMPARISON WITH OA FRAME WORK PAGES................................................................11JDEVELOPER SETUP USING WINDOWS:..............................................................................................17IEXPENSES OBJECTS:...........................................................................................................................231. ADDING THE ADDITIONAL FIELD (DESCRIPTION) ON GENERAL INFORMATION PAGE:...................231.1 BEFORE CUSTOMIZATION..............................................................................................................241.2 AFTER CUSTOMIZATION................................................................................................................241.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:......................................251.4 PROGRAM LOGIC:..........................................................................................................................261.5 TRAIN............................................................................................................................................291.6 HOW TO IDENTIFY THE CONTROLLER’S AND VIEW OBJECT’S BEHIND THAT PAGE:.....................311.7 STEPS TO EXTEND THE VO............................................................................................................331.8 STEPS TO SUBSTITUTE THE VO.....................................................................................................411.9 STEPS TO CREATE CUSTOM CO:...................................................................................................471.10 PROGRAM LOGIC IN XXAPHEADERCO.....................................................................................491.11 SETUP..........................................................................................................................................512. PROJECT AND TASK NUMBERS ARE MANDATORY..........................................................................562.1 BEFORE CUSTOMIZATION..............................................................................................................572.2 AFTER CUSTOMIZATION................................................................................................................582.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:......................................592.5 PROGRAM LOGIC IN XXAPHEADERCO........................................................................................652.6 SETUP............................................................................................................................................663. INDIRECT PROJECTS LOV...............................................................................................................683.1 BEFORE CUSTOMIZATION..............................................................................................................693.2 AFTER CUSTOMIZATION................................................................................................................693.2 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:......................................703.4 SETUP............................................................................................................................................794. DEFAULTING PROJECT AND TASK NUMBER AT REPORT LINE LEVEL............................................804.1 BEFORE CUSTOMIZATION..............................................................................................................814.2 AFTER CUSTOMIZATION................................................................................................................824.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:......................................844.4 LOGIC TO IMPLEMENT IN XXAPCASHANDOTHERCO.................................................................864.4 SETUP............................................................................................................................................895. CAPTURE ATTENDEE INFORMATION...............................................................................................915.1 BEFORE CUSTOMIZATION..............................................................................................................925.2 AFTER CUSTOMIZATION................................................................................................................935.3 HOW TO ACHIEVE THIS FUNCTIONALITY USING OAF CUSTOMIZATION:......................................935.4 SETUP............................................................................................................................................966. BUSINESS RULE JUSTIFICATION......................................................................................................986.1 BEFORE CUSTOMIZATION..............................................................................................................99

Page 2: iExpenses OAF Customizations Document

6.2 AFTER CUSTOMIZATION..............................................................................................................1006.3 HOW WE ACHIEVE THIS REQUIREMENT USING OAF:................................................................1016.4 LOOKUPS FOR THIS REQUIREMENT.............................................................................................1036.5 LOGIC TO IMPLEMENT IN XXAPDETAILMAINCO......................................................................1056.6 SETUP..........................................................................................................................................1087. DEFAULTING ADDITIONAL CC DETAILS TO ER LINE DFF..........................................................1107.1 BEFORE CUSTOMIZATION............................................................................................................1117.2 AFTER CUSTOMIZATION..............................................................................................................1127.3 HOW WE ACHIEVE THIS REQUIREMENT USING OAF:................................................................1127.4 LOGIC TO IMPLEMENT IN XXAPDETAILMAINCO......................................................................1157.5 SETUP..........................................................................................................................................1188. AMEX LATE FEE TRANSACTIONS................................................................................................1218.1 BEFORE CUSTOMIZATION............................................................................................................1228.2 AFTER CUSTOMIZATION..............................................................................................................1228.3 HOW WE ACHIEVE THIS REQUIREMENT USING OAF:................................................................1238.4 LOGIC FOR THIS CUSTOMIZATION IN XXAPCCTRANSACTIONVO............................................1258.5 SETUP..........................................................................................................................................126

Bibliography...................................................................................................................................128

Page 3: iExpenses OAF Customizations Document

What is Oracle Application Development Framework (OAF)?

 The OA Framework Architecture is based on the J2EE MVC design pattern. The MVC architecture is a component-based design pattern with clean interfaces between the Model, View, and Controller. The Model is where the application implements its business logic. The View is where the application implements its user interface and the Controller is where the application handles user interaction and directs business flow.

Model-View-Controller (MVC) Architecture

Page 4: iExpenses OAF Customizations Document

Additionally OA framework also contains extensions to Oracle 9i JDeveloper called Oracle Applications Extension or the OA Extension. The Jdeveloper is an IDE client which allows you to do customizations and additions to the OA Framework.Oracle Applications Framework is also referred as OA Framework. OA Framework is a Java framework that excels at creating 3-tier web-based applications that link to an 11i Oracle Applications instance while maintaining all the security features of that 11i instance.

OA Framework makes a connection to the database using JDBC drivers.

An important significance of the OA framework model is that it facilitates the customization of existing out of box internet modules as well as it allows development of new Self Service Web Application modules.

As a result the OA Framework provides with benefits of Productivity, Scalability, and Customizability etc. though the OA Framework is J2EE based, it also used various industry standards like HTML, XML, Java, JSP, SQL and Web Services.

The Model –Data Processing

Business Services

Page 5: iExpenses OAF Customizations Document

The OAF Business Components technology provides declarative building-blocks you can use to implement scalable business services, data access objects, and business objects that enforce business rules and handle database persistence.

EO

BC4J Entity Object encapsulates business rules associated with a row in a database table (or view or synonym). EO Extensions are supported by OAFramework and they are upgrade safe. The OAF Model layer provides consistent, declarative data-binding against a multiple backend technologies accommodating business services implemented as ADF Application Modules, custom JavaBeans, EJB's, and Web Services.

VO

BC4J View Object encapsulates a database query. After a query is executed, a view object provides iteration over and access to its result set. VO extensions are supported by OA Framework and they are upgrade Safe. The OAF UIX technology provides declarative page definition and a rich UI component set for HTML and wireless UI's, complementing OAF support for JSP pages and JSP tag libraries like JSTL, Jakarta Struts, OAF Data Tags, and others. The OAF JClient layer dovetails with Swing to simplify building sophisticated rich client UI's.

AM

A BC4J Application Module is essentially a container that manages and provides access to "related" BC4J model objects. Oracle supports AM extensions except for Root Application Module (as per 11.5.10 - CU2). AM extensions are supported by OA Framework and they are upgrade safe. Not supporting root AM extensions is equivalent to not supporting AMExtensions in many cases as most of the standard pages have only root AM, but where ever page has got AMs defined at other levels AM extensions will be very much useful to extend business logic. Developer might think of different workarounds to extend AM. (Eg: Adding a dummy region to the page using personalizing and add custom AM to the newly added region.)

CO

Controller responds to user actions and directs application flow. Oracle says, "There is no guarantee that controller extensions will survive an upgrade. You should assume that they will not.” Developer can afford to extend a CO as long as they call corresponding super class method. Only possibility that this change will not be upgrade safe is if Oracle changes name of CO or package or both possibilities of which is very remote. Integrated support for Jakarta Struts allows data-binding and business services to work seamlessly with this popular controller-layer framework,

Page 6: iExpenses OAF Customizations Document

while the ADF Controller layer provides the option of a more sophisticated, fully-declarative page flow engine.

OA Framework architecture and key features

Personalization features, including:

The ability to hide and show page items and regions, reordering page items, adding new items, adding corporate branding.

Importing and exporting personalization’s with the Personalization Document Manager

New user interface for creating personalization’s

Matching the Release 12 colors and fonts to match your corporate website

Using simple expression (SPEL) bindings for more control over fields, items, and regions

 Extensibility features, including:

The ability to add new business logic to existing screens

Durability of extensions, allowing them to be preserved across upgrades

Use of Oracle JDeveloper 10g with OA Extension to support J2EE development and integration with Release 12

Support for service interfaces, standalone components that can be deployed as web services, EJB session beans, or as co-located Java APIs

OA Framework Architecture

Client Application Server Data Server

Page 7: iExpenses OAF Customizations Document

MDS

We know it means Meta Data Service. We also know that it has something to do with web page displayed in OA Framework. Let’s try to understand the basics of MDS.

Meta: - In technical world, Meta work symbolizes dictionary. Think of a web page broken into small units which are fields, buttons, and list boxes. These small individual units [fields, buttons etc] are stored in a dictionary, in the database. These units when combined together, they become a webpage that gets rendered on the browser.

Data: - Those Meta pieces are not stored as binary files, but as data in tables. Those tables begin with jdr, for example JDR_ATTRIBUTES, JDR_ATTRIBUTES_TRANS, JDR_COMPONENTS and JDR_PATHS. The definition and relationship of each field/region/component is stored in these JDR tables. OA framework reads that data when you request a page. The page structure is then built based on MetaData.

Service: - Meta Data is available as a service (plain service not webservice). The data is there in JDR tables, but all such data has to be co-related, all fields, regions, buttons etc have to be clubbed into a meaningful manner to make a web page. You can say that MDS provides service to store & return page definitions. MDS collates those definitions in components/fields in a meaningful manner to build a page.

These two below methods are available in the Default Controller class that gets created.

ProcessFormRequest (oapageContext, oawebBean)

This method is commonly used to react/respond to the event that has taken place, for example click of a button.

Some examples are

Page 8: iExpenses OAF Customizations Document

       if(oapagecontext.getParameter("Cancel") != null) {Do your processing for Cancellation/Rollback}       if(oapagecontext.getParameter("Submit") != null) {Do your validations and commit here}       if(oapagecontext.getParameter("Update") != null) {Do your validations and commit here}

In the above three examples, you could be calling oapagecontext.forwardImmediately to re-direct the page navigation to some other page if needed.

processRequest (pageContext, webBean)

In this method, usually page rendering related code is written. Effectively, each GUI component is a bean that gets initialized duringprocessRequest. Those who are familiar with D2K forms, something like pre-query may be written in this method.

D2K Form Comparison with OA Frame Work Pages

Following key Steps were needed for Hello World [<Jdeveloper_Install_Dir>\ JDeveloper\jdevdoc\index.htm]

Step 1.

Created a new Workspace and a new Project as dictated by Oracle's tutorial [<Jdeveloper_Install_Dir>\ JDeveloper\jdevdoc\index.htm].

When defining project, you will specify a default package, which in this case was oracle.apps.ak.hello this means the following: -  a. ak is the short name of the Application in Oracle [it means fnd_applications.short_name].  b. hello is the name of your project.

Step 2.

Next, you will create an OAPage within hello project.Think of OAPage as the fmx file itself in D2K. I am saying so because this page gets attached to the form function.a. This page will be created within hello project, hence the package name oracle.apps.ak.hello.webuib. Note the webui, it’s a convention to have page in webui, means this page represents the Web User Interfacec. You will assign the default AM [OAApplicationModule]. Think of AM "Connection

Page 9: iExpenses OAF Customizations Document

Manager" and "Transaction State Manager" for your page.I can't co-relate this to anything in D2k, as there is no concept of Connection Pooling and that D2k is not stateless. Reason being that as soon as you kick off a D2K Form, it connects to a single session of Oracle and sticks to that single Oracle database session. This is not the case in OAF, hence AM is needed.

Step 3.

You create Region within the Page.a. Region is what will store your fields. Text input fields will be of type messageTextInput. Think of Canvas in D2K [to an extent].b. You can have nested regions. Stacked Canvas in D2K comes close to this component of OA Framework.

Step 4.

Add a button to one of the nested regions.a. The itemStyle should be submitButton, in case you want the page to be submitted when this button is clicked.b. There is no WHEN-BUTTON-PRESSED trigger in OAF. In Framework, you will add a controller java code to handle events like Form Submit button clicks. JDeveloper generates the default code for you. Primarily two functions will be created processRequest[for UI Rendering Handling] and processFormRequest. Think of processRequest as WHEN-NEW-FORM-INSTANCE, though processRequest is very restrictive.

Step 5.

In the controller to access the value in field "HelloName" the command isString userContent = pageContext.getParameter ("HelloName");In D2k, we used :block.field. In OAFramework, at submission of page, all the field values get passed into to OAPageContext object.a. Use getParameter to access the field valueb. To set the value of the field, useOAMessageTextInputBean fieldHelloName =         (OAMessageTextInputBean) webBean.findChildRecursive ("HelloName");fieldHelloName.setText(pageContext,"Setting the default value" );Note when setting field value in controller:Note 1. Do not set the value in processFormRequestNote 2. If the field comes from ViewObject [in latter tutorials], then do not use setText in controller.Note 3. For control fields [that are not based on ViewObjects], you can use setText to assign values in processRequest method.

Let’s take some notes to expand beyond the Hello World Project:

Page 10: iExpenses OAF Customizations Document

1. In D2K-forms we sort of created a Window, attached to Canvas, and then fields within that Canvas.However in OA Framework, think of Page being fmx/Window, think of Region being a Canvas, and fields being within Regions.This is not a formal/accurate understanding of analogy between D2k and Framework, but is close to being logical.

2. In D2k, your Forms fmb file was compiled to fmx. It was fmx file that was deployed on mid-tier.In case of OAF, your OA Page is nothing but a XML file. We call this MDS [Meta data].Whatever name you give to "Page" in OAF, an XML file of the same name gets created. This xml file must then be loaded into database by using XMLImporter command.

3. Apart from MDS XML file, almost everything else is merely deployed to your mid-tier. Usually this is underneath $JAVA_TOP/oracle/apps/../..All your java files will go underneath java top/oracle/apps/../.. etc.

4. When building your tutorial, ignore the steps for setting "Attribute Sets". These are notMandatory. Oracle might just have developed their tutorials without including these. Think of these like Visual Attributes of D2K forms [to an extent]

5. Controller is where you will write any java code in OA Framework. You can create a Controller per Page or have a different Controller for each of the Regions with the same Page.

6. In the method processFormRequest of the Controller, you can access the values of the page by using notation pageContext.getParameter ("<fieldname here>"). This method processFormRequest is executed when the OAF Screen/Page is submitted by click of a button.

7. Inside the controller, all the Database Related interactions for example interaction with View Objects happens via Application Module. But why so?

Because Application Module manages the transaction state of the Application.            OAApplicationModuleImpl oaapplicationmoduleimpl = (OAApplicationModuleImpl) oapagecontext.getApplicationModule (oawebbean);OADBTransaction oadbtransaction = (OADBTransaction)oaapplicationmoduleimpl.getDBTransaction();

8. In D2K, we have control block or a block based on database view. Similarly, in OA Framework, if the field does not have viewObject attached, then its like a control field. Hence in HelloWorld example, field HelloName is a control field [in D2K terminology]. A viewObject can either be based on a view/table.synonym or on a SQL statement.

Page 11: iExpenses OAF Customizations Document

9. I wish to access the fields in multi record block that is based on view Object. Can I do this in Controller?Sure you can. To traverse through those records, do the below  a. Get the reference to the View Object using (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("VO Name Here")  b. Loop through the records in View Objects using count returned from oaviewobject.getFetchedRowCount()  c. For each record, fetch the value of the fields within the loop as                 oracle.jbo.Row row = oaviewobject.getRowAtRangeIndex (loop index here);                (String) row.getAttribute ("Column name of VO here ");

OA Framework Entity Objects -Thinking from D2k mindset

So what exactly is OA Framework Entity Object similar to in our D2K model?

There is nothing in d2k that fully corresponds to Entity Objects. But there are certain areas where analogy can be drawn (well to an extent).

WHEN-VALIDATE-ITEM in D2K setItemAttribute() in Entity ObjectIdeally does not set a item value, simply it validates

Sets the value of field that corresponds to the column. But we can also add field level validations in this method.

Can fire immediately after navigating out of the field(assuming it was changed)

Unless we implement PPR (Partial Page Rendering) around that field, this will fire at page level by default.

Restricted trigger, but can indirectly influence navigation by setting enable off, or by setting navigation property of other items.

No relationship to User Interface, as controller manages the User Interface.

Page 12: iExpenses OAF Customizations Document

OA Framework Extension Tip: - If you wish to implement additional validation for an existing OA Framework screen, then you will extend the method setItemAttribute of Entity Object.

WHEN-CREATE-RECORD in D2K

create() in Entity Object

As soon as a new record is created, values can be defaulted to fields via this trigger.

Defaults values for the fieldssuper.create(attributelist);SetPOHeaderId (getOADBTransaction ().getSequenceValue("XXPO_HEADER_ID_S"));

OA Framework Extension Tip: - If you wish to default values to a field in existing OA Framework screen, then you will override extend the method create () of Entity Object.

WHEN-VALIDATE-RECORD in D2K

validateEntity() in Entity Object

Used to cross validating values in multiple fields for a record. This trigger fires as soon as you navigate out of a record [if any of its fields have been changed].

Ditto in OA Framework. For example if you wish to ensure that every CLERK must have a supervisorId attached, then write similar to belowprotected void validateEntity(){super.validateEntity();if(xxGetSupervisrId() == null &&!"CLERK".equals(xxGetHRPosition())) throw new OAAttrValException...}

OA Framework Extension Tip :- If you wish to cross validate fields in a standard OA Framework screen, then you will extend validateEntity().

PRE-COMMIT in D2K postChanges() in Entity ObjectFires before Form issues a commit This isn't exactly similar to the listed D2K

counterpart, but comes close to it. Here you can assign values to Entity Attribute at the very last moment, prior to changes are posted.public void postChanges(TransactionEvent transactionevent){Number docSeqNum = calculateDocSeqNum();populateAttribute(1, docSeqNum);super.postChanges(transactionevent);}

Page 13: iExpenses OAF Customizations Document

Let’s touch base on some other similarities & dis-similarities between D2K and Entity Objects in Framework Buffering of records

In D2K Oracle Forms, a multi record block buffers the record data for each record. Oracle form provides no handle to that data. The only way you can access value of a field in other record is by navigating to that record [alternately maintain a record set]. However, in case of Entity Objects, you can iterate through the rows in the Entity cache.You can get a handle to iterator using which you can programmatically scroll through the records in that buffer. Framework maintains a cache for records being inserted/modified into EO via VO.

Post Process

If the entity object that you are extending already extends OAPlsqlEntityImpl, then you can do custom operations before or after Oracle screen makes API calls. Your customization will fire before or after depending upon when you call super.insertRow ().

I hope above article gives you an idea for moving from D2K Forms towards Entity Objects in OA Framework.

JDeveloper Setup Using Windows:

1. PREREQUISITES:

Hardware and software requirements:

Operating Systems: Windows NT or Windows 2000 or Windows XP. Preferred Web Browser: Internet Explorer 5.0 or later CPU Type and Speed: Pentium IV 1 GHz or greater Memory: 512 MB RAM Display: 65536 colors, set to at least 1024 X 768 resolution Disk Space: 570 MB

2. Download the OA Patch (4045639) from the metalink.

3. Unzip the accompanying zip file to a directory of your choice on your Client machine, which creates the following directory structure Under your <jdev_install_dir>: jdevbin\ jdevdoc\ jdevhome\

4. Creating a Desktop Shortcut to JDeveloper

Page 14: iExpenses OAF Customizations Document

To facilitate launching JDeveloper, create a desktop shortcut to jdevbin\jdev\bin\jdevw.exe.

5. Configuring the JDEV_USER_HOME Environment Variable

Configure the JDEV_USER_HOME environment variable using Windows XP or Windows 2000:

Go to your desktop and select My Computer, right-click and select Properties. On the System Properties dialog, select the advanced tab. On the Advanced page, select the Environment Variables... button. On the Environment Variables dialog, select the New... button from the User variables for <username> box. On the New User Variable dialog, enter JDEV_USER_HOME in the Variable Name field. Set the Variable Value field to <drive>:\jdevhome\jdev where <drive> is the drive where you installed the JDeveloper9i OA Extension zip file. For example: c:\jdevhome\jdev. Select OK in each of the dialogs you opened to save the new user environment variable.

Warning: The variable value should not contain a leading space before the drive name. If it does, your environment will not work properly.

6. Obtaining a Database Connection File

Obtain the Database Connection File (.dbc) from the FND_TOP directory and place this file in < jdev_install_dir > \jdevhome\jdev\myhtml\OA_HTML\secure

Creating the OA Project:

Click on Workspace Select New OA Workspace

Page 15: iExpenses OAF Customizations Document

Workspace NameCheck the Add

New OA Project

Page 16: iExpenses OAF Customizations Document

After you click OK, you will see the Oracle Applications Project Wizard.

Page 17: iExpenses OAF Customizations Document
Page 18: iExpenses OAF Customizations Document

Click on Finish

Set System Profile ValuesTo Analyzing the Page Objects we need to enable the profile options.

Like About this Page link to get lots of information Diagnostics mode must be enabled Get page name and location Version numbers BC4J object names

Sign on to Oracle Applications as the System Administrator responsibility.

System Profile Option Description Required dDefault Value

FND: Diagnostics This profile enables about this page link at the end of the page.

YES None

Personalize Self-Service Defn

On enabling this profile option, every OAFramework page will contain a global Personalize button. This profile enables personalization link and enables

YES None

Page 19: iExpenses OAF Customizations Document

user to personalize page.

Disable Self-service Personal

This is a system profile option specifically created for use by Oracle Support.

NO None

After changing the system profile options we need to bounce the apache server for changes to get effected.

iExpenses Objects:

1. Adding the additional field (Description) on General Information Page:

As per the iExpenses standard functionality during expense report entry when employee selects the expense report template in the expense template field the LOV shows only the expense report template name. It does not show the description for the same. Also there is no other field where the expense report template description gets displayed based on the expense report template selected.

Design Considerations

1. OA Framework guidelines suggest to Extend BC4J objects to extend business logic so that changes are upgrade safe. Solution design considers extending only BC4J objects where ever possible.

2. iExpenses pages are created with “Allow Indexed children” property set to false and hence new items can’t be added using personalization. This necessitates copying the standard page and creating a custom page so that changes are not overridden by upgrades.

3. Fields on iExpenses pages are added programmatically using Controller. This necessitates extending Controller and incorporating item creation inside extended controller to achieve requirement.

4. Extended controller makes a call to super class method thus business logic changes made by upgrades will not be lost. This makes changes upgrade safe.

5. Standard pages are copied to and custom page is created wherever necessary and extended controller is added to the custom pages.

Page 20: iExpenses OAF Customizations Document

1.1 Before Customization

We need to add the additional field (Description) here

1.2 After Customization

New field (Description) is added

1.3 How to achieve this Functionality using OAF Customization:

Overview

Page 21: iExpenses OAF Customizations Document

For the above requirement we need to customize the GeneralInformationPG & Controller attached to the page.

How to get the page from UNIX server:

All the pages are stored in MDS Directory under appltop directory.Pages should be downloading or upload in ASCII Mode.Copy the GeneralInformationPG.xml into your local machine while copying the mode should be ASCII mode. For your ease we suggest to download complete folders.

1.4 Program Logic:

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create new Custom View Object XXAPExpenseTemplatesVO in custom BC4J

Page 22: iExpenses OAF Customizations Document

Package (xxsai.oracle.apps.ap.oie.server) by Extending the existing ExpenseTemplatesVO.

Make the Substitution with the newly created XXAPExpenseTemplatesVO.

Create a new custom Page XXAPGeneralInformationPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page GeneralInformationPG.xml.

Create a new message Styled Text Item on the region OIEGeneralInformation of the page XXAPGeneralInformationPG for adding the Expense Report Template Description.

Set new Controller Object XXAPHeaderCO for OIEGeneralInformation region of XXAPGeneralInformationPG by extending the existing Controller Object HeaderCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

Add a new item “Expense Report Template Description” programmatically in Stack layout Bean by using the controller XXAPHeaderCO.

Create a new Region XXAPEntryTrainRN.xml style as train on the package xxsai.oracle.apps.ap.oie.webui.

Copy the contents of existing EntryTrainRN.xml into XXAPEntryTrainRN.xml.

The BC4J framework updates the project's .jpx file (each project .jpr has a corresponding .jpx file of the same name). The .jpx is an XML document that includes a "Substitutes" section.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

For above example I have placed the .jpx file into C:\ directory in my local Machine.

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Page 23: iExpenses OAF Customizations Document

Bounce the apache server.

Disable the profile options related to Personalization.

1.5 Train

The train region is used to indicate the current page of a multi-page process.

Page 24: iExpenses OAF Customizations Document

All the pages in the train should be copied to custom pages for proper navigation between pages and the Destination URL links of the pages in the train should be replaced with the custom path if we are customizing any single page in the train.we are customizing GeneralinformationPG for adding Description field. The following pages should be customized:

GeneralInformationPG CreditCardTrxnsPG CreditCardLinesPG CashAndOtherLinesPG ExpenseAllocationsPG FinalReviewPG

How to extend the Page:

Right click on project (iExpenses.jpr)Select the Web Tier OA Components PageClick on Ok button.

Page 25: iExpenses OAF Customizations Document

Enter the Page Name Give the package name where the page willStored

Copy the contents of GeneralInformationPG (oracle.apps.ap.oie.header.webui) and Paste into our custom page XXAPGeneralInformationPG (xxsai.oracle.apps.ap.oie.webui).Similarly copy rest of the pages in the train.

Note: All pages in the train should to be copied to custom pages if single page is copied to custom page.

Page 26: iExpenses OAF Customizations Document

As per the requirement we have to add the additional field on OIEGeneralInformation region under GeneralInformationPG page.

Add indexed child property is false

This requirement can be achieved by customizing the standard Controllers (CO) and extending the Corresponding View Object (VO). How to identify the CO’s and VO’s of the XXAPGeneralInformationPG is discussed below:

1.6 How to identify the Controller’s and View Object’s behind that page:

Every page contains one Option like “About this Page”, click on this option to view controllers, entity objects, view objects & Application Module associated to the current page

Steps for Enable the “About this Page” link

Enable the FND: Diagnostics profile option from the System Administrator Responsibility. Bounce the Apache server. Check the “About this page” link is enabled or not. Click on about this page link to view page information

Page 27: iExpenses OAF Customizations Document

Click on About this page link

After referring the about this page of GeneralInformationPG it is identified that customization should be done on the following CO and VO.

a. HeaderCO

Page 28: iExpenses OAF Customizations Document

b. ExpenseTemplateVO

1.7 Steps to extend the VO

Open the VO from Jdeveloper.

Copy the query

Page 29: iExpenses OAF Customizations Document

SELECT ApExpenseReportsEO.EXPENSE_REPORT_ID, ApExpenseReportsEO.REPORT_TYPE,

FROM AP_EXPENSE_REPORTS ApExpenseReportsEO

WHERE WEB_ENABLED_FLAG = 'Y'

AND trunc (sysdate) <= trunc (nvl (inactive_date, sysdate))

Page 30: iExpenses OAF Customizations Document
Page 31: iExpenses OAF Customizations Document
Page 32: iExpenses OAF Customizations Document
Page 33: iExpenses OAF Customizations Document

Paste the Query at Query Statement

SELECT ApExpenseReportsEO.EXPENSE_REPORT_ID, ApExpenseReportsEO.REPORT_TYPE,ApExpenseReportsEO.DESCRITPTION

FROM AP_EXPENSE_REPORTS ApExpenseReportsEO

WHERE

Page 34: iExpenses OAF Customizations Document

WEB_ENABLED_FLAG = 'Y'AND trunc (sysdate) <= trunc (nvl (inactive_date, sysdate))

Added the additional description column in the query

Note: For extensions of VO’s we have to add the columns at the end of the query.

Create a new message Styled Text Item on the region OIEGeneralInformation of the page XXAPGeneralInformationPG for adding the Expense Report Template Description.

Page 35: iExpenses OAF Customizations Document

1.8 Steps to substitute the VO

Select the Standard VO from the Available list and Extended VO from the Substitute list.

Page 36: iExpenses OAF Customizations Document

Click on Add button.

Steps to Create New Item on OIEGeneralInformation Region:

Page 37: iExpenses OAF Customizations Document

1.9 Steps to Create Custom CO:

1. Select OIEGeneralInformation region under XXAPGenerationInformationPG.xml.

Page 38: iExpenses OAF Customizations Document

2. Set New Controller for OIEGeneralInformation

Right Click on OIEGeneralInformation

Page 39: iExpenses OAF Customizations Document

Enter Package Name and Class name.Note: Controller class must be in the webui folder.For example xxsai.oracle.apps.ap.oie.webui.

Now new Controller is created for OIEGenerationInformation.

Page 40: iExpenses OAF Customizations Document

1.10 Program Logic in XXAPHeaderCO

If (uiNode instance of OAStackLayoutBean) { OAStackLayoutBean stackLayout = (OAStackLayoutBean) uiNode; OATableLayoutBean tabLayOut = (OATableLayoutBean) stackLayout.getIndexedChild (0); OARowLayoutBean rowLayOut = (OARowLayoutBean) tabLayOut.getIndexedChild (0); OACellFormatBean cellFormBean = (OACellFormatBean) rowLayOut.getIndexedChild (0); OATableLayoutBean tableBean1 = (OATableLayoutBean) cellFormBean.getIndexedChild (0);

OAMessageStyledTextBean descBean = (OAMessageStyledTextBean) createWebBean (pageContext, webBean, "ExpTempDescription");

String eventType = pageContext.getParameter ("event"); ViewObject viewobject1 = pageContext.getApplicationModule (webBean).findViewObject ("XXAPExpenseTemplatesVO");

If (viewobject1! = null) { String query = viewobject1.getQuery (); }

ExpenseReportHeadersVOImpl expenseReportHeadersVO = (ExpenseReportHeadersVOImpl) pageContext.getApplicationModule (webBean).findViewObject ("ExpenseReportHeadersVO");

Page 41: iExpenses OAF Customizations Document

If (expenseReportHeadersVO! = null) {

ExpenseReportHeadersVORowImpl expenseReportHeadersVORow = (ExpenseReportHeadersVORowImpl) expenseReportHeadersVO.first ();

Number expensReportId = expenseReportHeadersVORow.getExpenseReportId (); If (viewobject1! = null && expensReportId! = null) { viewobject1.executeQuery (); Do { If ((row = viewobject1.next ()) == null) { Break; }

Number expenseTemplateReportId = (Number) row.getAttribute ("ExpenseReportId");

If (expenseTemplateReportId.equals (expensReportId)) { descBean.setText (expenseTemplateReportDes); } } while (true);

1.11 Setup

Installation Steps

The following modules comprise the implementation set for the Adding the Expense Report Template Description Process.

Deployment Files FTP Type

Target Location

XXAPOIEMAINPAGE.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPGeneralInformationPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPEntryPageIndexRN.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPEntryTrainRN.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCreditCardTrxnsPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCreditCardLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPItemizationDetailsPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPExpenseAllocationsPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPExpenseAllocationDetailPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPExpenseDetailsPG.xml ASCII /xxsai/oracle/apps/ap/oie/webui

Page 42: iExpenses OAF Customizations Document

Deployment Files FTP Type

Target Location

XXAPConfirmationPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPReadOnlyDetailsPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPFinalReviewPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPHeaderCO.class BIN /xxsai/oracle/apps/ap/oie/webuiXXAPExpenseTemplatesVO.xml ASCII /xxsai/oracle/apps/ap/oie/serverXXAPExpenseTemplatesVOImpl.class BIN /xxsai/oracle/apps/ap/oie/server

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and “.XML” files should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Import the custom pages into the data base

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPOIEMAINPAGE.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPGeneralInformationPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPEntryPageIndexRN.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\

Page 43: iExpenses OAF Customizations Document

webui\ XXAPEntryTrainRN.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardTrxnsPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCashAndOtherLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPItemizationDetailsPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPExpenseAllocationsPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))

Page 44: iExpenses OAF Customizations Document

(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPExpenseAllocationDetailPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPExpenseDetailsPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPConfirmationPG.xml-rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPReadOnlyDetailsPG.xml-rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPFinalReviewPG.xml-rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

Page 45: iExpenses OAF Customizations Document

Run the delivered jpx file using the below command by placing it in your local machine(For example in the below command JPX file is placed in C:\ drive)

5. Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

6. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

7. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

8. Bounce the apache server.

2. Project and Task Numbers are Mandatory

For project-related expense report the project number and task numbers have to be mandatory at Header and line level by the selected business purpose.

Basic Business Needs

While creating expense reports business has to mandatory enter the Project Number and Task Number at Header and line level for specific pre-defined purposes. Thus the Expense Report header and lines webpage should be customized in such a way that when the user selects the specific purpose, the Project Number and Task number DFF at header level and Project/Task Number fields at line level should be made mandatory.

Process flow

Employee enters an expense report and enters the project number and task number at the header level.

Page 46: iExpenses OAF Customizations Document

Process Description

1. The employee enters the project related expense report for a template.

2. The Context sensitive DFF to enter the Business Purpose should be displayed at the Expense Report Header level

3. The Business Purpose DFF is a Mandatory field when the User selects the Expense Report template but the project number and task number DFFs are not mandatory fields at the header at the first instance.

4. The User has to select the Business purpose from the LoV. Depending on the Business purpose value selected the Project Number and Task Number should be mandatory at the Header and line level.

2.1 Before Customization

Once the pre-defined specific business purpose is selected by the User, the Project Number and Task Number should be made mandatory at the header and line level.

Page 47: iExpenses OAF Customizations Document

2.2 After Customization

Page 48: iExpenses OAF Customizations Document

OverviewThis Requirement the mandatory Project and Task Number for Specific Business Purposes on the General Information Page. A brief summary of the strategy appears below:

2.3 How to achieve this Functionality using OAF Customization:

To achieve the requirement customizations needs to be done for below objects1. HeaderCO, CreditCardLinesCO, CashAndOtherCO, and

CashAndOtherListCO 2. PurposeLookupVO3. CreditCardLinesPG and CashAndOtherLinesPG

Note: Identification of the CO’s, VO’s and Page and Creation of CO, VO and PG was already discussed in the previous requirement. (Refer 1.7, 1.9)

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create the ER Template Lookup values for identifying the mandatory or optional values of Business Purpose.

Page 49: iExpenses OAF Customizations Document

Create new Custom View Object XXAPPurposeLookupVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) with View Object Class ViewImpl.

Create a new custom Page XXAPCreditCardLinesPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page CreditCardLinesPG.xml.

Set new Controller Object XXAPCreditCardLinesCO for OIECreditCardExpenses of XXAPCreditCardLinesPG.xml by extending the existing Controller Object CreditCardLinesCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

Create a new custom Page XXAPCashAndOtherLinesPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page CashAndOtherLinesPG.xml.

Set new Controller Object XXAPCashAndOtherCO for OIECashAndOther region of XXAPCashAndOtherLinesPG by extending the existing Controller Object CashAndOtherCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

The BC4J framework updates the project's .jpx file (each project .jpr has a corresponding .jpx file of the same name). The .jpx is an XML document that includes a "Substitutes" section.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER))(CONNECT_DATA=(SID=<SID_NAME>)))"

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Bounce the apache server.

Disable the profile options related to Personalization.

OA Framework Objects

Create Custom VO (XXAPPurposeLookupVO)

Page 50: iExpenses OAF Customizations Document

Process Field

Value Notes

Name XXAPPurposeLookupVOPackage xxsai.oracle.apps.ap.oie.server

Query for the XXAPPurposeLookupVO is

SELECT FLT.LOOKUP_TYPE,

FLV.MEANING,FLT.MEANING LOOKUP,FLV.DESCRIPTION,

APR.EXPENSE_REPORT_IDFROM

FND_LOOKUP_VALUES FLV,FND_LOOKUP_TYPES_TL FLT,AP_EXPENSE_REPORTS_ALL APR

WHEREFLV.LOOKUP_TYPE=FLT.LOOKUP_TYPE

AND LT.MEANING=APR.REPORT_TYPEAND LT.LANGUAGE='US'AND FLV.LANGUAGE='US'

Lookup Definitions:

To avoid hardcode values in the code lookups are defined for purposes with Description optional & Mandatory. These lookups are used to validate whether project number and task number is mandatory for a specific business purpose.

Following are the lookup definitions for the Project and Task Number Mandatory requirement

LookupsType RELOCATION_ER_TEMPLATEMeaning Relocation ER TemplateApplication East Oracle Internet ExpensesDescription Relocation ER Template

Values Code Meaning DescriptionRELOCATION-HOME PURCHASE

Relocation-Home Purchase Optional

RELOCATION-HOME SALE Relocation-Home Sale OptionalRELOCATION-HOUSEHOLD Relocation-Household Moving Expenses OptionalRELOCATION-HOUSEHUNTING

Relocation-Househunting Optional

Page 51: iExpenses OAF Customizations Document

RELOCATION-IN-TRANSIT Relocation-In-Transit (Final Trip) OptionalRELOCATION-INTERIM LIVING

Relocation-Interim Living Optional

RELOCATION-RENTAL/LEASE

Relocation-Rental/Lease Expenses Optional

RELOCATION-SETTLING-IN/MISC

Relocation-Settling-in/Misc Expenses Optional

LookupsType SEOIE_REGULAR-_ER_TEMPLATEMeaning Regular ER TemplateApplication East Oracle Internet ExpensesDescription Regular ER Template

Values Code Meaning DescriptionCUSTOMER VISITS Customer Visits OptionalDEALER VISITS Dealer Visits OptionalEMPLOYEE RECOGNITION Employee Recognition OptionalEVENTS Events MandatoryFIELD CALLS Field Calls OptionalINTERVIEW EXPENSES Interview Expenses OptionalMEDIA RELATIONS Media Relations OptionalMEETING Meeting OptionalNATIONALSALES CONFERENCE

National Sales Conference Mandatory

OFFICE EXPENSES Office Expenses OptionalOPEN HOUSE Open House MandatoryOTHER Other Optional

Page 52: iExpenses OAF Customizations Document

OTHER CONVENTIONS Other Conventions MandatoryOUTLETPHYSICAL INVENTORY

Outlet Physical Inventory Optional

OUTLET VISITATION Outlet Visitation OptionalPUBLIC RELATIONS Public Relations OptionalRECRUITING Recruiting OptionalSALES CALLS Sales Calls OptionalTECHNICAL SUPPORT Technical Support OptionalTELEPHONE - HOME OFFICE Telephone - Home Office OptionalTELEPHONE - MOBILE Telephone - Mobile OptionalTRADE SHOW Trade Show MandatoryTRAINING Training OptionalVARIOUS Various Optional

Page 53: iExpenses OAF Customizations Document

2.5 Program logic in XXAPHeaderCO

Page 54: iExpenses OAF Customizations Document

The same logic has to be incorporated in the following CO’s for this requirement: XXAPCashAndOtherCOXXAPCreditCardLinesCOXXAPCashAndOtherListCO

Logic for This Customization is:

//Create Object for ExpenseReportHeadersVORowImpl using WebExpensesAMImpl String purpose = headerRow.getAttribute1 (); String projectNumber = headerRow.getAttribute2 (); String taskNumber = headerRow.getAttribute3 (); Number expensReportId = headerRow.getExpenseReportId (); If (xxapPurposeLookupVo == null) {//Get the XXAPPurposeLookupVO object If (xxapPurposeLookupVo == null) { XxapPurposeLookupVo = (XXAPPurposeLookupVOImpl) am1.createViewObject ("XXAPPurposeLookupVO", "xxsai.oracle.apps.ap.oie.server.XXAPPurposeLookupVO") ;}} If (purpose! = null && xxapPurposeLookupVo! = null) {

xxapPurposeLookupVo.setWhereClause ("MEANING='" + purpose + "'" +” AND EXPENSE_REPORT_ID=" + expensReportId);

String query = xxapPurposeLookupVo.getQuery (); xxapPurposeLookupVo.executeQuery (); Row xxapPurposeLookupVORow = null; If ((xxapPurposeLookupVORow = xxapPurposeLookupVo.next()) != null){ String description = (String) xxapPurposeLookupVORow.getAttribute("Description"); if("Mandatory".equalsIgnoreCase(description)){ If (projectNumber == null || projectNumber! = null && projectNumber.equals ("") { throw new OAException (message, (byte) 0); } If (taskNumber == null || taskNumber! = null && taskNumber.equals ("")) { String message = "Task Number is required for the purpose” + purpose; Throw new OAException (message, (byte) 0);

}} }

2.6 Setup

Installation Steps

The following modules comprise the implementation set for the Project and Task Number are mandatory for Specific Business Purposes Process.

Page 55: iExpenses OAF Customizations Document

Deployment Files FTP Type

Target Location

XXAPCreditCardLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCreditCardLinesCO.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPCashAndOtherLinesPG.xml ASCII / xxsai /oracle/apps/ap/oie/webuiXXAPCashAndOtherCO.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPExpenseReportHeaderEO.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPPurposeLookupVO.xml ASCII / xxsai /oracle/apps/ap/oie/webuiXXAPPurposeLookupVOImpl.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPPurposeLookupVORowImpl.class BIN / xxsai /oracle/apps/ap/oie/server

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Import the .xml file into the data base

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER))(CONNECT_DATA=(SID=<SID_NAME>)))"

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCashAndOtherLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER))(CONNECT_DATA=(SID=<SID_NAME>)))"

<JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPPurposeLookupVO.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)

Page 56: iExpenses OAF Customizations Document

(PORT=<PORT_NUMBER))(CONNECT_DATA=(SID=<SID_NAME>)))"

5. Run the delivered jpx file using the below command by placing it in your local machine(For example in the below command JPX file is placed in C:\ drive)

6. Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID NAME>)))"

7. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

8. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

9. Bounce the apache server.

3. Indirect Projects LOV

For project-related expense report the project number and task numbers have to be entered manually by the users at the expense report line level. There is a List of Values available to select the Project Number at the Expense report Line level.

Page 57: iExpenses OAF Customizations Document

Basic Business Needs

For all project related expenses the List of Values at the Expense Report line level will contain both CAPITAL and INDIRECT projects. But the requirement is customize the List of Values to list only INDIRECT Projects at the Expense Report line level.

Process flow

3.1 Before Customization

If the user wants to attach a project to the expense report then the List of Values available at the expense report line level should be only INDIRECT projects.

Employee enters an expense report using a template.

Page 58: iExpenses OAF Customizations Document

Capital Project (20985)

3.2 After Customization

Only Indirect Projects are displayed.

Overview

Page 59: iExpenses OAF Customizations Document

For project-related expense report the project number and task numbers have to be entered manually by the users at the expense report line level. There is a List of Values available to select the Project Number at the Expense report Line level.

3.2 How to achieve this Functionality using OAF Customization:

To achieve this requirement we have to identify the VO attached to the project LOV and customize it.

How to identify the VO attached to a LOV:

Click on Project Number LoV

Page 60: iExpenses OAF Customizations Document

Program Logic:

The whole process follows the following sequence.

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Page 61: iExpenses OAF Customizations Document

Create new Custom View Object XXAPProjectsLovVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) by Extending the existing ProjectsLovVO.

Make the Substitution with the newly created XXAPProjectsLovVO.

The BC4J framework updates the project's .jpx file (each project .jpr has a corresponding .jpx file of the same name). The .jpx is an XML document that includes a "Substitutes" section.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the delivered jpx file using the below command by placing it in your local machine (For example in the below command JPX file is placed in C:\ drive)

Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and“FND: PersonalizationRegionLinkEnabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Bounce the apache server.

Disable the profile options related to Personalization.

3.3 Steps to extend the VO

Open the Standard VO from Jdeveloper.

Page 62: iExpenses OAF Customizations Document

Copy the query

SELECT P.PROJECT_NUMBER PROJECT_NUMBER, P.PROJECT_NAME PROJECT_NAME,P.PROJECT_ID PROJECT_ID, P.START_DATE START_DATE, P.COMPLETION_DATE COMPLETION_DATE, O.NAME PROJECT_ORGANIZATION_NAME

FROM PA_PROJECTS_EXPEND_V P, HR_ORGANIZATION_UNITS O

WHERE P.CARRYING_OUT_ORGANIZATION_ID = O.ORGANIZATION_ID

Page 63: iExpenses OAF Customizations Document
Page 64: iExpenses OAF Customizations Document
Page 65: iExpenses OAF Customizations Document

Paste the Query at Query Statement

SELECT P.PROJECT_NUMBER PROJECT_NUMBER,P.PROJECT_NAME PROJECT_NAME,

Page 66: iExpenses OAF Customizations Document

P.PROJECT_ID PROJECT_ID,P.START_DATE START_DATE,P.COMPLETION_DATE COMPLETION_DATE,O.NAME PROJECT_ORGANIZATION_NAME

FROM PA_PROJECTS_EXPEND_V P, HR_ORGANIZATION_UNITS OWHERE

P.CARRYING_OUT_ORGANIZATION_ID = O.ORGANIZATION_IDAND P.PROJECT_TYPE_CLASS_CODE='INDIRECT'

As per the requirement the LOV should display only INDIRECT Projects

Page 67: iExpenses OAF Customizations Document

For the substitution of VO (Refer 1.8)

OA Framework Objects

1. Extended VO (XXAPProjectsLovVO)

Process Field Value Notes

Name XXAPProjectsLovVOPackage xxsai.oracle.apps.ap.oie.serverExtends View Object

ProjectsLovVO

2. Substitution: Right-click on the project, select ‘Edit Business Components Project’ and select ‘Substitutions’ section. Select base object and extended object and then choose ‘ADD’ to create new Substitution rule.

Process Field Value Notes

Available ProjectsLovVOSubstitution XXAPProjectsLovVO

Page 68: iExpenses OAF Customizations Document

3.4 Setup

Installation steps

The following modules comprise the implementation set for the Adding the Expense Report Template Description Process.

Deployment Files FTP Type

Target Location

XXAPProjectsLovVO.xml ASCII /xxsai/oracle/apps/ap/oie/serverXXAPProjectsLovVOImpl.class BIN /xxsai/oracle/apps/ap/oie/webui

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

5. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

6. Bounce the apache server.

4. Defaulting Project and Task Number at Report Line Level

Page 69: iExpenses OAF Customizations Document

For project-related expense report the project number and task numbers have to be entered manually by the users at the expense report line level.

Basic Business Needs

For some expense reports where the Project Number and Task Number are entered by the users at the Expense Report header level, the project number and task number should be defaulted to the respective fields at the expense report line level. The user should be able to enter the Project Number and Task Number at the Expense Report Header level. This can be achieved by enabling Header level DFFs to enter the Project Number and Task Number. Thus the Expense Report Header level page should be customized in such a way that when the user clicks the next button to enter the expense report lines the project number and task number fields in the expense report lines page should be populated with values entered by the user in the previous page. This is applicable to both the Credit Card Expense page and Cash Expenses Page. The user should be able to override the values defaulted from the previous page.

Process flow

Employee enters an expense report and enters the project number and task number at the header level.

When the user enters the next page to enter the expense report lines the project number and task number in the expense report lines page should be populated with the values entered in the previous page.

Page 70: iExpenses OAF Customizations Document

4.1 Before Customization

Page 71: iExpenses OAF Customizations Document

4.2 After Customization

Page 72: iExpenses OAF Customizations Document

Project and Task Numbers are defaulted from the Header Information

Task Number should be Mandatory for the Business Purpose Events at Header level.

4.3 How to achieve this Functionality using OAF Customization:

Project and Task Number should be defaulted at the Expense Report line level while entering Project related Expense report. A brief summary of the strategy appears below:

Page 73: iExpenses OAF Customizations Document

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Set new Controller Object XXAPCreditCardLinesCO for OIECreditCardExpenses of XXAPCreditCardLinesPG.xml by extending the existing Controller Object CreditCardLinesCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

Create a new custom Page XXAPCashAndOtherLinesPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page CashAndOtherLinesPG.xml.

Set new Controller Object XXAPCashAndOtherCO for OIECashAndOther region of XXAPCashAndOtherLinesPG by extending the existing Controller Object CashAndOtherCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

The BC4J framework updates the project's .jpx file (each project .jpr has a corresponding .jpx file of the same name). The .jpx is an XML document that includes a "Substitutes" section.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Bounce the apache server.

Disable the profile options related to Personalization.

Partial Page Rendering (PPR):

Partial page rendering allows portions of a page to be refreshed without redrawing the entire page contents.

Creation of PPR:

Page 74: iExpenses OAF Customizations Document

1. Select Page in System – Navigator.

1. Select Date (Here we are creating PPR on date only) field in Structure panel and give the Event in Property panel.

Date in Structure panel Event for Date

4.4 Logic to implement in XXAPCashAndOtherCO

Page 75: iExpenses OAF Customizations Document

The same logic should be incorporated in XXAPCashAndOtherListCO

Public void processRequest (OAPageContext pageContext, OAWebBean webBean) { String eventType = pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM); DefaultForReceipt (pageContext, 0); //method which contains the logic of the defaulting the Receipt data DefaultForPerDiem (pageContext, 0); //this method contains the PerDiem defaulting logic DefaultForMileage (pageContext, 0); // this method contains the Mileage defaulting logic super.processRequest (pageContext, webBean); }

Public void processFormRequest (OAPageContext pageContext, OAWebBean webBean) { String eventType = pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM); If (eventType! =null && eventType.equals ("goto")) { int i = Integer.parseInt (pageContext.getParameter("value")); int j = NavigationUtility.getCurrentPageIndex (pageContext); if(j<i) { ValidateProjectTask (pageContext); } } if("OIE_DATE_CHANGE_RECEIPT".equals(eventType))//here the condition is based on the Event type, because the logic should be perform when the PPR was invoked. { defaultForReceipt(pageContext,1); } if("OIE_DATE_CHANGE_PERDIEM".equals(eventType)) { defaultForPerDiem(pageContext,1); } if("OIE_DATE_CHANGE_MILE".equals(eventType)) { defaultForMileage(pageContext,1); } super.processFormRequest(pageContext, webBean); } public void defaultForReceipt(OAPageContext pageContext,int calledFrom) { WebExpensesAMImpl am1= (WebExpensesAMImpl)pageContext.getRootApplicationModule();

Page 76: iExpenses OAF Customizations Document

ExpenseReportLinesVOImpl receiptBasedLinesVOImpl =(ExpenseReportLinesVOImpl)am1.getCashAndOtherLinesVO(); int i = receiptBasedLinesVOImpl.getRowCount(); String taskNumber = null; String projectNumber = null; if(i>0) { try { if (am1 instanceof ExpensesAMImpl) { ExpensesAMImpl expenseAM = (ExpensesAMImpl)am1; ExpenseReportHeadersVOImpl headerVO = (ExpenseReportHeadersVOImpl)expenseAM.getExpenseReportHeadersVO(); ExpenseReportHeadersVORowImpl headerRow = (ExpenseReportHeadersVORowImpl)headerVO.first(); projectNumber = headerRow.getAttribute2();// here we are getting ProjectNumber from Header taskNumber = headerRow.getAttribute3(); String purpose = headerRow.getAttribute1(); } if(projectNumber !=null && taskNumber !=null) { for(RowSetIterator rowsetiterator = OIEUtil.getNoValIterator(receiptBasedLinesVOImpl); rowsetiterator.hasNext();) { ExpenseReportLinesVORowImpl receiptBasedLinesVORowImpl = (ExpenseReportLinesVORowImpl)rowsetiterator.next(); Date date = receiptBasedLinesVORowImpl.getStartExpenseDate(); String existProjectNumber = receiptBasedLinesVORowImpl.getProjectNumber(); String existTaskNumber = receiptBasedLinesVORowImpl.getTaskNumber(); if(calledFrom==1){ if (date != null && existProjectNumber== null && existTaskNumber == null) { receiptBasedLinesVORowImpl.setProjectNumber(projectNumber);// here we are setting the projectNumber to receiptBasedLinesVO receiptBasedLinesVORowImpl.setTaskNumber(taskNumber);// and same way to TaskNumber } }else { if(date != null) { receiptBasedLinesVORowImpl.setProjectNumber(projectNumber); receiptBasedLinesVORowImpl.setTaskNumber(taskNumber); }

Page 77: iExpenses OAF Customizations Document

} } } }catch(Exception e) { System.out.println("Exception :"+e.getMessage()); } } }The same which is applicable for remaning Methods

ie defaultForPerDiem(OAPageContext pageContext,int calledFrom) defaultForMileage(OAPageContext pageContext,int calledFrom)

4.4 Setup

Installation steps

The following modules comprise the implementation set for the Project and Task Number are defaulted from the Header Information.

Deployment Files FTP Type

Target Location

XXAPCreditCardLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherLinesCO.class BIN /xxsai/oracle/apps/ap/oie/serverXXAPCashAndOtherLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherCO.class BIN /xxsai/oracle/apps/ap/oie/server

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Import the .xml file into the data base

i. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)

Page 78: iExpenses OAF Customizations Document

(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

ii. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCashAndOtherLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

iii. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPPurposeLookupVO.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

5. Run the delivered jpx file using the below command by placing it in your local machine(For example in the below command JPX file is placed in C:\ drive)

6. Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

7. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

8. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

9. Bounce the apache server.

Page 79: iExpenses OAF Customizations Document

5. Capture Attendee Information

While entering expense reports for expense type like Meals at Meetings-3rd parties to which ‘expense type data rule’ functionality is attached, then business can capture additional information for the attendees or recipients (both for employees and non-employees).

Basic Business Needs

When any expense report is entered for expense types to which ‘expense type data rule’ is attached the system allows capturing additional information for the attendees or recipients (both employees and non-employees). For the non-employees the attendees or recipients information need to be manually populated. For employees the attendees or recipients information like name and title will come based on the value selected from the LoV for the name column.

As per the standard product functionality the title column for the employees gets its value from the position field on the HR Assignment form (PER_ALL_ASSIGNMENT_F Table). But as the business stores the employee title in the ATTRIBUTE5 column of the PER_ALL_PEOPLE_F table the requirement is to get the title value from the same.

The following Expense Types will use expense type data rule:

1. Entertainment with 3rd parties

2. Entertain/Recreation with Personnel

3. Meals at Meetings-3rd parties

4. Meals at Offsite Mtgs- Personnel

5. Meals at On-site Mtgs- Personnel

6. Recruiting Expenses

7. Meals-Employee Extended Workday

Page 80: iExpenses OAF Customizations Document

Process flow

5.1 Before Customization

Employee enters expense report for certain Expense Types

The Detail page will have fields to capture additional information for the attendees or recipients (both employees and non-employees)

Under Attendees or Recipients--> Employee Information region – When the name is selected from the LoV the title should default the value stored in ATTRIBUTE5 column of the PER_ALL PEOPLE_F table

Page 81: iExpenses OAF Customizations Document

5.2 After Customization

After the Customization Title displaying from the attribute5

5.3 How to achieve this Functionality using OAF Customization:

This customization done to capture correct title for the employees in the employee information. A brief summary of the strategy appears below:

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create new Custom View Object XXAPAllEmployeesVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) by Extending the existing AllEmployeeVO.

Make the Substitution with the newly created XXAPAllEmployeesVO.

Create a new application module XXAPAllEmployeesAM.xml.

Create a new region XXAPAllEmployeesLovRN.xml style as based on the VO XXAPAllEmployeesVO the region style as table.

Page 82: iExpenses OAF Customizations Document

Attach the XXAPAllEmployeesVO to the application module XXAPAllEmployeesAM.

Substitute this VO into the Standard VO.

The BC4J framework updates the project's .jpx file (each project .jpr has a corresponding .jpx file of the same name). The .jpx is an XML document that includes a "Substitutes" section.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Import the page in to MDS Directory import <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects\sai\oracle\apps\ap\oie\webui\ XXAPAllEmployeesLovRN.xml -rootdir <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)( HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Bounce the apache server.

Disable the profile options related to Personalization.

OA Framework Objects

1. Create Custom VO (XXAPAllEmployeeVO)

Process Field

Value Notes

Name XXAPAllEmployeeVO

Page 83: iExpenses OAF Customizations Document

Process Field

Value Notes

Package xxsai.oracle.apps.ap.oie.server

2. Substitution: Right-click on the project, select ‘Edit Business Components Project’ and select ‘Substitutions’ section. Select base object and extended object and then choose ‘ADD’ to create new Substitution rule.

Process Field Value Notes

Available AllEmployeeVOSubstitution XXAPAllEmployeeVO

Logic For this Requirement is:

1. Create custom VO XXAPAllEmployeeVO Note: Steps for Creating VO was specified in the previous Requirement (Refer 1.7,1.9) Query for the XXAPAllEmployeeVO is:

SELECT P.PERSON_ID, P.FULL_NAME, p.attribute5 Title, ORG.NAME ORG_NAME, p.employee_number AS employee_numberFROM per_people_x p, per_assignments_x a, hr_organization_units orgWHERE a.person_id = p.person_idAND a.organization_id = org.organization_idAND NOTap_web_db_hr_int_pkg.isPersonCwk(p.person_id) ='Y'.

5.4 Setup

Installation Steps

The following modules comprise the implementation set for the Project and Task Number are defaulted from the Header Information.

Page 84: iExpenses OAF Customizations Document

Deployment Files FTP Type

Target Location

XXAPAllEmployeesAM.xml ASCII /xxsai/oracle/apps/ap/oie/serverXXAPAllEmployeesAMImpl.class BIN /xxsai/oracle/apps/ap/oie/serverXXAPAllEmployeesVO.xml ASCII /xxsai/oracle/apps/ap/oie/serverXXAPAllEmployeesVOImpl.class BIN /xxsai/oracle/apps/ap/oie/serverXXAPAllEmployeesLovRN.xml BIN /xxsai/oracle/apps/ap/oie/webui

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Import the .xml file into the data base

i. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPAllEmployeesLovRN.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

5. Run the delivered jpx file using the below command by placing it in your local machine (For example in the below command JPX file is placed in C:\ drive)

6. Run the jpx import utility to import substitutions specified in the .jpx definition file to the MDS repository using<JDEV_INSALL_DIR>\jdevbin\jdev\bin>jpximport C:\iExpenses.jpx -username apps -password apps -dbconnection "(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp)(HOST=<HOST-NAME>)(PORT=<PORT-NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

7. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

8. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

9. Bounce the apache server.

Page 85: iExpenses OAF Customizations Document

6. Business Rule Justification

The Airfare expenses requires justification if the class of travel is not COACH and is claimed by employees who are lesser than Band D1.

Basic Business Needs

When any airfare expense is claimed by an employee then iExpenses can be setup to require justification for incurring the expense irrespective of the band of the employee claiming the expense, Flight type and Airline Class of Service used. But the requirement here is that for Airfare expense claim, Justification is required if:

Page 86: iExpenses OAF Customizations Document

a. Airline Class of Service is not Coach, Flight Type is Domestic and employee is not 1st class travelers (i.e. Stan Glasgow Emp#47829 and Hideki Komiyama Emp# 23360 who always fly Ist class)

b. Airline Class of Service is not Coach, Flight Type is International and employee band is lower than D1

The Expense Report line details page should be customized in such a way that when the expense report is entered claiming the Airfare expense and above conditions are satisfied then Justification field should be become mandatory. The DFF attributes at expense report line level details will be used to capture the values for ‘Airline Class of Service’ and ‘Flight Type’ for expense type: Airfare. The employee band information will be taken from custom table: SECPI_USER_DATA.

Process Flow

Process Description

1. The employee enters the expense report through iExpense.

2. On expense report line employee selects Airfare expense and fill other details at line level

3. When User clicks on Next or Return button and if the below conditions are met, then the justification should be required:

Airline Class of Service is not Coach, Flight Type is Domestic and employee is not 1st class travelers (i.e. Stan Glasgow Emp#47829 and Hideki Komiyama Emp# 23360 who always fly Ist class)

Airline Class of Service is not Coach, Flight Type is International and employee band is lower than D1.

6.1 Before Customization

Employee enters expense report for Airfare Expense

If the air travel does not meet the above requirement then justification will be mandatory.

Page 87: iExpenses OAF Customizations Document

6.2 After Customization

Page 88: iExpenses OAF Customizations Document

Justification is required for this case.

6.3 How We Achieve this Requirement Using OAF:

The customization for making justification required for Airfare Business Rule is achieved by incorporating custom logic in the CO attached to the expense line details page. A brief summary of the strategy appears below:

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create a new Custom View Object XXAPEmpFirstClassVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) for identifying the employees who don’t require the justification.

Create a new Custom View Object XXAPEmpBandVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) for identifying the Band information.

Create a new Custom View Object XXAPBandInfoVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) for identifying the Band Details.

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Page 89: iExpenses OAF Customizations Document

Bounce the apache server.

Disable the profile options related to Personalization.

OA Framework Objects

1. Create Custom VO (XXAPEmpFirstClassVO)

Process Field

Value Notes

Name XXAPEmpFirstClassVOPackage xxsai.oracle.apps.ap.oie.server

2. Create Custom VO (XXAPEmpBandVO)

Process Field

Value Notes

Name XXAPEmpBandVOPackage xxsai.oracle.apps.ap.oie.server

3. Create Custom VO (XXAPBandInfoVO)

Process Field

Value Notes

Name XXAPBandInfoVOPackage xxsai.oracle.apps.ap.oie.server

Query for XXAPEmpFirstClassVO is:

SELECT lookup_code EmployeeNumber,ppf.person_id EmpID,description Required

FROM fnd_lookup_values flv,

Page 90: iExpenses OAF Customizations Document

per_all_people_f ppfWHERE

flv.lookup_type='SEOIE_EMPLOYEE_FIRST_CLASS'and flv.language='US'and flv.meaning in (select employee_number from per_all_people_f a where a.person_id=ppf.person_id).

Query for XXAPEmpBandVO is:

SELECT ppf.person_id BandEmployeeID, ppf.full_nameEmployeeName, sud.emp_id EmployeeNumber, sud.orig_bandBand

FROM PER_ALL_PEOPLE_F PPF, SECPI_USER_DATA SUD

WHERE sud.emp_id in (select employee_number from per_all_people_f a where

a.person_id=ppf.person_id).

Query for XXAPBandInfoVO is:

SELECT lookup_code, meaning BandInfo from fnd_lookup_values

WHERElookup_type='SEOIE_BAND_INFORMATION'and language='US'

6.4 Lookups for this Requirement

Define the Lookups for Airfare Class of Service: The lookup code definition has defined for the employees whose not required the justification.

LookupsType SEOIE_EMPLOYEE_FIRST_CLASSMeaning Airline Class of ServiceApplication East Oracle Internet ExpensesDescription Airline Class of Service

Values Code Meaning DescriptionGLASGOW,STANFORD L 55673 YHIDEKI KOMIYAMA 23360 Y

Page 91: iExpenses OAF Customizations Document

Note: For the above lookup definition the lookup code should be the Employee Name and Meaning should be the Employee Number of the employee.

The lookup code definition has defined for the bands lower than D1.

LookupsType SEOIE_BAND_INFORMATIONMeaning SEOIE_BAND_INFORMATIONApplication East Oracle Internet ExpensesDescription Airline Class of Service

Values Code MeaningBAND A ABAND B BBAND C C

Page 92: iExpenses OAF Customizations Document

6.5 Logic to Implement in XXAPDetailMainCO

//This method which contains the Justification mandatory for given conditions

public void validateJustification(OAPageContext pageContext, OAWebBean webBean){

String expenseTemplateReportType=null;

int i=0;

String context = null;

String classCode = null;

String justfication = null;

String flight_type=null;

WebExpensesAMImpl am1 = (WebExpensesAMImpl)pageContext.getRootApplicationModule();

ExpenseReportHeadersVOImpl expenseReportHeaderVO = am1.getExpenseReportHeadersVO();

ExpenseReportHeadersVORowImpl expenseReportHeaderROW = (ExpenseReportHeadersVORowImpl)expenseReportHeaderVO.first();

Page 93: iExpenses OAF Customizations Document

Number employeeID = expenseReportHeaderROW.getEmployeeId();

Number expensereportid=expenseReportHeaderROW.getExpenseReportId();

int count=0;

DetailReceiptBasedVORowImpl row=null;

try{

DetailAMImpl detailAMImpl = (DetailAMImpl)pageContext.getApplicationModule(webBean);

DetailReceiptBasedVOImpl vo = (DetailReceiptBasedVOImpl)detailAMImpl.getDetailLineVO();

row = (DetailReceiptBasedVORowImpl)vo.first();

context = row.getAttributeCategory();

classCode = row.getAttribute8();

justfication = row.getJustification();

flight_type=row.getAttribute15();}

catch(Exception e){

System.out.println("Error was occured in Detail main CO:"+e);

count++; }

if(count==0) {

if(context!=null){

if((context.equals("Airfare"))||(context.equals("Relo.Airfare"))){

if(xxapExpenseTemplateVo == null){

xxapExpenseTemplateVo = (XXAPExpenseTemplatesVOImpl)am1.findViewObject("XXAPExpenseTemplatesVO");

if(xxapExpenseTemplateVo == null){

xxapExpenseTemplateVo = (XXAPExpenseTemplatesVOImpl)am1.createViewObject("XXAPExpenseTemplatesVO", "xxssai.oracle.apps.ap.oie.server.XXAPExpenseTemplatesVO");}}

if(xxapExpenseTemplateVo!= null){

xxapExpenseTemplateVo.setWhereClause("EXPENSE_REPORT_ID=" + expensereportid);

String query = xxapExpenseTemplateVo.getQuery();

Page 94: iExpenses OAF Customizations Document

xxapExpenseTemplateVo.executeQuery();

Row xxapExpenseTemplateVoRow = null;

if((xxapExpenseTemplateVoRow = xxapExpenseTemplateVo.next()) != null){

expenseTemplateReportType = (String)xxapExpenseTemplateVoRow.getAttribute("ReportType");}}

if (("Regular ER Template".equalsIgnoreCase(expenseTemplateReportType))||("Relocation ER Template".equalsIgnoreCase(expenseTemplateReportType))){

//This VO which contains the all First Class Employee details.

if(xxapEmpFirstClassVO == null){

xxapEmpFirstClassVO = (XXAPEmpFirstClassVOImpl)am1.findViewObject("XXAPEmpFirstClassVO");

if(xxapEmpFirstClassVO == null){

xxapEmpFirstClassVO = (XXAPEmpFirstClassVOImpl)am1.createViewObject("XXAPEmpFirstClassVO", "xxsai.oracle.apps.ap.oie.server.XXAPEmpFirstClassVO");}}

if(xxapEmpFirstClassVO != null){

xxapEmpFirstClassVO.setWhereClause("EmpID='" + employeeID+ "'");

String query = xxapEmpFirstClassVO.getQuery();

xxapEmpFirstClassVO.executeQuery();

Row xxapEmpFirstClassVORow = null;

i=xxapEmpFirstClassVO.getRowCount();}

if(classCode!= null){

//Here the condition will check wheather the ClassCode is First then the Justficiation is must otherwise Throw Exception

if((classCode.equalsIgnoreCase("FIRST")) && (i==0) ){

if(justfication != null){}

else{

Page 95: iExpenses OAF Customizations Document

throw new OAException("Justfication is required for airfare class of service", (byte)0);}}

//Same way the conditions will be check for the Remaining conditions also like Classcode is Business and Class is not Coach

6.6 Setup

Installation Steps

The following modules comprise the implementation set for the Business Rule to require Justification Process.

Deployment Files FTP Type

Target Location

XXAPEmpBandVO.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPEmpFirstClassVO.xml ASCII / xxsai /oracle/apps/ap/oie/webuiXXAPEmpBandVORowImpl.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPEmpBandVOImpl.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPEmpFirstClassVORowImpl.class BIN / xxsai /oracle/apps/ap/oie/serverXXAPEmpFirstClassVOImpl.class BIN / xxsai /oracle/apps/ap/oie/server

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

i. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

5. Bounce the apache server.

Page 96: iExpenses OAF Customizations Document

7. Defaulting Additional CC details to ER Line DFF

This document describes the functionality of customization required to default additional Credit Card Transaction details to Expense Report Line DFF fields.

Standard functionality of iExpenses will not provide fields on Expense Report Screen to display some of the additional Credit Card Transaction details. To accommodate such fields on Expense Report Entry screen, line level DFF will be defined with mapping between Attribute columns and transaction fields. And customization will be done to default additional Credit Card Transaction details into respective DFF fields. Based on the Credit Card Transaction line Expense Category, the additional details will be defaulted to the corresponding ER Line DFF fields.

Example

The credit card transaction details of Expense Category ‘Airline’ like Airline Booking Agent, Departure City, Destination City etc.. will be defaulted to respective ER line DFF Attributes columns ATTRIBUTE3, ATTRIBUTE4, ATTRIBUTE10 (Which are mapped to Airline Booking Agent, Departure City, and Destination City in DFF definition)

Page 97: iExpenses OAF Customizations Document

Basic Business Needs

The additional Credit Card Transaction details should be captured on Credit Card Expense Entry Details Screen.

Process Flow

7.1 Before Customization

Enter expense report

Select credit card transaction

Enter the expense report line information

On detail page DFF fields are displayed based on the expense type used on the line. These fields will

automatically fetch the values from the credit card transaction table.

Page 98: iExpenses OAF Customizations Document

7.2 After Customization

7.3 How We Achieve this Requirement Using OAF:

This functionality of customization required to default additional Credit Card Transaction details to Expense Report Line DFF fields. A brief summary of the strategy appears below:

After analyzing the ExpenseDetailsPG, Customization is required for

1. XXAPExpenseDetailsPG

2. XXAPDetailsMainCO

3. XXAPAirClassCodeVO

Note: Creation of VO, CO and Page will be discussed in the 1st requirement.

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create a new custom Page XXAPExpenseDetailsPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page ExpenseDetailsPG.

Page 99: iExpenses OAF Customizations Document

Set new Controller Object XXAPDetailMainCO for OIEDetails region of XXAPExpenseDetailsPG by extending the existing Controller Object DetailMainCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

Create a new Custom View Object XXAPAirfareClassCodeVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) for identifying the Airfare Class Code.

The substitutions specified in the .jpx definition file will need to be deployed to the MDS repository on the database of your target 11i instance. Zip the directory structure (xxsai\oracle\apps\ap\oie\server) generated for the new extended objects and upload into the server at $OA_JAVA and unzip it.

Run the import utility to import the pages into the MDS repository import <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\XXAPCashAndOtherLinesPG.xml -rootdir <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Run the import utility to import the pages into the MDS repository import <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardLinesPG.xml -rootdir <JDEV_INSALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

Profile options “Personalize Self-service Defn” (FND_CUSTOM_OA_DEFINTION) and “FND: Personalization Region Link Enabled” (FND_PERSONALIZATION_REGION_LINK_ENABLED) should be set to ‘Yes’.

Bounce the apache server.

Disable the profile options related to Personalization.

OA Framework Objects

1. Set New Controller((XXAPDetailMainCO)Object on XXAPExpenseDetailPG Page

Process Field Value Notes

Name XXAPDetailMainCOPackage xxsai.oracle.apps.ap.oie.webui

Page 100: iExpenses OAF Customizations Document

Process Field Value Notes

Region OIEDetailsExtends Controller Object

DetailMainCO

2. Create Custom VO (XXAPAirfareClassCodesVO)

Process Field

Value Notes

Name XXAPAirfareClassCodesVOPackage xxsai.oracle.apps.ap.oie.server

Query for XXAPAirfareClassCodesVO is:

SELECTlookup_code AirfareClassCode,Description ClassType

FROMfnd_lookup_values

WHERElookup_type='SEOIE_AIRFARE_CLASS_CODES'

The Lookup code definition has defined for the Airline class of service codes

7.4 Logic to implement in XXAPDetailMainCO

//this is the method which is used to default some fileds in detail page.

public void defaultCreditInformation(OAPageContext pageContext,OAWebBean webBean)

{

WebExpensesAMImpl am1= (WebExpensesAMImpl)pageContext.getRootApplicationModule();

Page 101: iExpenses OAF Customizations Document

DetailAMImpl detailAMImpl = (DetailAMImpl)pageContext.getApplicationModule(webBean);

DetailReceiptBasedVOImpl vo = (DetailReceiptBasedVOImpl)detailAMImpl.getDetailLineVO();

DetailReceiptBasedVORowImpl row=(DetailReceiptBasedVORowImpl)vo.first();

Number transactionId=row.getCreditCardTrxId();

String context=row.getAttributeCategory();

String expenseType = row.getExpenseTypeName();

String expenseType1 = am1.getPrompt(row.getWebParameterId());

if(context==null && expenseType1 != null){

row.setAttributeCategory(expenseType1);

context = row.getAttributeCategory();}

if(xxapCCTransactionVo == null){

xxapCCTransactionVo = (XXAPCreditCardTransactionsVOImpl)am1.findViewObject("XXAPCreditCardTransactionsVO");

if(xxapCCTransactionVo == null){

xxapCCTransactionVo=(XXAPCreditCardTransactionsVOImpl)am1.createViewObject("XXAPCreditCardTransactionsVO","xxsai.oracle.apps.ap.oie.server.XXAPCreditCardTransactionsVO");}}

if(xxapCCTransactionVo != null){

xxapCCTransactionVo.setWhereClause("TRX_ID ="+transactionId);

String query=xxapCCTransactionVo.getQuery();

xxapCCTransactionVo.executeQuery();

XXAPCreditCardTransactionsVORowImpl xxapCCTransactionsVoRow=null;

if((xxapCCTransactionsVoRow = (XXAPCreditCardTransactionsVORowImpl)xxapCCTransactionVo.next())!=null)

{

Number trxId=xxapCCTransactionsVoRow.getTrxId();

if(("Airfare".equalsIgnoreCase(context))||("IHR.Airfare".equalsIgnoreCase(context))||("Relo.Airfare".equalsIgnoreCase(context)))

{

String destCity=xxapCCTransactionsVoRow.getAirarrival();

Date dirDepartDate=xxapCCTransactionsVoRow.getAirdepdate();

String bookingAgent=xxapCCTransactionsVoRow.getAirticketissue();

Page 102: iExpenses OAF Customizations Document

String departCity=xxapCCTransactionsVoRow.getAirdepcity();

String dDate=null;

String sDate=null;

try{

if(dirDepartDate !=null){

dDate=dirDepartDate.toString();

sDate=dateMethod(dDate);

row.setAttribute10(sDate); }

else{

throw new OAException("Date is Null", (byte)0);}}

catch(Exception e){

System.out.println("Date is null");}

try{

if(destCity!=null){

row.setAttribute4(destCity); }}

catch(Exception e){

System.out.println("Destination city is null");}

try{

if(bookingAgent!=null){

row.setAttribute5(bookingAgent); }}

catch(Exception e){

try{

if(departCity!=null){

row.setAttribute3(departCity);}}

catch(Exception e){

String classCode=xxapCCTransactionsVoRow.getAirserclass ();

if(classCode!=null){

try{

char c=classCode.charAt(0);

if(xxapAirfareClassCodesvo == null){

xxapAirfareClassCodesvo = (XXAPAirfareClassCodesVOImpl)am1.findViewObject("XXAPAirfareClassCodesVO");

if(xxapAirfareClassCodesvo == null){

Page 103: iExpenses OAF Customizations Document

xxapAirfareClassCodesvo=(XXAPAirfareClassCodesVOImpl)am1.createViewObject("XXAPAirfareClassCodesVO","xxsai.oracle.apps.ap.oie.server.XXAPAirfareClassCodesVO");}}

if(xxapAirfareClassCodesvo != null){

xxapAirfareClassCodesvo.setWhereClause("AirfareClassCode='"+c+"'");

String query1=xxapAirfareClassCodesvo.getQuery();

xxapAirfareClassCodesvo.executeQuery();

int count=xxapAirfareClassCodesvo.getRowCount();

if(count!=0){

XXAPAirfareClassCodesVORowImpl xxapAirfareClassCodesVoRow=null;

if((xxapAirfareClassCodesVoRow = (XXAPAirfareClassCodesVORowImpl)xxapAirfareClassCodesvo.next())!=null){

String classType=xxapAirfareClassCodesVoRow.getClasstype();

if(classType.equalsIgnoreCase("First")){

row.setAttribute8("First"); }

else

if(classType.equalsIgnoreCase("Business")){

row.setAttribute8("Business");}}}

else{

row.setAttribute8("Coach");}}}

catch(Exception e)

{

System.out.println ("Exception was raised");}}

else{

System.out.println ("class code is null");}}

The same logic is applicable for the Context “CarRental “,”Loding-Room Charges” and “Loding-Room Tax”

7.5 Setup

Installation Steps

The Lookup code definition has defined for the Airline class of service codes

Page 104: iExpenses OAF Customizations Document

Note:

If Air class of service starts with A, F or P in credit card transactions table we have to default First Class in DFF field of Expense line details for Air class of Service. 

If Air class of service starts with C, D or J in credit card transactions table we have to default Business Class in DFF field of Expense line details for Air class of Service. 

If we find any other codes in the credit card transaction table then we have to default Coach in DFF field of Expense line details for Air class of Service. 

LookupsType SEOIE_AIRFARE_CLASS_CODESMeaning Airline Class Of Service CodesApplication East Oracle Internet ExpensesDescription

Values Code Meaning DescriptionA A FirstC C BusinessD D BusinessF F FirstJ J BusinessP P First

The following modules comprise the implementation set for the Defaulting Additional CC details to ER Line DFF Process.

Page 105: iExpenses OAF Customizations Document

Deployment Files FTP Type

Target Location

XXAPCreditCardLinesPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherListPG.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherCO.class BIN /xxsai/oracle/apps/ap/oie/webuiXXAPCreditCardLinesCO.class BIN /xxsai/oracle/apps/ap/oie/webui

a. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

b. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

c. Move the above files in mentioned Target Location.

d. Import the custom pages into the data base

i. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCreditCardLinesPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>)))"

ii. <JDEV_INSTALL_DIR>\jdevbin\jdev\bin:\>import <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects\xxsai\oracle\apps\ap\oie\webui\ XXAPCashAndOtherListPG.xml -rootdir <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<HOST_NAME>)(PORT=<PORT_NUMBER>))(CONNECT_DATA=(SID=<SID_NAME>))" -mmddir <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses\JRADXML

e. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

a. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGe

Page 106: iExpenses OAF Customizations Document

neralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

f. Bounce the apache server.

8. AMEX Late Fee Transactions

The Late fee transactions charged by AMEX should not be charged as business expenses.

Basic Business Needs

The late fee transactions charged by the AMEX will be loaded against the card of the employee. The user/employee should not be able to charge this transaction as business expense. Hence the page where the employee attaches a transaction to an Expense Report should be customized in such a way that the employee should be forced to categorize the late fee expense as Personal expense. The employee should not be able to attach these transactions as business expense.

Page 107: iExpenses OAF Customizations Document

Process

8.1 Before Customization

Employee logs onto applications and creates a new Expense Report

He has late fee transactions in list of transactions that can be attached to an Expense Report

The employee should be forced to categorize the late fee transaction as personal expense. He should not be to attach the late fee transaction as business expense.

Page 108: iExpenses OAF Customizations Document

8.2 After Customization

8.3 How We Achieve this Requirement Using OAF:

The customization for making AMEX late fee transactions as personal transactions is achieved by incorporating custom logic in the CO attached to the credit card expenses page. A brief summary of the strategy appears below:

Program Logic

The whole process follows the following sequence:

Create a Custom BC4J Package (xxsai.oracle.apps.ap.oie.server).

Create a new custom Page XXAPCreditCardLinesPG.xml in package xxsai.oracle.apps.ap.oie.webui and copy the code from existing page CreditCardLinesPG.

Set new Controller Object XXAPCreditCardLinesCO for OIECreditCardExpense region of XXAPCreditCardLinesPG by extending the existing Controller Object CreditCardLinesCO. Package Name for this CO is xxsai.oracle.apps.ap.oie.webui.

Modify the Custom View Object XXAPCCTransactionVO in custom BC4J package (xxsai.oracle.apps.ap.oie.server) for identifying the AmexLateFee Transaction Types

Bounce the apache server.

Disable the profile options related to Personalization.

Page 109: iExpenses OAF Customizations Document

OA Framework Objects

1. Set New Controller(XXAPDetailMainCO) Object on XXAPExpenseDetailPG Page

Process Field Value Notes

Name XXAPCreditCardLinesCOPackage xxsai.oracle.apps.ap.oie.webuiRegion OIECreditCardExpenseExtends Controller Object

CreditCardLinesCO

2. Create Custom VO (XXAPCCTransactionVO) (Refer 1.7,1.9)

Process Field

Value Notes

Name XXAPCCTransactionVOPackage xxsai.oracle.apps.ap.oie.server

Query for XXAPCCtransactionVO is:

SELECT Trx_Id,Card_Program_Id,Transaction_Date, Transaction_Amount, Billed_Amount, Posted_Currency_Code, Billed_Currency_Code,Merchant_Name1, Merchant_City, Merchant_Province_State,Merchant_Country,Folio_Type, Category,Report_Header_Id,Company_Prepaid_Invoice_Id,Expensed_Amount,Billed_Date,Hotel_Room_Amount,Hotel_Telephone_Amount,

Page 110: iExpenses OAF Customizations Document

Hotel_Room_Tax,Hotel_Bar_Amount,Hotel_Movie_Amount,Hotel_Gift_Shop_Amount,Hotel_Laundry_Amount,Hotel_Health_Amount,Hotel_Restaurant_Amount,Hotel_Business_Amount,Hotel_Parking_Amount,Hotel_Room_Service_Amount,Hotel_Tip_Amount,Hotel_Misc_Amount,Payment_Due_From_Code,Posted_Date,Air_Ticket_Number,Trunc(Sysdate - Posted_Date) As Age,Air_Arrival_City Airarrival,Air_Departure_Date Airdepdate,Air_Ticket_Issuer Airticketissue,Air_Departure_City Airdepcity,Car_Rental_Location Carrentalloc,Car_Rental_Agreement_Number Carrentalagreenum,Car_Rental_Date Carrentaldate,Car_Return_Location Carreturnloc,Car_Return_Date Carreturndate,Car_Class Carclass,Hotel_Stay_Duration Hotelstayduration,Hotel_Room_Rate Hotelroomrate,Air_Service_Class Airserclass,mis_industry_code amexlatefeecode

FROM AP_CREDIT_CARD_TRXNS_ALL

8.4 Logic for this Customization in XXAPCCTransactionVO

public void amexTransaction(OAPageContext pageContext){//Create VO and Row Objects for ExpenseReportLinesArrayList arraylist = new ArrayList();int i = businessCreditCardLinesVO.getRowCount();int j=1;Number transactionId=null;if(i>0)

Page 111: iExpenses OAF Customizations Document

{for(RowSetIterator rowsetiterator = OIEUtil.getNoValIterator(businessCreditCardLinesVO); rowsetiterator.hasNext();){Date date = businessCreditCardLinesVORow.getStartExpenseDate();String existProjectNumber = businessCreditCardLinesVORow.getProjectNumber();String existTaskNumber = businessCreditCardLinesVORow.getTaskNumber();String context=businessCreditCardLinesVORow.getAttributeCategory();transactionId=businessCreditCardLinesVORow.getCreditCardTrxId();if(xxapCCTransactionVo == null){

//Create VO and ROW object for CreditCardTransactionsVOxxapCCTransactionVo.setWhereClause("TRX_ID ="+transactionId);String query=xxapCCTransactionVo.getQuery();xxapCCTransactionVo.executeQuery();XXAPCreditCardTransactionsVORowImpl xxapCCTransactionsVoRow=null;

if((xxapCCTransactionsVoRow = (XXAPCreditCardTransactionsVORowImpl)xxapCCTransactionVo.next())!=null)

{Number trxId=xxapCCTransactionsVoRow.getTrxId();String amexLatefeeType=xxapCCTransactionsVoRow.getAmexlatefeecode();if(amexLatefeeType!=null){if(amexLatefeeType.equalsIgnoreCase("DC")){String error = "Line "+j+" Error: ";

OAException oaException = new OAException(error+"AMEX Late Fee transactions need to be categorized as personal. Please personalize this credit card transaction",OAException.ERROR);

arraylist.add(oaException);}}else{try{throw new OAException("Amex Late fee transaction type is null ", (byte)0);}catch(Exception e){System.out.println("Exception :"+e.getMessage());}}}if(arraylist.size() > 0){OAException.raiseBundledOAException(arraylist);}

Page 112: iExpenses OAF Customizations Document

8.5 Setup

Installation Steps

The following modules comprise the implementation set for the AMEX Late Fee Transactions.

Deployment Files FTP Type

Target Location

XXAPCreditCardTranscatiosVO.xml ASCII /xxsai/oracle/apps/ap/oie/webuiXXAPCashAndOtherCO.class BIN /xxsai/oracle/apps/ap/oie/webuiXXAPCreditCardLinesCO.class BIN /xxsai/oracle/apps/ap/oie/webui

1. Install JDeveloper in your local machine and copy the final folder delivered into <JDEV_INSTALL_DIR>\jdevhome\jdev\myprojects and <JDEV_INSTALL_DIR>\jdevhome\jdev\myclasses and follow below steps. (Final folder will be delivered along with the last OA Framework object)

2. Copy the final deliverable folder into $OA_JAVA folder in UNIX machine with appropriate directory structure “. Class” files should be moved in BIN mode and other should be moved in ASCII mode.

3. Move the above files in mentioned Target Location.

4. Change the HTML call of the function OIEENTRYFLOW (OA.jsp?page=/oracle/apps/ap/oie/entry/header/webui/GeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH) with the custom path OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH)

5. Go to System Administrator Application Function Query with the function OIEENTRYFLOW Click on Web HTML Change the HTML Call with OA.jsp?page=/xxsai/oracle/apps/ap/oie/webui/XXAPGeneralInformationPG&OASF=OIE_EXPENSE_REPORT_SEARCH

6. Bounce the apache server.