About Me

Dubai, United Arab Emirates
My name is Muhammad Faizan Karim and my aim is to spread the knowledge to everyone who want to learn oracle HRMS. I will try to write the video blogs for beginners so they can understand e-business suits from HRMS perspective, and if you have any difficulty in oracle applications HRMS , please feel free to contact with me at this email : faizan.kareem.ocp@gmail.com
Powered by Blogger.
Thursday, August 20, 2015

How to use same data definition/template for multiple concurrent programs?


Scenario:
Consider for example that there are two different concurrent programs (because they have different set of parameters) and both wants to use the same data definition (xml file) and Template (RTF layout)
Problem:
Both concurrent programs need to use same data definition (the same data template xml file) and same RTF layout template. However when registering data definition in the E-Biz, the data definition code must match shortname of concurrent program, hence there is a need to create two data definitions (for the same data template xml file) .  Again, because the layout template is attached with data definition,  the Templates also needs  to duplicated
In summary:  Physically there is only one xml data template file and only one RTF file, however to meet the the above requirement we need to create duplicate Data Definitions and Template registrations attaching the same xml and rtf files in both.
The problem is maintenance. In future any change in the xml/rtf needs to be uploaded against all the definitons and problem becomes more severe if you have more number of concurrents sharing the single  xml/rtf files.
Solution
It is very simple;  we create only one CP with executable XDODTEXE and all other concurrent programs will use a PL/SQL procedure as executale (instead of XDODTEXE) and submit the first CP by passing necessary parameters.
  1. Create first concurrent program (for e.g. XXFIRSTCP)  with executable XDODTEXE
  2. Create Data definition XXFIRSTCP and attach the xml data template file
  3. Create Layout template XXFIRSTCP_RTF and attach the related RTF layout template file.  So far it is all normal that we do to create an XMLPublisher based report
  4. Create a custom package and procedure as a concurrent executable and it should submit XXFIRSTCP using  FND_REQUEST.SUBMIT_REQUEST and create executable in ebiz (for e.g. XXFIRSTCPEXE)
  5. Create all other concurrent programs (for e.g. XXSECONDCP, XXTHIRDCP …) that you need using executable created above (XXFIRSTCPEXE)
Now when you submit any of the concurrent program internally it will always use only one Data Definition / Template.

NOTE:  The user will have to check the output of internally submitted concurrent and not the one he/she submits.  To overcome this problem you can also copy the output to user submited concurrent
Thursday, June 25, 2015
/*===========================================================================+
 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 +===========================================================================+
 |  HISTORY                                                                  |
 +===========================================================================*/
package xxhr.oracle.apps.per.probation.webui;

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.per.selfservice.deployperson.webui.AssignmentCO;

import java.util.Enumeration ;

/**
 * Controller for ...
 */
public class XXHRPerProAssignCO extends AssignmentCO
{
  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);

    if(pageContext.isLoggingEnabled(2)){
          pageContext.writeDiagnostics(this, "XXHR Start of debug", 2);
    }

/** Code Start **/

String parameterName;
Enumeration e = pageContext.getParameterNames();
while(e.hasMoreElements())
{
parameterName = (String)e.nextElement();
if(pageContext.isLoggingEnabled(2)){
pageContext.writeDiagnostics(this, "Parameter Name=>" + parameterName + " Parameter Value=> " + pageContext.getParameter(parameterName),2);
}

}

/** Code End **/

    if(pageContext.isLoggingEnabled(2)){
          pageContext.writeDiagnostics(this, "XXHR End of debug", 2);
    }
  }

  /**
   * 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);
  }

}
Sunday, May 17, 2015
Salary Proposal and Salary Components Query 

Select
--       (select name from v$database) "Instance",
--        pca.segment2 "CC Code",
--        papf.person_id per_id ,paaf.assignment_id asg_id ,paaf.organization_id org_id ,paaf.payroll_id,
    papf.employee_number as "Employee ID"
--        ,paaf.assignment_number
--        ,(select name from apps.per_pay_bases ppb where paaf.pay_basis_id = ppb.pay_basis_id) "Pay Basis"
--        ,papf.title "Title"
--        ,NVL(initcap(replace(substr(papf.email_address,0,instr(papf.email_address,'@')-1),'.',' ')),initcap(rtrim(papf.known_as))) "Preferred Name"
--        ,initcap(rtrim(papf.known_as)) as "Preferred Name"
--        ,initcap(rtrim(papf.full_name,'-')) as "Employee Name"
    ,initcap(rtrim(nvl(papf.known_as,papf.full_name),'-')) as "Employee Name"
--        ,papf.first_name "First Name"
--        ,papf.middle_names "Middle Name"
--        ,papf.last_name "Last Name"
--        ,papf.registered_disabled_flag "Registered Disabled Flag"
    ,ppos.date_start "Joining Date"
--        ,apps.hr_general.decode_lookup('SEX',papf.sex) "Gender"
--        ,apps.hr_general.decode_lookup('MAR_STATUS',papf.marital_status) as "Marital Status"
--        ,apps.hr_general.decode_lookup('AE_RELIGION',papf.per_information10) as "Religion"
--        ,apps.hr_general.decode_lookup('AE_NATIONALITY',papf.per_information12)"Country"
--        ,apps.hr_general.decode_lookup('AE_NATIONALITY',papf.per_information18) as "Nationality"
--        ,papf.region_of_birth as "Point of Origin"
--       ,papf.date_of_birth "Date of Birth"
--       ,round(months_between(trunc(sysdate),papf.date_of_birth)/12) "Age"  
--       ,papf.town_of_birth "Town of Birth"  ,papf.country_of_birth "Country of Birth"
--       ,papf.email_address as "Email Address"
--       ,papf.previous_last_name "Previous Last Name"
--       ,papf.internal_location "Location"
--       ,apps.hr_general.get_phone_number(papf.person_id,'W1',TRUNC(SYSDATE)) "Work No"
--       ,apps.hr_general.get_phone_number(papf.person_id,'M',TRUNC(SYSDATE)) "Mobile No"
       --,pg.name "Grade"
--       ,pj.name "Job"
--       ,pap.name as "Position"
--       ,substr(pap.name,instr(pap.name,'.',1,1)+1,4) pos_cc_code    
--       ,substr(pap.name,instr(pap.name,'.',1,2)+1) "Position"
--       ,ppf.payroll_name as "Payroll"
--       ,paaf.ass_attribute4 "Remarks"
--       ,paaf.ass_attribute1 "Excep Leave Entitlement"
--       ,paaf.effective_start_date "Eff Start Date"
--       ,paaf.assignment_status_type_id asg_typ_id
--       ,past.user_status as "Assignment Status"
--       ,apps.hr_general.decode_lookup('AE_EDUCATION_LEVEL',papf.per_information11) "Education Level"
--       ,nvl(apps.fnd_date.canonical_to_date(ppos.attribute1),ppos.actual_termination_date) "Leaving Date"
--       ,ppos.last_standard_process_date "LSP Date"
--       ,replace(substr(pex.email_address,0,instr(pex.email_address,'@')-1),'.',' ') "Supervisor Name"
,c.PROPOSED_SALARY_n Basic_Salary
,c.CHANGE_DATE
--,d.APPROVED Sal_Component_status
,apps.hr_general.decode_lookup('PER_SAL_PROPOSAL_STATUS', d.APPROVED) AS SALARY_PROPOSAL_STATUS
--,d.Component_Reason
,apps.hr_general.decode_lookup('PROPOSAL_REASON',d.Component_Reason) COMPONENT_REASON_MEANING
,d.change_amount_n Change_Amount
,d.change_percentage
from   apps.per_all_people_f             papf
      ,apps.per_all_assignments_f        paaf
      ,apps.per_business_groups          pbg
      ,apps.hr_all_organization_units    haou
      ,apps.per_periods_of_service       ppos
      ,apps.per_assignment_status_types  past
      ,apps.pay_cost_allocation_keyflex  pca
      ,apps.pay_payrolls_f               ppf
      ,apps.per_grades                   pg
      ,apps.per_all_positions            pap
      ,apps.pER_PAY_pROposals             c,
       apps.per_pay_proposal_components   d
--      ,apps.per_position_definitions     ppd
--      ,apps.per_jobs                     pj
--      ,apps.pay_people_groups            ppg
--      ,apps.per_employees_x              pex
--      ,apps.hr_soft_coding_keyflex       hsck
where papf.person_id                   = paaf.person_id
AND   paaf.ASSIGNMENT_ID = C.ASSIGNMENT_ID
and c.pay_proposal_id = d.pay_proposal_id(+)
AND c.CHANGE_DATE =
               (SELECT   MAX (d.CHANGE_DATE)
                  FROM   pER_PAY_pROposals d
                 WHERE   d.ASSIGNMENT_ID = paaf.ASSIGNMENT_ID
                         AND d.approved = 'Y')
and   paaf.primary_flag                = 'Y'
and   paaf.assignment_type             = 'E'
and   papf.current_employee_flag       = 'Y'
and   paaf.period_of_service_id        = ppos.period_of_service_id
and   pbg.business_group_id            = haou.business_group_id
and   paaf.organization_id             = haou.organization_id(+)
and   paaf.assignment_status_type_id   = past.assignment_status_type_id
and   haou.cost_allocation_keyflex_id  = pca.cost_allocation_keyflex_id(+)
and   paaf.payroll_id                  = ppf.payroll_id(+)
and   paaf.grade_id                    = pg.grade_id(+)
and   paaf.business_group_id           = pap.business_group_id(+)
and   paaf.position_id                 = pap.position_id(+)
--and   pap.position_definition_id       = ppd.position_definition_id(+)
--and   paaf.people_group_id             = ppg.people_group_id(+)
--and   paaf.job_id                      = pj.job_id(+)
--and   pex.employee_id                  = paaf.supervisor_id(+)
--and   paaf.soft_coding_keyflex_id      = hsck.soft_coding_keyflex_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   trunc(sysdate) between haou.date_from and nvl(haou.date_to,'31-DEC-4712')
and   trunc(sysdate) between ppf.effective_start_date(+) and ppf.effective_end_date(+)
--and   paaf.effective_start_date <= (SELECT MAX(NVL(b2.actual_termination_date, TRUNC(SYSDATE))) FROM apps.per_periods_of_service b2 WHERE b2.person_id = paaf.person_id AND b2.date_start <= TRUNC(SYSDATE))
--and   paaf.effective_end_date   >= (SELECT MAX(NVL(b2.actual_termination_date, TRUNC(SYSDATE))) FROM apps.per_periods_of_service b2 WHERE b2.person_id = paaf.person_id AND b2.date_start <= TRUNC(SYSDATE))
--and   papf.sex = 'M'
--and   paaf.payroll_id is not null
--and   paaf.grade_id is not null
--and   to_char(ppos.date_start,'YYYY') = '2013'
--and   pg.attribute2 = 'Y'
----Query to get -----Organization and Child Organizations Details------
and   paaf.organization_id = any (
                          select e.organization_id_child
                            from per_org_structure_elements e
                           where e.org_structure_version_id = any (select org_structure_version_id
                                                                from per_org_structure_versions
                                                                where organization_structure_id = any(
                                                                select organization_structure_id
                                                                from per_organization_structures
                                                                where primary_structure_flag ='Y')
                                                                and trunc(sysdate) between date_from and nvl(date_to,trunc(sysdate)) )
                      connect by e.organization_id_parent =
                                                  prior e.organization_id_child
                             and e.org_structure_version_id = any(select org_structure_version_id
                                                                from per_org_structure_versions
                                                                where organization_structure_id = any(
                                                                select organization_structure_id
                                                                from per_organization_structures
                                                                where primary_structure_flag ='Y')
                                                                and trunc(sysdate) between date_from and nvl(date_to,trunc(sysdate)) )
                      start with e.organization_id_parent =   XX
                             and e.org_structure_version_id = any (
                                                              select org_structure_version_id
                                                              from per_org_structure_versions
                                                              where organization_structure_id = any(
                                                              select organization_structure_id
                                                              from per_organization_structures
                                                              where primary_structure_flag ='Y')
                                                              and trunc(sysdate) between date_from and nvl(date_to,trunc(sysdate)) )
                                       )
--order by paaf.last_update_date desc
Wednesday, April 29, 2015
Vacation Rules
Vacation Rules in Oracle R12

In this post we will see how to create vacation rules when you want to transfer notifications meant for you to your colleague.

The First Step is to login in Oracle and click on Notification summary

Navigate to Suppose HRMS Super user > Notifications Summary



 Click in Vacation Rules at the bottom of the page









Select Item type for which you want to create Vacation rules. We will take "ALL" for our example. Click Next.















#Enter Start Date from which you want to transfer notifications
#Optionally enter End Date
#Optionally Enter a message which will be displayed with routed notifications.
#In Reassign, select the user name whom you want to transfer the notification
# Select "Delegate Your Response" if you want to delegate all notification approvals to an assistant.
# Select "Transfer notification ownership" if you want to transfer notifications for a specific project to the new manager of that project.












Click Apply
Table Involved: WF_ROUTING_RULES

Note: The key to setting-up a valid Vacation Rule is to ensure the rule is tied to a Username rather than the Full Name of the desired user.  The reason for this is that the Worklist and Notification Summary for the user is linked to their username and not full name record (Reference Metalink)

Suppose a person forgot to create vacation rules then in that case we can also use Management >Forward Documents or you can reassign it using workflow monitor.
Monday, January 12, 2015
SQL Query to get the RTF files from database 
(XML Publisher Reports)

SELECT XTT.TEMPLATE_NAME "TEMPLATE NAME", 
       XTB.TEMPLATE_CODE "TEMPLATE CODE",
       FAT.APPLICATION_NAME "APPLICATION NAME",
       XDDT.DATA_SOURCE_NAME "DATA DEFINITION",
       XTB.TEMPLATE_TYPE_CODE "TEMPLATE TYPE",
       XTB.DEFAULT_LANGUAGE "LANGUAGE", 
       XTB.DEFAULT_TERRITORY "TERRITORY",
       XL.FILE_NAME "FILE NAME", XL.FILE_DATA "FILE"

FROM XDO_TEMPLATES_TL XTT,
       XDO_TEMPLATES_B XTB,
       FND_APPLICATION_TL FAT,
       XDO_DS_DEFINITIONS_TL XDDT,
       XDO_LOBS XL

WHERE (XTT.TEMPLATE_NAME LIKE '%TEMPLATE NAME%')
   AND XTT.LANGUAGE = 'US'
   AND XTB.TEMPLATE_CODE = XTT.TEMPLATE_CODE
   AND FAT.APPLICATION_ID = XTB.APPLICATION_ID
   AND FAT.LANGUAGE = 'US'
   AND XDDT.DATA_SOURCE_CODE = XTB.DATA_SOURCE_CODE
   AND XDDT.LANGUAGE = 'US'
   AND XL.LOB_CODE = XTB.TEMPLATE_CODE
   AND NVL (XL.PROGRAM, 'X') <> 'RTF2XSLPARSER 5.6.3'
   AND XL.LANGUAGE = XTB.DEFAULT_LANGUAGE
   AND XL.TERRITORY = XTB.DEFAULT_TERRITORY