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.
Tuesday, December 6, 2016
Function to Get HRMS Table Balances

FUNCTION GET_BALANCE_VALUE (p_assignment_id    IN NUMBER,
                               p_balance_name     IN VARCHAR2,
                               p_dimension_name   IN VARCHAR2,
                               p_date             IN DATE)
      RETURN NUMBER
   IS
      v_bg_id            per_business_groups.business_group_id%TYPE;
      v_leg_code         per_business_groups.legislation_code%TYPE;
      v_defined_bal_id   pay_defined_balances.defined_balance_id%TYPE;
      v_bal_value        NUMBER;
   --
   BEGIN
      --
      SELECT paaf.business_group_id, pbg.legislation_code
        INTO v_bg_id, v_leg_code
        FROM apps.per_business_groups pbg, apps.per_all_assignments_f paaf
       WHERE     paaf.business_group_id = pbg.business_group_id
             AND paaf.assignment_id = p_assignment_id
             AND paaf.primary_flag = 'Y'
             AND paaf.assignment_type = 'E'
             AND TRUNC (p_date) BETWEEN paaf.effective_start_date
                                    AND  paaf.effective_end_date;

      --
      v_defined_bal_id :=
         get_defined_balance_id (v_bg_id,
                                 p_balance_name,
                                 p_dimension_name,
                                 v_leg_code);
      --
      v_bal_value :=
         get_balance_value_on_date (p_assignment_id,
                                    v_defined_bal_id,
                                    p_date);
      RETURN v_bal_value;
   --
   EXCEPTION
      WHEN OTHERS
      THEN
         RETURN 0;
   END GET_BALANCE_VALUE;

0 comments: