Saturday 27 February 2016

API to Purge/Delete Employee from HRMS application


API to Purge/Delete Employee from HRMS application


You can use API HR_PERSON_API.DELETE_PERSON to delete an employee(person) and the associated person related records.

Example:

DECLARE
  -- Input Variables
  l_validate BOOLEAN    := FALSE;
  l_effective_date DATE := sysdate;
  l_person_id                 NUMBER    := 123048;
  l_perform_predel_validation BOOLEAN   := FALSE;
  -- Output Variables
  l_person_org_manager_warning VARCHAR2(2000);
BEGIN
  --  Calling API HR_PERSON_API.DELETE_PERSON
  hr_person_api.delete_person(p_validate                   => l_validate ,
                              p_effective_date             => l_effective_date ,
                              p_person_id                  => l_person_id ,
                              p_perform_predel_validation  => l_perform_predel_validation ,
                              p_person_org_manager_warning => l_person_org_manager_warning );
  --
  dbms_output.put_line('Employee deleted successfully');
  --
EXCEPTION
WHEN OTHERS THEN
  dbms_output.put_line('Error : ' || sqlerrm);
END;
/
Some more information on the API parameters
p_perform_predel_validation:
When this parameter is set to TRUE, the API performs a check to see if any data in addition to that set up by default, e.g. data in per_all_people_f, per_all_assignments_f, per_periods_of_service exists for the person. If no additional data exists, then the API cascade deletes the person data. If any additional data exists for this person in any non-HRMS tables, then this person will not be deleted irrespective of whether only default data exists. When this parameter is set to FALSE, the API cascade deletes all data held in HRMS tables for this person, provided no additional data exists in any non-HRMS tables.

p_person_org_manager_warning:
If the person being deleted is an organization manager, then a warning message will be returned otherwise no value will be returned.

Prerequisites:
Employee and fnd_user link must be removed by removing the person in users form
No Payroll should be processed on employee till-date
Note:
If the employee has an active payroll then we cannot purge the record. The alternative way is to either end date the employee using the termination screen or you need to change the person from ‘Employee’ to ‘Applicant’ and then use the above API again to purge the record.

Sunday 14 February 2016




This is one of those topics which has often eluded us from understanding it in a better way than any other part of Oracle Payroll. But, this is one of the most important and vital feature of Oracle Payroll and HRMS on the whole.

It’s through the Costing that Human Resources interact with the Oracle Financials (GL) out of the box.

Let take an insight into this concept of Costing.

Costing as a concept is to account the cost incurred on an employee in terms of compensation provided to him/her by the organization. Oracle achieves this through three processes;


Costing
Costing of Payment
Transfer to Ledger(GL/SLA)
 We'll see each of these briefly;

Costing
Generates accounting entries for elements processed in Run/Quick Pay
Debits the Costing account and Credits the Clearing/Control account.
Accounting Entries are determined by the values of Cost Allocation KFF at different levels.
Whether to transfer to GL or not is determined by the “Transfer to GL” checkbox at Element Link level.
 Costing of Payments
Generates accounting entries based on the Prepayments. If no prepayments, no Costing of Payment for the employee.
Debits the Clearing/Control Account and Credits the Cash Clearing Account.
Accounting Entries are determined by the values provided at the Payment Method level.
Whether to transfer to GL or not is determined by the “Transfer to GL” checkbox at Payment Method level.
Transfer to Ledger (GL/SLA)
Based on whether the “Transfer to GL” checkbox at Element Link and Payment Method Level are checked.
Will transfer all the entries generated by the Costing Process to the GL_INTERFACE table.
Will transfer only those entries generated by Payment of Costing for whom there is a payment process (Cash, Cheque, Direct Deposit, etc) to the GL_INTERFACE table.







Tuesday 9 February 2016

People Group Flexfield

People Group Flexfield


Key Flexfield: People Group Flexfield


Flexfield Title or Name : People Group Flexfield
Application Name: Payroll 




Table Name
Unique Column
Description
PAY_PEOPLE_GROUPS
PEOPLE_GROUP_ID
People Group Flexfield

Monday 8 February 2016

How to know user password from Back End in Oracle apps R12

How to know user password from Back End in Oracle apps R12

1.

CREATE OR REPLACE PACKAGE get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;
END get_pwd;
2.

CREATE OR REPLACE PACKAGE BODY get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
END get_pwd;
/
3. run below select query you will get user_name and password.

select usr.user_name,
       get_pwd.decrypt
          ((select (select get_pwd.decrypt
                              (fnd_web_sec.get_guest_username_pwd,
                               usertable.encrypted_foundation_password
                              )
                      from dual) as apps_password
              from fnd_user usertable
             where usertable.user_name =
                      (select substr
                                  (fnd_web_sec.get_guest_username_pwd,
                                   1,
                                     instr
                                          (fnd_web_sec.get_guest_username_pwd,
                                           '/'
                                          )
                                   - 1
                                  )
                         from dual)),
           usr.encrypted_user_password
          ) password
  from fnd_user usr
 where upper(usr.user_name) = upper('&user_name');