Showing posts with label Oracle Payroll. Show all posts
Showing posts with label Oracle Payroll. Show all posts

Monday, May 19, 2025

Fix for the error APP-PAY-07001 in Oracle Payroll

 

How to create update recurring and STOP formula result together in Oracle Payroll? 

The Update recurring entry is used to update the entry input value of the element entry through payroll processing and STOP is used to end-date the element.

There could be a scenario where we want use both in an element.
For e.g. User wants to save the loan deducted till date in one of the input values for easy visibility (at entry level) and also once the loan is completely paid out, the entry should be end-dated automatically.



As per Oracle, below is the way to design the fast formula using these two return types:
Always use the variable for STOP as zz_STOP so that it is the last action performed by the formula. The formula process each return in alphabetic order of the return variables.
For e.g. if we have below return in a formula:
RETURN 
 a_value1
 ,c_value_2
 ,d_value_3
 ,b_value_4
 ,v_value_5 → update recurring formula result
 ,STOP

then the order in which the the formula will process it will be
RETURN
a_value_1
,b_value_4
,c_value_2
,d_value_3r
,STOP
,v_value_5 →update recurring formula result

Always make sure that the STOP variable is processed as the last variable.
If the STOP variable is not the last action, the UPDATING_ACTION_ID column in PAY_ELEMENT_ENTRIES_F will not be updated correctly and this will lead to the error “APP-PAY-07001” while deleting and retrying the payroll.

The correct order of execution of return should be:
RETURN
a_value_1
,b_value_4
,c_value_2
,d_value_3r
,v_value_5 →update recurring formula result
,zz_STOP

Always use ZZ_STOP to variable name for STOP so that is always the last action processed in the RETURN.

For more such posts, please provide your inputs in the comment section

Wednesday, March 19, 2025

Query to fetch detail for Oracle DB Item used in a fast formula in Oracle Payroll

Database Items (FF_DATABASE_ITEMS) query

SELECT

    fdi.user_name       db_item_name,

    (

        SELECT

            frp.parameter_name

            || ' : '

            || frpv.value

        FROM

            ff_route_parameter_values frpv,

            ff_route_parameters       frp

        WHERE

            frpv.user_entity_id = fue.user_entity_id

            AND frp.route_parameter_id = frpv.route_parameter_id

            AND frp.sequence_no = 1

    )                   parameter_value_1,

    (

        SELECT

            frp.parameter_name

            || ' : '

            || frpv.value

        FROM

            ff_route_parameter_values frpv,

            ff_route_parameters       frp

        WHERE

            frpv.user_entity_id = fue.user_entity_id

            AND frp.route_parameter_id = frpv.route_parameter_id

            AND frp.sequence_no = 2

    )                   parameter_value_2,

    fdi.definition_text select_clause,

    fr.text             from_where_clause

FROM

    ff_database_items fdi,

    ff_user_entities  fue,

    ff_routes         fr

where fdi.user_name  = <DB_ITEM_NAME>

AND fue.user_entity_id = fdi.user_entity_id

    AND fr.route_id = fue.route_id;


For more such queries, please drop a comment in the comment section. Thanks !!

Monday, March 17, 2025

How Does Oracle Payroll Run Process works ?

 

What are Payroll Action Types?

Payroll action types are steps in Oracle used during the payroll process. These steps are divided into three parts: before, during, and after the payroll run. Before the payroll, actions like Batch Element Entry and Retro Pay are done. After the payroll, actions like Prepayments and Costing are completed.

The type of actions is stored in a lookup called ACTION_TYPE


In this article, we will focus on the Payroll Run action types that directly process an employee’s pay. These are the main steps that handle all earnings, deductions, and calculate the final salary to be paid to the employee.

What is the Payroll Run process and how is it used in Oracle Payroll? 

The Payroll Run process calculates the gross to net payment for the employees. There are two action types used for payroll run processes.

  • Quick Pay
  • Run

Quick Pay is used to process payroll run for a single employee whereas Run is used to process payroll run as a batch for multiple employees.

What happens when the payroll process is submitted?

As soon as a payroll run (quick pay or run) process is submitted in Oracle, a record is created in PAY_PAYROLL_ACTIONS table for that specific action type. The action types for Quick Pay and Run are Q and R respectively. For each assignment, a child record is created in PAY_ASSIGNMENT_ACTIONS table.

For e.g. if a Quick Pay is submitted, 1 record will be inserted in PAY_PAYROLL_ACTIONS table with action_type as Q and 1 child record will be inserted in PAY_ASSIGNMENT_ACTIONS table with the assignment_id. These two tables are joined with column payroll_action_id.

 

For Run (multiple employees), there will be multiple records in PAY_ASSIGNMENT_ACTIONS table (1 for each employee) as shown below.

The highlighted number in the Assignment Process Results form is the assignment_action_id

Navigation:
HRMS Manager > View > Assign. Process Results > Provide the assignment number > Find

 Below is the query to find a payroll action details from an assignment_action_id

select ppa.* from
pay_payroll_actions ppa
,pay_assignment_actions paa
where ppa.payroll_action_id = paa.payroll_action_id
and paa.assignment_action_id = 
3014246246
;

What is a run result?

Each eligible element entry associated with the assignment will be processed during the payroll run (whether Quick Pay or Regular Run) according to the logic and calculations specified in the fast formula. The run result represents the outcome or output of the logical calculation for an earning or deduction.
Like how elements have input values, the run result values store the output corresponding to each specific input value for that element entry.

Navigation:

HRMS Manager > View > Assign. Process Results > HRMS Manager > View > Assign. Process Results > Provide the assignment number > Find > View Results > Run Result Values 

For the previous example of the assignment_action_id, lets say the element getting processed is Basic Salary with two input value namely Monthly Basic Salary and Pay Value. The Monthly Basic Salary input value is the input to the fast formula and the Pay Value stores the output after the calculation.

For each assignment_action_id from PAY_ASSIGNMENT_ACTIONS, multiple run_result_id will be inserted into PAY_RUN_RESULTS table. The number of records inserted will depend on the number of elements processed in the payroll run. For e.g. if the payroll run (Quick Pay or Run) is processing only 1 element (Basic Salary), then only 1 record will be inserted in PAY_RUN_RESULTS table.

Below is the query to find a run result details from an assignment_action_id. This query can be modified to filter based on assignment_numbereffective_date or element_name.

SELECT
paaf.assignment_number,
ppa.effective_date,
petf.element_name,
pivf.name,
prrv.result_value
FROM
pay_payroll_actions ppa,
pay_assignment_actions paa,
pay_run_results prr,
pay_element_types_f petf,
pay_run_result_values prrv,
per_all_assignments_f paaf,
pay_input_values_f pivf
WHERE
ppa.payroll_action_id = paa.payroll_action_id
AND paa.assignment_action_id = prr.assignment_action_id
AND prr.element_type_id = petf.element_type_id
AND paaf.assignment_id = paa.assignment_id
AND prr.run_result_id = prrv.run_result_id
AND pivf.input_value_id = prrv.input_value_id
— and paaf.assignment_number = :assignment_number
AND paa.assignment_action_id = 
3014246246

— and pivf.name = ‘Basic Salary’
— and ppa.effective_date = :effective_date
AND petf.element_name = ‘Basic Salary’
AND ppa.effective_date BETWEEN petf.effective_start_date AND petf.effective_end_date
AND ppa.effective_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND ppa.effective_date BETWEEN pivf.effective_start_date AND pivf.effective_end_date
— order by 2 desc
;

Conclusion

When a payroll run process (Quick Pay or Run) is submitted, below are the tables inserted :

PAY_PAYROLL_ACTIONS
PAY_ASSIGNMENT_ACTIONS
PAY_RUN_RESULTS
PAY_RUN_RESULT_VALUES

 

For more such articles, please drop a comment in the comment section.