Wednesday, September 30, 2015

FND-CP-ESP: Child: exec:: No such file or directory


This error occurred when we executed shell script using Concurrent Program.

Solution

Execute the below command in Unix Environment.

dos2unix filename.prog


SQL Loader: Field in data file exceeds maximum length


Field in data file exceeds maximum length

The default length of datatype CHAR is 255 in SQLLDR.

Instead of the following
-----------------
COL1 CHAR,
COL2 CHAR,
-----------------

Please change into
-----------------
COL1 CHAR(1000) NULLIF COL1=BLANKS,
COL2 CHAR(4000) NULLIF COL2=BLANKS,
-----------------


Friday, January 9, 2015

Update, Insert & Delete Records in OAF

Pre-Requisite

Do complete the following exercises


Step 1: Create Delete Icon for Delete Action

Select SearchPG.xml
Right click on SearchTable -> New -> Item


Update the Properties
Attribute
Property
ID
Delete
Item Style
image
Atribute Set
/oracle/apps/fnd/attributesets/Buttons/Delete
Prompt
Update
Image URI
deleteicon_enabled.gif
Additional Text
Delete record
Height
24
Width
24
Action Type
fireAction
Event
delete
Submit
TRUE
Parameters
Name
Value
PPersonType
${oa.SearchVO.PersonType}
PPersonName
${oa.SearchVO.PersonName}
PEmailAddresss
${oa.SearchVO.EmailAddresss}
PContactNumber
${oa.SearchVO.ContactNumber}
  

Step 2: Add the below code in SearchAMImpl.java
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.jbo.domain.Number;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.RowSetIterator;

public void deleteRecord()
{
OAViewObject vo = getSearchVO();
SearchVORowImpl row = null;

int fetchedRowCount = vo.getFetchedRowCount();

RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
if (fetchedRowCount > 0)
{  deleteIter.setRangeStart(0); 
 deleteIter.setRangeSize(fetchedRowCount);
 for (int i = 0; i < fetchedRowCount; i++)
{
  row = (SearchVORowImpl)deleteIter.getRowAtRangeIndex(i);
  row.remove();
  getTransaction().commit();
  break;
}
}
deleteIter.closeRowSetIterator();
}

Step 3: Add the below code in SearchCO.java
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.layout.OAQueryBean;
import com.sun.java.util.collections.HashMap;
import oracle.apps.fnd.framework.webui.OADialogPage;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OARow;
import oracle.apps.fnd.framework.OAApplicationModule;

Add the below code in processFormRequest

super.processFormRequest(pageContext, webBean);

OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject vo =(OAViewObject)am.findViewObject("SearchVO");

String rowRef =
pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);

OARow row = (OARow)am.findRowByRef(rowRef);
if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
{
OAException message = new OAException("Are you sure you want to delete this row?",OAException.WARNING); 
pageContext.putDialogMessage(message);

OADialogPage dialogPage = new OADialogPage(OAException.WARNING, message, null, "", "");

String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);

dialogPage.setOkButtonItemName("DeleteYesButton");

dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);

dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);

pageContext.redirectToDialogPage(dialogPage);
}
else if (pageContext.getParameter("DeleteYesButton") != null)
{
am.invokeMethod("deleteRecord", null);
OAException confirmation = new OAException("Record deleted Successfully", OAException.CONFIRMATION);
pageContext.putDialogMessage(confirmation);
}

Step 4: Save all your work and Run the SearchPG.xml


Step 5: Delete a Record


Congratulations, you have done it!


Thursday, January 8, 2015

Update & Insert Records in OAF

Pre-Requisite

Step 1: Custom Properties for AM
Right click on SearchAM -> Edit SearchAM -> Custom Properties

Name      RETENTION_LEVEL
Value      MANAGE_STATE


Click add -> Apply -> OK


Step 2: Create a Region & Button for Create Action
Select SearchPG.xml
Right Click on PageLayoutRN -> New -> Region

Update the Properties

ID                            CreateRecordRN

Region Style          pageButtonBar


Right Click on CreateRecordRN -> New -> Item

Update the Properties

ID                            Create
Region Style          submitButton

Attribute Set         /oracle/apps/fnd/attributesets/Buttons/Create


Step 3: Create a New Page for Insert Action
Name      InsertPG

Package oracle.apps.fnd.searchproj.webui


Step 4: Create a New Regions and Input Text Items
ID                            PageLayoutRN
Region Style          pageLayout

AM Deifnition       oracle.apps.fnd.searchproj.SearchAM


ID                            MainRN

Region Style          messageComponentLayout


Right click on MainRN -> New -> messageTextInput

Update the Properties
ID
PersonType
Item Style
messageTextInput
Maximum Length
100
View Instance
SearchVO
View Attribute
PersonType
Prompt
PersonType
Length
20

ID
PersonName
Item Style
messageTextInput
Maximum Length
200
View Instance
SearchVO
View Attribute
PersonName
Prompt
PersonName
Length
20

ID
EmailAddresss
Item Style
messageTextInput
Maximum Length
100
View Instance
SearchVO
View Attribute
EmailAddresss
Prompt
EmailAddresss
Length
20

ID
ContactNumber
Item Style
messageTextInput
Maximum Length
100
View Instance
SearchVO
View Attribute
ContactNumber
Prompt
ContactNumber
Length
20


Step 5: Create a New Region and Insert Action Buttons
Right click on PageLayoutRN -> New -> Region

Update the Properties
ID                            InsertPageButtonsRN

Region Style          pageButtonBar


Create Apply and Cancel Buttons for Insert Record Page

Right click on InsertPageButtonsRN -> New -> Item

Update the Properties
ID
Apply
Region Style
submitButton
Attribute Set
/oracle/apps/fnd/attributesets/Buttons/Apply


ID
Cancel
Region Style
submitButton
Attribute Set
/oracle/apps/fnd/attributesets/Buttons/Cancel


Step 6: Create a New Controller for Insert Page

Right click on PageLayoutRN -> Set New Controller

Package Name      oracle.apps.fnd.searchproj.webui

Class Name            InsertCO


Step 7: Add the below code in SearchAMImpl.java
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OAViewObjectImpl;
import oracle.jbo.Row;
import oracle.apps.fnd.framework.OAViewObject;

public void createRecord()
{
OAViewObject vo = (OAViewObject)getSearchVO();

if (!vo.isPreparedForExecution())
{
    vo.executeQuery();
}

Row row = vo.createRow();
vo.insertRow(row);
row.setNewRowState(Row.STATUS_INITIALIZED);
}

Step 8: Add the below code in SearchCO.java
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.jbo.domain.Number;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import java.io.Serializable;
import oracle.apps.fnd.framework.OAApplicationModule;

Replace the processRequest Code

public void processRequest(OAPageContext pageContext,OAWebBean webBean)
{
super.processRequest(pageContext, webBean); 

if (!pageContext.isFormSubmission())
{
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("createRecord", null);
}



Replace the processFormRequest Code

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
// Pressing the "Apply" button means the transaction should be
// validated and committed.
        
if (pageContext.getParameter("Apply") != null)
{  /*
OAViewObject vo = (OAViewObject)am.findViewObject("SearchVO");

String PersonType = (String)vo.getCurrentRow().getAttribute("PersonType");
String PersonName = (String)vo.getCurrentRow().getAttribute("PersonName");
String EmailAddresss = (String)vo.getCurrentRow().getAttribute("EmailAddresss");       
String ContactNumber = (String)vo.getCurrentRow().getAttribute("ContactNumber");       
*/
OAException message = new OAException("Record has been Inserted!", OAException.INFORMATION);
pageContext.putDialogMessage(message);                
am.invokeMethod("apply");

pageContext.forwardImmediately(
"OA.jsp?page=/oracle/apps/fnd/searchproj/webui/SearchPG",
null, OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);

}
else if (pageContext.getParameter("Cancel") != null)
{
am.invokeMethod("rollback");
pageContext.forwardImmediately("OA.jsp?page=/oracle/apps/fnd/searchproj/webui/SearchPG",
                                     null,
                                     OAWebBeanConstants.KEEP_MENU_CONTEXT,
                                     null,
                                     null,
                                     false, // retain AM
                                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}

}


 Step 9: Save all your work and Run SearchPG.xml

Step 10: Create a New Record and Verify



Congratulations, you have done it!