You are on page 1of 16

Balance Group Extracts - Custom Balance Group

Useful link :

https://docs.oracle.com/cloud/latest/globalcs_gs/FAIGP/FAIGP1427196.htm

https://docs.oracle.com/cloud/latest/globalcs_gs/FAGPI/FAGPI1635417.htm

Sample Extract Definition : AR b1_2017-08-17.xml

Output XML : output_balance.xml

Balance Definitions

What need to be reported is dependent of business requirements and represented as balance definitions. To create balance definitions

Open Manage Balance Definitions task on Payroll Calculation WorkArea, and click Create icon.
Select a Legislative Data Group on the popup

Next, Specify Name, Reporting Name, Unit of Measure and Balance Category and click on Next.
Select and add the Balance Dimensions which you want.

Create Balance Feeds for this balance


Balance feeds define the input values that contribute to a balance, and they can be created by two types:

a) Balance Feeds by Classification :

When an element classification feed is specified and saved, all the elements in that classification are automatically shown in
Balance Feeds by Element section

b) Balance Feeds by Element :

Select an element and its input value to feed this balance

Feeds can add to (+) or subtract from (-) a balance, and please refer to Balance Feeds: Explained for details.

Note that this Balance Definition 'AR Testing' created is only for illustration purpose and has 'not' been used anywhere in this documentation.
Customer has to create Balance Definition (if required) based on his requirement.

Hence we prefered to use existing/seeded Balance Definiton 'Gross Earnings' to illustrate further for ease of understanding.

Balance Groups

A balance group is a collection of balance definitions. The balance definitions created in above steps need to be added into a balance group. To
create a balance group,

Open Manage Balance Groups task on Payroll Calclation WorkArea, and click Create icon.

Select a Legislative Data Group and enter a Name for this balance group on the popup

Select Employee as the balance group level.

On Balance Definitions node of this balance group, select and add the Balance Definitions which the report wants to display.
Balance Group Usages

A balance group usage identifies which reports, pages, and processes use the balance group to display or process balance information. To create
a balance group usage,

Open Manage Balance Group Usages task on Payroll Calclation WorkArea, and click Create icon.
Choose the Legislative Data Group on which the balance group above was created, and enter Name and select the Balance Group
created above.
A balance group usage can use Matrix or Table format. Matrix Item node is enabled only for Matrix format for specifying the display position
of the balance value for a particular balance dimension

Select Report Type

In Matrix Items panel, add balance dimensions that you want. NOTE: If you put several dimensions in the same position their values
will be summarized together.

Sorting determines the order in which the balance values in a balance group are displayed. Select Create from Actions menu to create a
new sort

Three available sort methods:

Name - Sort by balance name

Value - Sort by balance value

Static Order - Sort balances according to the sequence in the Sort Items table.

Sort Items table defines the static sort order in which the balance values in a balance group are displayed and it's enabled only for sort
method of Static Order. It might be sort by either Balance Type or Defined Balance depending on Sort By field in this sort.

1) Go to Data Exchange Manage Extract Definitions. Create a extract.

2) Add Data Group of any user entity where "PAYROLL_REL_ACTION_ID" is set.


As you can see main data group user entity is "pay_interface_payroll_rel_ue" who sets the context "payroll_rel_action_id".

3) Click on Create Record. Then select detail record as type and instead of fast formula select balance group. We can use any custom balance
group usage. Ensure that PAYROLL_REL_ACTION_ID is set in the current or parent data group so that context is derived.

We are using custom balance group usage "AR Test Asgm" create in above steps.
4) To retrieve the dimension values add the attributes(data elements) in record as procedure elements.

Select any balance dimension. Use below query to get period_type which has to be used as Short Code when Attribute/Data Element is created.
You should have RUN dimension in Balance Group Usage to make sure RUN attribute works. It can be any RUN dimension. For
example in our Balance Group Usage Assignment Tax Unit Run.

SELECT period_type
FROM PAY_BALANCE_DIMENSIONS where BASE_DIMENSION_NAME like '%Assignment Tax Unit Run%';

Attribute/Data elements in extract can either be resolved by Short_Code (pay_balance_dimensions.period_type) or position(pay_bal_grp_usage_


items.position) . Position method should be used in cases of multiple CUSTOM or U% period type dimensions(ex: UYEAR) having the same
contexts and dimension level.
In case of a mixture of naming formats being used, elements using this positional reference would take precedence.

Reserved short code for balance values in different period type: RUN/MONTH/QUARTER/YEAR/TYEAR/FYEAR/LIFETIME

NOTE : When balance group usage is of matrix type all dimensions come in same Data Group. But for PTD(Period) dimensions it comes in
separate XML Data Group since PTD dimension has an additional context it appears in a separate row.

The output column should start from 61 and there should be no duplicates on the Output Column.

For example below is one of the attributes created.


5) Use the below query to know what all contexts are required for particular balance group usage and create attribute for each context. Attributes
created should have attribute name and shortcode as BASE_CONTEXT_NAME in the below query output.

----------------------------( Sample Short codes for contexts

Mandatory: BALANCE_TYPE_ID /BASE_BALANCE_NAME

Optional: REPORTING_NAME/ CATEGORY_NAME

Possible Contexts(Varies based on balance dimensions used) : PAYROLL_ID / PAYROLL_ACTION_ID / TAX_UNIT_ID /


CALC_BREAKDOWN_ID / PAYROLL_RELATIONSHIP_ID / PAYROLL_REL_ACTION_ID / PAYROLL_TERM_ID /
PAYROLL_ASSIGNMENT_ID/EFFECTIVE_DATE/THIRD_PARTY_PAYEE_ID/AREA1/AREA2/AREA3/AREA4)
)-----------------------------------------------------------------------------------------------------------------

SELECT distinct ctx.BASE_CONTEXT_NAME


FROM PAY_BAL_GRP_USAGES pbgu,
PAY_BAL_GRP_INCLUSIONS pbgi,
PAY_BALANCE_ATTRIBUTES pba,
PAY_DEFINED_BALANCES pdb,
PAY_BALANCE_DIMENSIONS pbd,
PAY_DIM_CONTEXT_USAGES pdcu,
FF_CONTEXTS_B ctx
WHERE pbgu.BALANCE_GROUP_ID=pbgi.BALANCE_GROUP_ID
and pbgi.ATTRIBUTE_ID=pba.ATTRIBUTE_ID
and pba.DEFINED_BALANCE_ID=pdb.DEFINED_BALANCE_ID
and pdb.BALANCE_DIMENSION_ID=pbd.BALANCE_DIMENSION_ID
and pbd.BALANCE_DIMENSION_ID=pdcu.BALANCE_DIMENSION_ID
and pdcu.CONTEXT_ID=ctx.CONTEXT_ID
and pbgu.BASE_GROUP_USAGE_NAME = 'AR Test Asgm';

a) Below is the screenshot of the query results for Assignment Level (i.e. Balance Group Usage is AR Test Asgm).
All the above required contexts should be added as procedure elements.
Below is list of all Attribute/Data Elements which are valid for a balance Group Record.

6) Now run the extract for a valid payroll.


Sample XML output

================================================================
==========================
Verification/Debugging:

If you donot get data in the extract as expected , please follow below steps to debug the issue ..

1) Ensure you substitute correct payroll which has processed balances. To know which payrolls have balances processed, follow
below steps..

a) For that particular LDG check the latest runs of Calculate Gross Earnings in Checklist UI.

b) Above run is for payroll name : "ZHRX_VS_US_TPPI_Payroll" ( highlighted below )

To check if this payroll has processed any balances..Click on Go to task. As highlighted below, two assignments are processed in this
run.
To know for a particular employee if payroll has processed the balances ..

a) Go to Payroll Calculation View Person Process Results. Select any person number and go to that run.

Click on Balance Results Search for your balance group usage and search and check whether you get any rows as shown below.
Other Helper queries:
1) Get payroll_id for that person_number using below query and run the extract with that payroll_id.

select prl.LEGISLATIVE_DATA_GROUP_ID,prl.payroll_relationship_id,prl.payroll_relationship_number,prl.person_id,pap.*
from PAY_PAY_RELATIONSHIPS_DN prl,

PAY_REL_GROUPS_DN asg,
PAY_ASSIGNED_PAYROLLS_DN pap
where prl.PAYROLL_RELATIONSHIP_ID=asg.PAYROLL_RELATIONSHIP_ID
and asg.PARENT_REL_GROUP_ID=pap.payroll_term_id
and prl.person_id='300100085812529';

2) Specific Dimension should have contexts set and Balance should have contexts set .. !!

select pbd.base_dimension_name
,pbd.dimension_level
,pbd.period_type
,pbd.route_id
,pbd.base_db_item_suffix
,pbd.dimension_type
,pdu.database_item_suffix
,pdcu.sequence_no
,fcb.base_context_name
,fcb.data_type
,fcb.user_context_flag

from PAY_DIM_CONTEXT_USAGES pdcu


,pay_balance_dimensions pbd
, PAY_DIMENSION_USAGES pdu
,FF_CONTEXTS_B fcb
where pbd.base_dimension_name like '%Core Assignment Tax Unit,Area1,2,3 Period to Date%'
and pbd.balance_dimension_id=pdcu.balance_dimension_id
and pbd.balance_dimension_id=pdu.balance_dimension_id
and pdcu.context_id=fcb.context_id

You might also like