Thursday 25 May 2023

OAF How to invoke concurrent program with parameters on button event

package cnsi.oracle.apps.fnd.webui;

import java.util.Vector; import oracle.apps.fnd.common.VersionInfo; import oracle.apps.fnd.cp.request.ConcurrentRequest; import oracle.apps.fnd.framework.OAApplicationModule; import oracle.apps.fnd.framework.OAException; import oracle.apps.fnd.framework.server.OADBTransaction; import oracle.apps.fnd.framework.webui.OAControllerImpl; import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.beans.OAWebBean; /** * Controller for ... */ public class InvokeConcurrentProgCO extends OAControllerImpl { public static final String RCS_ID="$Header$"; public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion(RCS_ID, "%packagename%"); /** * Layout and page setup logic for a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); } /** * Procedure to handle form submissions for form elements in * a region. * @param pageContext the current OA page context * @param webBean the web bean corresponding to the region */ public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); String eventNameStr= pageContext.getParameter(EVENT_PARAM); if(eventNameStr!=null && "invoke_event".equals(eventNameStr)) { int requestID = submitCPRequest(pageContext,webBean); throw new OAException("COncurrent Request ID-->"+requestID); } } public int submitCPRequest(OAPageContext pageContext, OAWebBean webBean) { OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean); try { OADBTransaction tx = (OADBTransaction)am.getOADBTransaction(); java.sql.Connection pConncection = tx.getJdbcConnection(); ConcurrentRequest cr = new ConcurrentRequest(pConncection); String applnName = "FND"; //Application that contains the concurrent program String cpName = "QAG_INV_REPORT_NEW"; //Concurrent program name String cpDesc = "Invoking From OAF"; // concurrent Program description // Pass the Arguments using vector // Here i have added my parameter headerId to the vector and passed the vector to the concurrent program String headerIDStr ="123"; //Number invoiceIDNum = new Number(123); Vector cpArgs = new Vector(); cpArgs.addElement(headerIDStr); // cpArgs.addElement("Enum"); // cpArgs.addElement("pBatch"); // Calling the Concurrent Program int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs); tx.commit(); return requestId; } catch (Exception e) { e.printStackTrace(); throw new OAException(e.getMessage()); } } }

Thursday 13 April 2023

Oracle Bursting Program

 1)Create Data definition.

2)Create Bursting File.

3)Template

4 ) After Trigger.



                              <?xml version="1.0" encoding="utf-8"?>

<dataTemplate name="QAG_HR_ISP_SEPARATION" description = "QAG HR Separation Report - ISP" Version="1.0" defaultPackage="xxqr_uip_utility_pkg">

  <properties>

<property name="xml_tag_case"      value="UPPER"/>

<property name="debug_mode"        value="ON"/>

<property name="include_rowsettag" value="FALSE"/>

  </properties>

   <parameters>

   </parameters>

<dataQuery>

<sqlstatement name="SEPARATION_REPORT">

<![CDATA[

SELECT papf.employee_number STAFF_NUMBER ,

  INITCAP (papf.title)

  || ' '

  || papf.first_name

  || ' '

  || DECODE (TRIM (papf.middle_names), NULL, TRIM (papf.last_name), TRIM (papf.middle_names)

  || ' '

  || TRIM (papf.last_name)) STAFF_NAME ,

  TO_CHAR(qr_final_settlement_cpnt.qr_service_date( papf.person_id) ,'DD-MON-YYYY') HIRE_DATE ,

  hr_general.decode_organization(paaf.organization_id) DEPARTMENT ,

  TO_CHAR(ppos.actual_termination_date,'DD-MON-YYYY') LWD ,

  TO_CHAR(ppos.LAST_UPDATE_DATE,'DD-MON-YYYY') LAST_UPDATE_DATE ,

  FU.USER_NAME LAST_UPDATED_BY ,

  'wassem@qatarairways.com.qa' EMAIL_TO ,

  'bvijayakumaran@qatarairways.com.qa' EMAIL_CC

FROM per_all_people_f papf,

  per_all_assignments_f paaf,

  per_periods_of_service ppos,

  FND_USER FU

WHERE papf.person_id              = paaf.person_id

AND primary_flag                  = 'Y'

AND ppos.person_id                = papf.person_id

AND ppos.actual_termination_date IS NOT NULL

AND FU.USER_ID                    = PPOS.LAST_UPDATED_BY

AND (trunc(ppos.actual_termination_date) = trunc(sysdate-1)

              or (ppos.actual_termination_date is not null and trunc(ppos.LAST_UPDATE_DATE) = trunc(sysdate-1) and trunc(ppos.actual_termination_date) < trunc(sysdate-1))

             )

AND ppos.actual_termination_date IS NOT NULL

--AND TRUNC(ppos.LAST_UPDATE_DATE)  = TRUNC(sysdate-1)

AND ppos.date_start               =

  (SELECT MAX (date_start)

  FROM per_periods_of_service

  WHERE person_id = ppos.person_id

  )

AND TRUNC(sysdate) BETWEEN papf.effective_start_date AND papf.effective_end_date

AND TRUNC(sysdate) BETWEEN paaf.effective_start_date AND paaf.effective_end_date

AND employee_number NOT LIKE 'TSS%'

AND employee_number NOT IN ('99996','99997','IT001')

AND employee_number     IN

  (SELECT papf.employee_number

  FROM PER_ALL_PEOPLE_F PAPF,

    PER_ALL_ASSIGNMENTS_F PAAF ,

    PAY_ELEMENT_TYPES_F patf ,

    PAY_ELEMENT_ENTRIES_F peef

  WHERE PAPF.PERSON_ID =PAAF.PERSON_ID

  AND patf.element_name='QAG_ISP_INFO'

  AND TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE

  AND TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE

  AND PATF.ELEMENT_TYPE_ID =PEEF.ELEMENT_TYPE_ID

  AND PEEF.ASSIGNMENT_ID   =PAAF.ASSIGNMENT_ID

  AND TRUNC(sysdate) BETWEEN peef.effective_start_date AND peef.effective_end_date

 -- AND current_employee_flag='Y'

  )

 ORDER BY 1,1 

   ]]> 

</sqlstatement>

<sqlstatement name="ROOT_DATA">

<![CDATA[

     SELECT TRUNC(SYSDATE) FROM DUAL

   ]]> 

</sqlstatement>

</dataQuery>  

<dataTrigger name="afterReport" source="xxqr_uip_utility_pkg.submit_bursting()"></dataTrigger>  

 <dataStructure>

   <group name="ROOT_DATA_GROUP" dataType="varchar2" source="ROOT_DATA">

       <group name="DATA_GROUP" dataType="varchar2" source="SEPARATION_REPORT">

             <element name="STAFF_NUMBER"      dataType="varchar2" value="STAFF_NUMBER"/>

             <element name="STAFF_NAME"        dataType="varchar2" value="STAFF_NAME"/>

             <element name="HIRE_DATE"         dataType="DATE"     value="HIRE_DATE"/>

             <element name="DEPARTMENT"        dataType="varchar2" value="DEPARTMENT"/>

             <element name="LWD"               dataType="varchar2" value="LWD"/>

             <element name="LAST_UPDATED_BY"   dataType="varchar2" value="LAST_UPDATED_BY"/>

             <element name="LAST_UPDATE_DATE"  dataType="varchar2" value="LAST_UPDATE_DATE"/>

             <element name="EMAIL_TO"          dataType="varchar2" value="EMAIL_TO"/>

             <element name="EMAIL_CC"          dataType="varchar2" value="EMAIL_CC"/>

       </group>

   </group>

</dataStructure>

</dataTemplate>


2)<?xml version="1.0" encoding="UTF-8"?>

<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">

<xapi:request select="/QAG_HR_ISP_SEPARATION/ROOT_DATA_GROUP">

<xapi:delivery>

<xapi:email id="123" server="qrsmtp.gmail.com" port="25" from="erpservices@gmail.com" reply-to="erpservices@gmail.com">

<xapi:message id="123" to="bvijayakumaran@gmail.com" bcc="bvijayakumaran@gmail.com" attachment="true" content-type="excel" subject="Separation Report">

Hi,

Please find the attached Separation Report List.

</xapi:message>

</xapi:email>

</xapi:delivery>

<xapi:document output="QAG_HR_ISP_SEPARATION" output-type="excel" delivery="123">

<xapi:template type="rtf" location="xdo://QAIR.QAG_HR_ISP_SEPARATION.en.US/?getSource=true">

</xapi:template>

</xapi:document>

</xapi:request>

</xapi:requestset>


FUNCTION submit_bursting

  RETURN BOOLEAN;


FUNCTION submit_bursting

  RETURN BOOLEAN

IS

  l_req_id          NUMBER;

  p_conc_request_id NUMBER := fnd_global.conc_request_id;

BEGIN

  l_req_id   := fnd_request.submit_request ('XDO' ,'XDOBURSTREP' ,'' ,'' ,FALSE ,'Y' ,p_conc_request_id ,'N' ,CHR (0) ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' );

  IF l_req_id > 0 THEN

    RETURN TRUE;

  ELSE

    RETURN FALSE;

  END IF;

END submit_bursting;

Staff Number

Staff  Name

Department

Last Working Day

FSTAFF_NUMBER

STAFF_NAME

DEPARTMENT

LWDE



Wednesday 12 April 2023

SQL Running in OAF Page

 

1)    Create one Webui page.



package qair.oracle.apps.qaghr.selfservice.dataload.webui;

 

import java.io.Serializable;

import oracle.apps.fnd.common.VersionInfo;

import oracle.apps.fnd.framework.OAApplicationModule;

import oracle.apps.fnd.framework.OAException;

import oracle.apps.fnd.framework.webui.OAControllerImpl;

import oracle.apps.fnd.framework.webui.OAPageContext;

import oracle.apps.fnd.framework.webui.beans.OAWebBean;

 

public class QAGGenericDataLoadCO extends OAControllerImpl

{

  public static final String RCS_ID = "$Header$";

  public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header$", "%packagename%");

 

  public void processRequest(OAPageContext pageContext, OAWebBean webBean)

  {

    super.processRequest(pageContext, webBean);

  }

 

  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)

  {

    super.processFormRequest(pageContext, webBean);

    if (pageContext.getParameter("QryButton") != null) {

      OAApplicationModule am = pageContext.getApplicationModule(webBean);

      String Query = pageContext.getParameter("TxtQuery");

      Serializable[] param = { Query };

      am.invokeMethod("getquery", param);

      throw new OAException("Record saved successfully", (byte)3);

    }

  }

}

 



 

package qair.oracle.apps.qaghr.selfservice.dataload.server;

 

import java.io.PrintStream;

import java.sql.CallableStatement;

import java.sql.SQLException;

import oracle.apps.fnd.framework.OAException;

import oracle.apps.fnd.framework.OAViewObject;

import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;

import oracle.apps.fnd.framework.server.OADBTransaction;

import oracle.jbo.Row;

 

public class QAGGenericDataLoadAMImpl extends OAApplicationModuleImpl {

    /**This is the default constructor (do not remove)

     */

    public QAGGenericDataLoadAMImpl() {

    }

 

    public static void main(String[] args)

  {

    launchTester("qair.oracle.apps.qaghr.selfservice.dataload.server", "QAGGenericDataLoadAMLocal");

  }

 

  public QAGGenericDataLoadVOImpl getQAGGenericDataLoadVO1()

  {

    return (QAGGenericDataLoadVOImpl)findViewObject("QAGGenericDataLoadVO1");

  }

 

  public void createrow()

  {

    OAViewObject DataVO = getQAGGenericDataLoadVO1();

    Row row = DataVO.createRow();

    DataVO.setCurrentRow(DataVO.last());

    DataVO.next();

    DataVO.insertRow(row);

   // row.setNewRowState(-1);

  }

 

  public void getquery(String Query) {

    System.out.println("Query:" + Query);

    OADBTransaction txn = getOADBTransaction();

    CallableStatement cs = null;

    try {

      cs = txn.createCallableStatement(Query, 1);

      cs.executeUpdate(Query);

      cs.close();

      txn.commit();

    } catch (SQLException e) {

      throw new OAException("Error while executing the Query " + e.getMessage(), (byte)0);

    }

  }

}


Monday 2 August 2021

How to disable browser back button in OAF.


In First Page PR you have initialize a EO based VO for creating Row for the Transaction and  after you moved the Second page. Although your transaction is still in between and you use the Browser Back Button of the Second page to move the First Page.


One should use the Guidelines provided in the Developer's Guide for Disabling Browser Back Button Action.

Although all the Guidelines are scenario based and Correct but
By Using Java Script we can achieve this very quickly.

In this Browser Back Button Will remain visible but inactive.

Create a Rawtext Bean in your page and properties "text " put this code.

Code:

<html><head>
<script type="text/javascript">
window.history.forward();
function noBack(){window.history.forward();}
</script>
</head>
<body onload="noBack();" onpageshow="if(event.persisted)noBack();" onunload=""]
</body></html>



Thursday 15 July 2021

Oracle EBS 12.2.x Notes

 

Oracle EBS 12.2.x Notes


---------------------------------------------------------------------------------------------------
To display the current connected edition

$echo $FILE_EDITION

$ sqlplus apps/apps
SQL> select ad_zd.get_edition_type from dual;

---------------------------------------------------------------------------------------------------
Useful metalink notes:
* Developing and Deploying Customizations in Oracle E-Business Suite Release 12.2 (Doc ID 1577661.1)

* How to deploy customizations that are created in the package oracle.apps.xxprod.* rather than xxprod.oracle.apps.* or xxprod.oracle.apps.xxprod.* on EBS 12.2.X? (Doc ID 1609939.1)

---------------------------------------------------------------------------------------------------
OAF deployment steps 12.2.x:

1) Connect to middle tier
2) Source to Run file system
$. ./EBSapps.env
3) Then enter 'R'
4) Go to JAVA TOP
$cd $JAVA_TOP
5) Backup customall.jar file
6) Run adcgnjar by entering apps DB password to regenrate customall.jar file and check the time stamp
$adcgnjar
ex :adcgnjar customall.jar
7) Restart OACORE by giving weblogic admin password.
$admanagedsrvctl.sh stop oacore_server1
$admanagedsrvctl.sh start oacore_server1

OAF deployment steps used for 12.2 upgrade from 12.1.3

 OAF deployment steps used for our upgrade.


Deploying custom OAF pages for upgrade 12.2.

If you want to carry out the changes on the current run mode, then you have to carry forward steps 7,8,9,13 & 14.

If you want to deploy the changes on the patch mode and do  a cutover, you have to follow steps 1,7,8,9,13,14,16 & 17

1. adop phase=prepare
2. run adsplice for xxcust schema
3. copy the folder structure of R12.1.3 $XXCUST_TOP into R12.2.5 $XXCUST_TOP
4. run adsplice for xxcnvr schema
5. copy the folder structure of R12.1.3 $XXCNVR_TOP into R12.2.5 $XXCNVR_TOP
6. copy the folder $JAVA_TOP/xxcust from R12.1.3 into $JAVA_TOP of R12.2.5
7. Create a zip file custom.zip as follows
a. zip –r custom.zip $JAVA_TOP/xxcust
8. Run the adcgnjar utility. The utility creates the jar files and signs it appropriately or execute below statement
a. adjava oracle.apps.ad.jri.adjmx -areas $JAVA_TOP/custom.zip -outputFile $JAVA_TOP/customall.jar -jar $CONTEXT_NAME 1 CUST jarsigner
9. delete the custom.zip file
a. rm $JAVA_TOP/custom.zip
10. create a directory custom under $FND_TOP/admin/template
a. mkdir $FND_TOP/admin/template/custom
11. copy the ebsProductManifest_xml.tmp from $FND_TOP/admin/template to $FND_TOP/admin/template/custom
a. cp $FND_TOP/admin/template/ebsProductManifest_xml.tmp $FND_TOP/admin/template/custom/ebsProductManifest_xml.tmp
12. Update both the files and add customall.jar entry into the file ebsProductManifest_xml.tmp available at $FND_TOP/admin/template & $FND_TOP/admin/template/custom
a. <library>customprod.jar</library> -- this entry has to be added
13. Run Autoconfig
14. Bounce the middle tier
15. Update the $APPL_TOP_NE/ad/custom/adop_sync.drv file for synchronization with the below entries
a. cp %s_current_base%/EBSapps/comn/java/classes/customall.jar %s_other_base%/EBSapps/comn/java/classes
16. adop finalize
17. adop cutover

Wednesday 23 September 2020

OA Framework: How to Identify Required Oracle JDeveloper Patches For Oracle E-Business Release 12.x or 11i (Doc ID 416708.1)

 

Identify Oracle JDeveloper Patches

The following tables list the Oracle JDeveloper patches that are required for use with the corresponding releases of Oracle E-Business Suite.

Continuing from Step 4 of Section 1, match your OA Framework version to the Oracle JDeveloper patch(es) listed in the appropriate table below.

Note: More than one Oracle JDeveloper 10g patch may be shown as available for an Oracle E-Business Suite release. For example, Patch 24611686 and Patch 24555396 in the case of Release 12.2.6. In any such cases, you only need to apply the latest patch, as the content of these IDE patches is cumulative and newer ones therefore include the content of their predecessors.

Release 12.2

Specific Release 12.2 Version(s) Oracle JDeveloper 10g Patch(es) Certification Details and Comments Recommended Browser (Internet Explorer) Version Known Issues
  • 12.2.9
Patch 30019266 Oracle JDeveloper 10g with OA Extension ARU for R12.2.9, certified on Windows 7, Windows 8.1, Windows 10, Windows 2012 Server, and Linux. 
  • IE 11.0 or above
  • Bug 26763039 (Linux) - UNABLE TO LAUNCH ORACLE 10G JDEVELOPER IDE USING JDK 1.7/1.8
  • 12.2.8
  • 12.2.7

Patch 28163665

Oracle JDeveloper 10g with OA Extension Bundle for R12.2.7 Oracle Enterprise Command Center Framework Support, certified on Windows 7, Windows 8.1, Windows 10, Windows 2012 Server, and Linux.

(The Oracle JDeveloper patches required for Oracle E-Business Suite Release 12.2.8 are the same as those for Release 12.2.7.)
  • IE 11.0 or above
  • Bug 26763039 (Linux) - UNABLE TO LAUNCH ORACLE 10G JDEVELOPER IDE USING JDK 1.7/1.8

Patch 26550226

Oracle JDeveloper 10g with OA Extension ARU for R12.2.7, certified on Windows 7, Windows 8.1, Windows 10, Windows 2012 Server, and Linux.

(The Oracle JDeveloper patches required for Oracle E-Business Suite Release 12.2.8 are the same as those for Release 12.2.7.)
  • IE 11.0 or above
  • N/A
  • 12.2.6

Patch 24611686

Oracle JDeveloper 10g with OA Extension ARU for R12.2.6 Bundle 1, certified on Windows 7, Windows 8.1, Windows 10, Windows 2012 Server, and Linux.
  • IE 11.0 or above
  • N/A

Patch 24555396

Oracle JDeveloper 10g with OA Extension ARU for R12.2.6, certified on Windows 7, Windows 8.1, Windows 10, Windows 2012 Server, and Linux.
  • IE 11.0 or above
  • Bug 24707646 (Linux) - ISSUES IN LAUNCHING FWK PAGES IN TOOLBOX WORKSPACE
  • 12.2.5

Patch 22064122

Oracle JDeveloper 10g with OA Extension ARU for R12.2.5 Consolidated Bundle 1, certfied on Windows 7, Windows XP/SP2, and Linux.
  • IE 9.0 or above
  • N/A
Patch 21662342 Oracle JDeveloper 10g with OA Extension ARU for R12.2.5 certfied on Windows 7, Windows XP/SP2, and Linux.
  • IE 9.0 or above
  • N/A
  • 12.2.4

Patch 19170592

Oracle JDeveloper 10g with OA Extension ARU for R12.2.4, certfied on Windows 7, Windows XP/SP2, and Linux.
  • IE 8.0 or above
  • N/A
  • 12.2.3

Patch 17888411

Oracle JDeveloper 10g with OA Extension ARU for R12.2.3, certfied on Windows 7, Windows XP/SP2, and Linux.
  • Skyros Look-and-Feel:
    • IE 8.0
  • Swan Look-and-Feel:
    • IE 6.0 or above
  • N/A
  • 12.2

Patch 17513160

Oracle JDeveloper 10g with OA Extension ARU for R12.2, certfied on Windows 7, Windows XP/SP2, and Linux.
  • IE 6.0 or above
  • N/A

Release 12.1

Specific Release 12.1 Version Oracle JDeveloper 10g Patch
12.1 (Controlled Release - only included for completeness) Patch 7315332 JDeveloper 10g with OA Extension ARU for R12.1 (Controlled Release)
12.1.1 (Rapid Install, or Patch 7303030) Patch 8431482 JDeveloper 10g with OA Extension ARU for R12.1.1
12.1.2 (Patch 7303033 or 7651091) Patch 9172975 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1.2
12.1.3 (Patch 9239090 or 8919491) Patch 9879989 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.1 (Patch 11894708) Patch 9879989 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.2 (Patch 15880118) Patch 9879989 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1.3
12.1 RUP4 (Patch 18936791) Patch 22501192 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1 RUP4
12.1 RUP5 (Patch 22284589) Patch 23111832 JDeveloper 10g WITH OA EXTENSION ARU FOR R12.1 RUP5