Pages

Recently Viewed

Wednesday, May 20, 2015

SQL - Transaction Control Flag Validation at Project/Task Level


FUNCTION OAL_TXN_CONTROL(p_project_id NUMBER,p_task_id NUMBER, P_EXPENDITURE_TYPE VARCHAR2,P_EXPENDITURE_CATEGORY VARCHAR2,P_EXPENDITURE_ITEM_DATE DATE)
RETURN VARCHAR2
AS
    lv_txn_flag VARCHAR2(10);
    ln_count    NUMBER;
    LD_DATE DATE;
    LV_CHRGEFLAG VARCHAR2(10);
    LN_ACTIVE    NUMBER;
    lv_exp varchar2(100);
lv_txn_level VARCHAR2(10);
  BEGIN
     
   
SELECT limit_to_txn_controls_flag
      INTO lv_txn_flag
      FROM PA_TASKS A
      WHERE PROJECT_ID = P_PROJECT_ID
      AND task_id      = P_task_id ;

      IF LV_TXN_FLAG   = 'Y' THEN -- IF 100
   
        SELECT COUNT(1)
                INTO ln_count
        FROM pa_transaction_controls pc
        WHERE TASK_ID = P_task_id
        AND EXPENDITURE_TYPE = P_expenditure_type
        AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1);
       
IF LN_COUNT      <> 0 THEN -- IF type exists -- IF 110
          SELECT count(1)
        INTO
        ln_count
        FROM pa_transaction_controls pc
        WHERE TASK_ID = P_task_id
          AND EXPENDITURE_TYPE = P_EXPENDITURE_TYPE
          AND CHARGEABLE_FLAG= 'Y'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
       
       
          IF ln_count <>0 THEN  -- IF 120
            RETURN 'TRUE';
          ELSE
            RETURN 'T';
          END IF;   -- IF 120

        ELSE -- not exists 110
          SELECT COUNT(1)
          INTO ln_count
          FROM pa_transaction_controls pc
          WHERE TASK_ID = P_task_id
              AND EXPENDITURE_CATEGORY = P_EXPENDITURE_CATEGORY
          AND CHARGEABLE_FLAG= 'Y'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
         
 IF LN_COUNT <> 0 THEN -- IF 120
             RETURN 'TRUE';
          ELSE
             RETURN 'T';
          END IF; -- 120
        END IF; -- 110
      ELSE
-- check if any record exists in control table else call PA level vaidation
SELECT COUNT(1)
                INTO ln_count        
        FROM pa_transaction_controls pc
        WHERE TASK_ID = P_task_id;

IF ln_count <> 0 THEN
        SELECT COUNT(1)
                INTO ln_count
         
        FROM pa_transaction_controls pc
        WHERE TASK_ID = P_task_id
        AND EXPENDITURE_TYPE = P_expenditure_type
        AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;

        IF LN_COUNT      <> 0 THEN -- IF type exists -- 210
          SELECT count(1)
        INTO
        ln_count
        FROM pa_transaction_controls pc
        WHERE TASK_ID = P_task_id
          AND EXPENDITURE_TYPE = P_EXPENDITURE_TYPE
          AND CHARGEABLE_FLAG= 'N'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
       
       
          IF ln_count <> 0 THEN  -- 220
            RETURN 'T';
          ELSE
            RETURN 'TRUE';
          END IF;  -- 220
   
ELSE -- not exists
          SELECT COUNT(1)
          INTO ln_count
          FROM pa_transaction_controls pc
          WHERE TASK_ID = P_task_id
          AND EXPENDITURE_CATEGORY = P_EXPENDITURE_CATEGORY
          AND CHARGEABLE_FLAG= 'N'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
         
          IF ln_count <> 0 THEN  -- 220
            RETURN 'T';
          ELSE
            RETURN 'TRUE';
          END IF;  -- 220

        END IF; --210
ELSE -- Project Level Validations
SELECT limit_to_txn_controls_flag
 INTO lv_txn_flag
 FROM PA_PROJECTS_ALL A
 WHERE PROJECT_ID = P_PROJECT_ID;
 IF LV_TXN_FLAG   = 'Y' THEN
   
        SELECT COUNT(1)
                INTO ln_count
         
        FROM pa_transaction_controls pc
        WHERE project_id = P_project_id
AND task_id is NULL
        AND EXPENDITURE_TYPE = P_expenditure_type
        AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1);
       
IF LN_COUNT      <> 0 THEN -- IF type exists
          SELECT count(1)
        INTO
        ln_count
        FROM pa_transaction_controls pc
        WHERE project_id = P_project_id
AND task_id is NULL
          AND EXPENDITURE_TYPE = P_EXPENDITURE_TYPE
          AND CHARGEABLE_FLAG= 'Y'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
       
       
          IF ln_count <>0 THEN
            RETURN 'TRUE';
          ELSE
            RETURN 'P';
          END IF;

        ELSE -- not exists
          SELECT COUNT(1)
          INTO ln_count
          FROM pa_transaction_controls pc
          WHERE project_id = P_project_id
AND task_id is NULL
              AND EXPENDITURE_CATEGORY = P_EXPENDITURE_CATEGORY
          AND CHARGEABLE_FLAG= 'Y'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
         

          IF ln_count <>0 THEN
            RETURN 'TRUE';
          ELSE
            RETURN 'P';
          END IF;

        END IF;

      ELSE
   
        SELECT COUNT(1)
                INTO ln_count
         
        FROM pa_transaction_controls pc
       WHERE project_id = P_project_id
AND task_id is NULL
        AND EXPENDITURE_TYPE = P_expenditure_type
        AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1);
       
IF LN_COUNT      <> 0 THEN -- IF type exists
          SELECT count(1)
        INTO
        ln_count
        FROM pa_transaction_controls pc
        WHERE project_id = P_project_id
AND task_id is NULL
          AND EXPENDITURE_TYPE = P_EXPENDITURE_TYPE
          AND CHARGEABLE_FLAG= 'N'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
       
       
          IF ln_count <>0 THEN
            RETURN 'P';
          ELSE
            RETURN 'TRUE';
          END IF;

        ELSE -- not exists
          SELECT COUNT(1)
          INTO ln_count
          FROM pa_transaction_controls pc
          WHERE project_id = P_project_id
AND task_id is NULL
          AND EXPENDITURE_CATEGORY = P_EXPENDITURE_CATEGORY
          AND CHARGEABLE_FLAG= 'N'
          AND P_expenditure_item_date BETWEEN pc.start_date_active AND NVL(pc.end_date_active,SYSDATE+1) ;
         
 IF ln_count <>0 THEN
            RETURN 'P';
          ELSE
            RETURN 'TRUE';
          END IF;

        END IF;
    END IF;
END IF;
END IF;  

END ;


Return Values - 

  • TRUE - No Failure
  • P - Failed at Project Level transaction control 
  • T - Failed at Task Level transaction control 


Wednesday, April 22, 2015

SQL - Concurrent Program Executable Details

SELECT
  application_name,
  user_concurrent_program_name,
  meaning Program_Type,
  output_file_type output_format,
  --  concurrent_program_id,
  --  cp.application_id,--ce.*,
  executable_name,
  execution_file_name
FROM
  FND_CONCURRENT_PROGRAMS_VL cp ,
  FND_EXECUTABLES_FORM_V ce ,
  fnd_lookup_values flv
WHERE
  cp.executable_id           = ce.executable_id
AND ce.execution_method_code = lookup_code
AND lookup_type              = 'CP_EXECUTION_METHOD_CODE'
AND user_concurrent_program_name LIKE '%Program Name%'
 ;

Friday, February 27, 2015

The XML page cannot be displayed


Error –  Program completed in error and output shows below





Resolution -  Please check your data definition XML file (data template). Some issue with XML tags.
Correct data template and check again!!


Saturday, January 17, 2015

VO Extension without JDeveloper

VO Extension is tool (JDeveloper) dependent but can be done manually by using below steps.

Steps to extend VO:
Create new VO  xxxxx_StandardVO.xml by renaming the standard VO StandardVO.xml (from server).
Edit below sections of VO according your customization need.

<ViewObject>
Name = New VO Name
Extends = original VO Name with complete path
ComponentClass = NewVO associate file with complete path


<SQLQuery>
Update the SQL with new changes.


<ViewAttribute> - Not required If change is in where condition or existing SQL logic
If adding a new sql field,we need to add ViewAttributes for new field.

Example -
<ViewObject
   Name=" xxxxx_StandardVO "
   Extends="oracle.apps.application.subapplication.common.server. StandardVO"
   BindingStyle="OracleName"
   CustomQuery="true"
   ComponentClass="xxxxx.oracle.apps.application.subapplication.common.server.xxxxx_StandardVOImpl"
   UseGlueCode="false">

<ViewAttribute
      Name="NEWFIELD"
      IsUpdateable="false"
      IsPersistent="false"
      Precision="30"
      Type="java.lang.String"
      ColumnType="VARCHAR2"
      AliasName=" NEWFIELD "
      Expression=" NEWFIELD "
      SQLType="VARCHAR" >
      <DesignTime>
         <Attr Name="_OverrideAttr" Value="true" />
         <Attr Name="_DisplaySize" Value="30" />
      </DesignTime>
   </ViewAttribute>

Create associated java file xxxxx_StandardVOImpl.java
package xxxxx.oracle.apps.application.subapplication.common.server;
import oracle.apps.application.subapplication.common.server. StandardVOImpl;
public class xxxxx_StandardVOImpl extends StandardVOImpl {
    public xxxxx_StandardVOImpl() {
    }  }

Compile and generate class file (xxxxx_StandardVOImpl.class
Create a OAProject.jpx file
<?xml version='1.0' encoding='windows-1252' ?>
<!DOCTYPE JboProject SYSTEM "jbo_03_01.dtd">
<JboProject
   Name="OAProject"
   SeparateXMLFiles="true"
   PackageName="" >
   <DesignTime>
      <Attr Name="_ejbPackage" Value="false" />
      <Attr Name="_NamedConnection" Value="DBConnection1" />
      <Attr Name="_version" Value="10.1.3.41.57" />
      <Attr Name="_jprName" Value="OAProject.jpr" />
   </DesignTime>
   <Containee
      Name="server"
      FullName="oracle.apps.application.subapplication.common.server"
      ObjectType="JboPackage" >
   </Containee>
   <Containee
      Name="server"
      FullName="xxxxx.oracle.apps.application.subapplication.common.server"
      ObjectType="JboPackage" >
   </Containee>
   <Substitutes>
      <Substitute OldName ="oracle.apps.application.subapplication.common.server.StandardVO" NewName ="xxxxx.oracle.apps.application.subapplication.common.server.xxxxx_StandardVO" />
   </Substitutes>
</JboProject>

Create server.xml file
<?xml version='1.0' encoding='windows-1252' ?>
<!DOCTYPE JboPackage SYSTEM "jbo_03_01.dtd">

<JboPackage
   Name="server"
   SeparateXMLFiles="true"
   PackageName="xxxxx.oracle.apps.application.subapplication.common.server" >
   <DesignTime>
      <Attr Name="_ejbPackage" Value="false" />
      <Attr Name="_version" Value="10.1.3.41.57" />
   </DesignTime>
   <Containee
      Name="xxxxx_StandardVO"
      FullName="xxxxx.oracle.apps.application.subapplication.common.server.xxxxx_StandardVO"
      ObjectType="ViewObject" >
   </Containee>
</JboPackage>

Place all files at respective locations and run JPX Importer  

Friday, January 2, 2015

Print parametr in XML report without having XML tags

Oracle provides option to print input parameter directly in RTF without generating a XML tag for this. This can be done in below 2 steps,

Define the parameter reference: this can be done in two different ways
<?param@begin:P_PARAM?>
<xsl:param name="P_PARAM" xdofo:ctx="begin"/>
Print the report parameter value:
<?$P_PARAM?>


Example
CP Parameter Name
START_TIME
END_TIME

Invoke parameters on rtf
<?param@begin:START_TIME?>
<?param@begin:END_TIME?>

Create 2 form field (Placeholder) in RTF  with below values
<?$START_TIME?>
<?$END_TIME?>


Sunday, October 26, 2014

iStore Customization and Migration

Istore codes are mainly JSP changes. Below is the steps need to follow to customize and migrate the iStore changes.
 
Find the file from $OA_HTML
cp $OA_HTML/ ibeCScdDirectEntry.jsp /home/Sandeep
rename the file with “xx”  (xxibeCScdDirectEntry.jsp)
 
Copy the file to $OA_HTML
cp /home/sandeep/xxibeCScdDirectEntry.jsp $OA_HTML/
 
Navigate to FND_TOP and compile the JSP in that environment
cd $FND_TOP/patch/115/bin/
perl ojspCompile.pl --compile -s xxibeCScdDirectEntry.jsp
 
Bounce Apache
$ADMIN_SCRIPTS_HOME/adoacorectl.sh stopall
$ADMIN_SCRIPTS_HOME/adoacorectl.sh startall
               
 

 

 

: XML-20112: (Fatal Error) Error opening external DTD 'jbo_03_01.dtd'

Error while importing custom VO.
 
Above error occurs while trying importing xml files. Developer will face this while extending VO.
 
OA extension, requires following files at respective folder structure under JAVA_TOP
1        CustomVO   (xxABCVO.xml)
2          Custom VOImpl file (xxABCVOImpl.class)
3          server.xml
4        OAProject.jpx
 
To extend VO, only jpx file needs to be uploaded using jpximporter command
 
Trying to import other 2 xml files (server and custom VO), will throw above error as these were not right file for xml importer.
 
Please ignore the error if jpx importer is successful. Your VO will be extended.



  
 

Wednesday, October 1, 2014

How to define and call java methods in JSP Pages ( iSTORE)

Customizing JSP pages are similar to OAF changes.
 
If customizing the JSP page, writing validations and logic in Java and refering the method in JSP page, is easier option.
 
How to define and call a Java code in JSP page -
 
Create a java file and place at server ( $JAVA_TOP/xxxxx/oracle/apps/<product>/<catagory>)
Ex – created java file names xxxxxItem.class and placed at location $JAVA_TOP/xxxx/oracle/apps/ibe/catalog
 
 
Similar to import a java class in OAF, each jsp have this section at top. This is the referenced java files.
Included the custom file reference.
 
Invoke defined method inside the code –
 
 
We can extend the logic in java file for any new validations and place the new version at referred location.
Bounce the apache and changes will reflect.

 

 

Sunday, August 10, 2014

Project workbench TAB on Self Service Page

 
Project workbench TAB available on HOME Page
 
 
Menu Name - Project Workbench Tab Structure
 
Exclusion Request -  
To exclude any Tab, create a custom Menu and exclude. Add custom menu on required responsibilities.
 
Inclusion Request -
To include these tab on any responsibility. Include all below menu and functions.
 
Prompt                                 Menu                                    Function

 

 

Tuesday, July 8, 2014

Warning !!! Due to high volume of data, got out of memory exception - XML Memory Error

 
Issue – Memory  Exception while generating XML publisher report
 
 
Resolution 1 -  Give the below shown option in CP definition –
 
 
 
 
Resolution 2 - Set the scalable option in data template (XML Publisher >> Data Definition >> Data Template. Xml )
<properties>
   <property name="scalable_mode" value="on" />
</properties>


 

 

 

Java.io.FileNotFoundException - Bursting Error

 
Bursting Error –
 
Set Bursting parameters..
Temp. Directory:/ora/integration_xxx/ebs/xxx
[070814_031305645][][STATEMENT] Oracle XML Parser version ::: Oracle XML Developers Kit 10.1.3.130 - Production
[070814_031305647][][STATEMENT] setOAProperties called..
Bursting propertes.....
{user-variable:cp:territory=AU, user-variable:cp:ReportRequestID=1000101, user-variable:cp:language=en, user-variable:cp:responsibility=2000, user-variable.OA_MEDIA=http://oracle.xxxx.local:2010/OA_MEDIA, burstng-source=EBS, user-variable:cp:DebugFlag=Y, user-variable:cp:parent_request_id=1000101, user-variable:cp:locale=en-AU, user-variable:cp:user=SANDEEP, user-variable:cp:application_short_name=XDO, user-variable:cp:request_id=1000101, user-variable:cp:org_id=30, user-variable:cp:reportdescription=Bursting Error Report, user-variable:cp:Dummy for Data Security=N}
Start bursting process..
Bursting process complete..
Generating Bursting Status Report..
--Exception
/ora/integration_xxx/ebs/xxx/070814_031305694/XXXXREPORTNAME.xls (No such file or directory)
java.io.FileNotFoundException: /ora/integration_xxx/ebs/xxx/070814_031305694/XXXXREPORTNAME.xls (No such file or directory)
                    at java.io.FileInputStream.open(Native Method)
                    at java.io.FileInputStream.<init>(FileInputStream.java:106)
                    at java.io.FileInputStream.<init>(FileInputStream.java:66)
                    at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.zipOutputFiles(JCP4XDOBurstingEngine.java:523)
                    at oracle.apps.xdo.oa.cp.JCP4XDOBurstingEngine.runProgram(JCP4XDOBurstingEngine.java:292)
                    at oracle.apps.fnd.cp.request.Run.main(Run.java:157)
 
Resolution -
Check the uploaded template properties. Either use correct territory or leave this field as blank (this is not mandatory)
Keeping territory blank is advisable.
 
In case its already created and delete icon is disabled. Use below query to delete the template file from backend.
 
 

 

 

Monday, June 30, 2014

How to add LOV field on OAF page without OAF customizations

Adding LOV field on OAF page, requires creation of many OAF objects. Those not having much exposure on OAF can use below to achieve same –
 
This is simple and easily maintainable as LOV data will be fully controlled by your value set used.

How to add custom flexfield on OAF page

This is similar to adding any new fields on OAF page and will be achieved using OAF personalization.
 
Go to OAF page >> Personalize Page >> Create Item >>
 
Item Style = Flex
Id – DFF   (Any unique Value)
Appl Short Name – ICX ( Oracle iProcurement)
Name – TESTDFF  (DFF Name) Click Here to create custom DFF
View Instance –  OneTimeLocationDisplayVO  (Associated VO of the page)
This will show the DFF available on the screen. Re order as per requirement.
 
Associated VO Details ( About This Page)
 
Note – Add Flex item on page layout region.

 
 

Thursday, June 26, 2014

How to create custom DFF

Mostly we use standard DFF by adding more context and segment combination.  This will be very useful when we don’t have standard DFF enable and need to store some additional details.
 
Oracle provides option to create custom DFF –
 
Login to EBS >>Application Developer (R) >> Flexfield >>Descriptive >> Register
Application – Oracle IProcurement
Title – Sandeep
Table Application – Oracle IProcurement
Structure Column – Attribute15 (This should be attribute category. Taken attribute15 as no category was available on selected table)
 
Name – TESTDFF
Description –
Table Name – POR_ITEM_ATTRIBUTE_VALUES
Context Prompt – TestSandeep
DFF View Name – SANDEEP_DFV (Name should be ending with _DFV)
 
 
Sandeep DFF on table POR_ITEM_ATTRIBUTE_VALUES has been created successfully.
 
 
Flexfield >>Descriptive >> Segment >> select segment and create attribute as standard DFF
 
 
Now we can use this DFF at any page. In case any LOV is required define the segment and add the value set with attribute.

 

 

Saturday, June 21, 2014

Submit concurrent Program from standard Oracle Form using Form personalization

To launch a concurrent program directly from core forms ( without going to SRS window), we can use oracle form –
 
>Create a custom PL/SQL package.
>>Call the concurrent program
>>>Add accustom menu using form personalization – Click here
>>>>Create a new form personalization
Event – SPECIAL[n]
Action –Built In 
                Execute a procedure
                                                     
 
>>>>>How to execute procedure using form personalization – Click here
 

 

 

How to show message dynamically in Oracle Forms

Using form personalization we can show custom message on defined actions.
To show the different message content based on the form data, we can use form personalization.
Create a PL/SQL function
>> Return different message based on predefined rules (conditions)
Function –
xxx_pkg.getmessage(param1 VARCHAR2) return VARCHAR2
IS
BEGIN
If param1 = 1 THEN return ‘Sandeep’ end if;
If param1 =2 THEN return ‘OAL’ END IF;
EXCEPTION
Return ‘Exception in custom program’
END ;
>>> Create a form personalization to display message

= select xxx_pkg.getmessage(Paramaer) from dual
 
 
 

Inventory organization Check using Form Personalization

This is for Inventory related core forms. Oracle inventory pops us change organization form to pick an organization before launching any form.
Based on the selection only forms are appearing and are applicable only for selected organization.
 
Change organization set the organization value in
Block – PARAMETER
Field – ORG_CODE
 
Using form personalization, we can check if we are in expected organization or not.
 
While opening the form below message will pop up -
 
Org check condition will not work for WHEN-NEW-FORM-INSTANCE trigger.
We should use this at WHEN-NEW-BLOCK-INSTANCE.

 

 

Create custom Menu in forms

As OAF provides adding new items and flexibility to change the code on any button press, Oracle form is not flexible enough to accommodate such requirement.
But instead of extending the action logic of existing forms, oracle form offers to disable the existing button (removed option to perform standard action) and execute custom logic from menu.
 
For any to- do action from core forms, using form personalization we can add custom menus (Menu >> Tools>>) and instruct any action as per requirement.
 
Steps to add new menu –
Form >> Menu >> Help >> Diagnostics >>Custom Code >> Personalize>> Create a new personalization at form/function level
 
Event – WHEN NEW FORM INSTANCE
Action – Menu >> Select Special options from LOV (SPECIAL1) >> Give user defined name >> Save and Exit
 
 
Go To form >> Menu >> Tools >> This will show you new menu
 
We can add any action for custom menu –
Create a new personalization
 
Event – SPECIAL1
Action – Message
                 “This is custom menu helpful to execute custom actions”           
 
 
 
 
  

 

 

Procedure Call using Form Personalization

How to Launch a procedure using form personalization ?
 
Form >> Menu >> Help >> Diagnostics >>Custom Code >> Personalize
 
Create a personalization
Event–        Any trigger
Action –               Built in >> Execute procedure >>
 
 
Syntex –
 
='begin
xxxxx_pkg.call_program('''||${item.<BLOCK_NAME>.<FILED_NAME>.value}||''', '''||${item.<BLOCK_NAME>.<FILED_NAME>.value}||''',1,’Test’);
end'
 
 
Description –
Procedure declaration
XXXX_PKG.call_program(pramaetr1 VARCHAR2,
   parameter2 VARCHAR2,
  parameter3 NUMBER,
  parameter4 VARCHAR2);
 
Parameter1 & 2 , value will be passed form form field.
Parameter3, constant value 1 is being passed.
Parameter4, constant value ‘Test’ is being passed.
                                 
 

Saturday, February 15, 2014

LOV in WebADI - Component

Interface property can be used to set the value set. This will provide list option in excel sheet and will have limitation on values.
Usages of component will provide standard EBS LOV option. Steps are as below -
 
 
1)      Desktop Integration Manager (R) >> Manage Component >> Create Component
Provide display name, internal name and application.
Component Type:
LOV-Table -  
Ø  SQL details will be provided into interface column properties
Ø  Component name should be provided in interface column properties
 
LOV-JAVA (Please click here)

Complete component details and apply.
Table_column-alias – Interface column name
Table_column – Value set column name (Meaning)
Table-select-column - Interface column name
 
 
Go to interface >> properties window and provide the component created.