Sunteți pe pagina 1din 3

Copyright (c) 2019, Oracle. All rights reserved. Oracle Confidential.

How to Retrieve a Balance Using PAY_BALANCE_PKG.GET_VALUE Function (Doc ID 295481.1)


Modified: 10-Jul-2018 Type: HOWTO

APPLIES TO:

Oracle Payroll - Version 11.5.10.2 and later


Information in this document applies to any platform.
FORM:PAYACELE - View Employee Balance
FORM:PAYUSTAX - View Tax Balances
FORM:PAYUSSOE - Statement of Earnings (US)

GOAL

Provide the steps to retrieve a balance using the PAY_BALANCE_PKG.GET_VALUE function

SOLUTION

In issues related to Payroll reporting, Payroll Archive, View Balance and View Tax forms, HRMS stores balances in various
places, however PAY_BALANCE_PKG.GET_VALUE function is used by application a lot and ultimately it returns what the
system thinks the balance is.

Which file is the function located in?

select text
from all_source
where upper(name) = upper('pay_balance_pkg')
and text like '%Header%'
and owner = ‘APPS’;

TEXT
--------------------------------------------------------------------------------
  pybaluex.pkh 
  pybaluex.pkb 

Mode to run run the function

Method to run this function (from pybaluex.pkh):

get_value - Retrieve a balance (assignment action mode)

-- ---- Assignment action mode -----


--
..
procedure get_value (p_assignment_action_id in number,
p_defined_balance_lst in out nocopy t_balance_value_tab,
p_get_rr_route in boolean default FALSE,
p_get_rb_route in boolean default FALSE);

-- ---- Date mode ----


--
function get_value
(
p_defined_balance_id in number,
p_assignment_id in number,
p_virtual_date in date
) return number;
..

Code Sample in pybaluex.pkb

In Package body pybaluex.pkb there is an example:

Integrated Example for retrieving a balance:


-------------------------------------------
Before getting the balance value all of the contexts that it uses (apart
from assignment action id) need to be set up. The balance in the following
example uses the contexts of tax unit id and jurisdiction code.
--
-- set up the contexts:
--
pay_balance_pkg.set_context ('TAX_UNIT_ID', 1);
pay_balance_pkg.set_context ('JURISDICTION_CODE', '01-123-4567');
--
-- Retrieve the balance value:
--
bal_value := pay_balance_pkg.get_value (p_def_balance_id,
p_asg_action_id);
--
-- Now retrieve the balance for a different value of jurisdiction code
-- (using the same value for tax unit id):
--
pay_balance_pkg.set_context ('JURISDICTION_CODE', '99-999-1234');
--
bal_value := pay_balance_pkg.get_value (p_def_balance_id,
p_asg_action_id);

How to Get the Variables?

There are 4 variables that we need for the get_value call in assignment_action mode:
- tax_unit_id (for set_context)
- jurisdiction_code (for set_context)
- assignment_action_id (for get_value)
- defined balance id (for get_value)

Navigate to View > Assignment Process Results form > Query an employee > Click on SOE Report button

SOE shows following balances:


Time Entry wages: YTD $259.43
SS Withheld: YTD $16.08

1. Assignment_action_id:
Go to help Diagnostics > Examine, enter apps password

Block LOV: EMPINFO


Field LOV: ASSIGNMENT_ACTION_ID
Value = 1578031

2. Jurisdiction Code
Block LOV: EMPINFO
Field LOV: JURISDICTION_CODE
Value = 44-000-0000

3. Tax Unit Id
Block LOV: EMPINFO
Field LOV: TAX_UNIT_ID
Value = 202

4. Defined_balance_id
Navigate to Total Compensation > Balance > Query relevant balance (Time Entry Wages) > click on Dimensions button. Click on
needed dimension (Assignment within Government Entity Year to Date). Go to help Diagnostics > Examine, enter apps
password

Block LOV: DFB


Field LOV: DEFINED_BALANCE_ID
Value = 31597

Final Script

SQL> set serveroutput on

'Set serveroutput on' command is important - without this command the balance call output will not be shown on the SQL plus
window.

Copy this code to the SQL Plus (Toad) window:

Declare
balance number;
Begin
pay_balance_pkg.set_context ('JURISDICTION_CODE','44-000-0000');
pay_balance_pkg.set_context ('TAX_UNIT_ID', 202 );
balance := pay_balance_pkg.get_value (31597, 1578031);
DBMS_OUTPUT.PUT_LINE('balance '|| to_char(balance));
end;
/

Result is:
PL/SQL procedure successfully completed.
balance 259.43

Note:  The above is a sample script for Oracle Payroll customers to customize and configure.

REFERENCES

NOTE:74315.1 - Oracle Payroll - Understanding Balances and Balance Retrieval


Didn't find what you are looking for?

S-ar putea să vă placă și