A Technical Perspective of The AP To GL
A Technical Perspective of The AP To GL
A Technical Perspective of The AP To GL
To
Bottom
Type:TROUBLESHOOTING
In this Document
Purpose
Troubleshooting Steps
1. UNDERSTANDING THE AP-SLA-GL RECONCILIATION
2. RECONCILING THE AMOUNTS AND UNDERSTANDING THE DATA FLOW BETWEEN
SLA AND GL
Key Tables and Columns used for Reconciliation
3. ESTABLISHING A BASELINE FOR ADDRESSING 11i UPGRADE ISSUES
Scenario
Technical perspective
Common Reasons why Reconciliation issues are Encountered During the Upgrade
Analyzing the Difference in the R12 Trial Balance
How to Analyze the Data Even Further
4. RECONCILING R12 DATA AND ADDRESSING R12 TRIAL BALANCE-GL ISSUES
5. UNDERSTANDING HOW UNDO ACCOUNTING CAN IMPACT RECONCILIATION
Scenario
Original Event/Accounting
How to find events/entities created by Undo Accounting
6. APPENDIX
Applies to:
Oracle Payables - Version 12.0.0 to 12.0.5 [Release 12.0]
Information in this document applies to any platform.
Checked for relevance 18-Jun-2013
Purpose
This document offers a technical perspective of the AP-GL Reconcialition. Its purpose is to assist the
reader with reconciliation issues. In the simplest terms, AP-GL reconciliation means tallying the amounts
in Accounts Payable (i.e., AP) for a CCID/Supplier and reconciling it to the figures in the General Ledger
(GL).
This document covers the following topics:
Troubleshooting Steps
1. UNDERSTANDING THE AP-SLA-GL RECONCILIATION
In R12, AP does not store any accounting information. Reconciliation of the posted transactions is done
using data in the Subledger Accounting (SLA) tables.
XLA_TRIAL_BALANCES (XTB) -This is the SLA Trial Balance table. It captures the invoice
and payment amounts, with respect to a supplier. It is built using the data from the
AP_LIABILITY_BALANCES in 11i and detailed information captured in XDL for R12 data.
Only transactions transferred to GL are captured in this table.
XLA_AE_LINES (XAL) - This is the SLA Detailed Lines table.
XLA_DISTRIBUTION_LINKS (XDL) - This is the SLA Distributions table. It captures the
lowest level granularity of a transaction's accounting. It is important to understand the information
captured in XDL. This table stores the details at the distribution level for both source and applied
transactions because AP utilizes the business flow feature of SLA. Applied Transaction means a
transaction such as Payments, which is applied to an Invoice, or it could also mean a transaction,
such as a Prepayment.
Description
Ref to AP
APPLIED_TO_ENTITY_ID
APPLIED_TO_SOURCE_ID_NUM_1
APPLIED_TO_DIST_ID_NUM_1
REF_AE_HEADER_ID
REF_TEMP_LINE_NUM
REF_EVENT_ID
AP_INVOICE_PA
& AP_PAYMENT_
ACCOUNTING_
ENTRY_
BALANCE
STATUS_
TYPE_COD
CODE
INVOICE_VALIDATION
E1/H1/200
Y/null
A-actual, Eencumbrance
PAYMENT_CREATED
(don't consider MANUAL E2/H2/200
ever)
Y/null
A-actual, Eencumbrance
ENTITY_ID
CODE_
/AE_HEADER_ID/ ACCOUNTED_ ENTERED_ CURRENCY_
GL_SL_LINK_ID/
COMBINATION_
AE_LINE_NUM/
CR/DR
CR/DR
CODE
GL_SL_LINK_TABLE
ID
APPLICATION_ID
E1/H1/L1/200
500/0
500/0
USD
1000
123451/APECL
E1/H1/L2/200
500/0
500/0
USD
1000
123452/APECL
E1/H1/L3/200
500/0
500/0
USD
1500
123453/APECL
E2/H2/L1/200
0/250
0/250
USD
1000
123454/APECL
E2/H2/L2/200
0/250
0/250
USD
1000
123455/APECL
E2/H2/L3/200
0/250
0/250
USD
1500
123456/APECL
EVENT_
CLASS_
CODE
E1
--
1000/0
500/0
USD
1000
AP_INVOICE
E1
--
500/0
500/0
USD
1500
AP_INVOICE
E2
E1
0/500
0/500
USD
1000
AP_PAYMEN
E2
E1
0/250
0/250
USD
1500
AP_PAYMEN
* L1 and L2 are summed into TB, as the CCID and Entity/Header are the same.
GL_IMPORT_REFERENCES (GL_IMP_REF) Table
If summ
p
JE_HEADER
GH1/GL1
B1
123451/APECL
GH1/GL1
GH1/GL2
B1
123452/APECL
GH1/GL1
GH1/GL3
B1
123453/APECL
GH1/GL2
GH2/GL1
B2
123454/APECL
GH2/GL1
GH2/GL2
B2
123455/APECL
GH2/GL1
GH2/GL3
B2
123456/APECL
GH2/GL2
* GIR and XAL are always one-one. For R12, GL_SL_LINK_TABLE is XLAJEL
GL_JE_HEADERS (GJH) Table
B1
A/E
--
--
--
123451/APECL
500/0
USD
GH1/GL2
123452/APECL
500/0
USD
GH1/GL3
123453/APECL
500/0
USD
GH2/GL1
123454/APECL
0/250
USD
GH2/GL2
123455/APECL
0/250
USD
GH2/GL3
123456/APECL
0/250
USD
1000/0
USD
GH1/GL2
500/0
USD
GH2/GL1
0/500
USD
GH2/GL2
0/250
If GL_SL_LINK_ID is populated in GJL, then you are using Detailed Posting
USD
Scenario
Let us use the following as your Trial Balance, as of the upgrade period Nov 2007
CCID
GL Account
GL
Manual JE
AP
Diff GL - SLA+Man JE
F=C-E+D
15151
XXX
307778.71
0.00
499899.92
-192121.21
15071
YYY
15067997.42
0.00
15067997.42
0.00
15511
ZZZ
7174644.29
0.00
7174644.29
0.00
Technical perspective
AP does not upgrade all data in the XDL table.This implies that the XTB table cannot be constructed from
the XAL and XDL tables, for upgraded data.
For upgraded data, XTB is built from the AP_LIABILITY_BALANCE (APLB) table. APLB stores
Payment details under the INVOICE_ID only.
The KEY joins from an upgrade perspective are -
OR
Note: The data manager that is run later in the day will not be of any help.
Common Reasons why Reconciliation issues are Encountered During the Upgrade
AP upgrade did not upgrade the accounting events correctly so the accounting events exist in AP
and not in SLA.
There are ACCOUNTING_EVENT_IDs in AP that are not stamped back to invoice distributions
so the invoice distributions were not upgraded to SLA.
In 11i, if there is a mismatch in the AE_LINE_ID col in AP_AE_LINES_ALL and
AP_LIABILITY_BALANCE, then that data is NOT available in XTB
If there is data corruption in the 11i AP_LIABILITY_BALANCE table
If UNDO accounting is done on an 11i accounted event
QR1 -- SQL Query Reference 1 Run this SQL script to show the data in the AP Liability table that should
appear on the 11i Trial Balance
create table ap_tb as
select code_combination_id, invoice_id, sum(nvl(accounted_cr,0)) cr, sum(nvl(accounted_dr,0))
dr,sum(nvl(accounted_cr,0)) - sum(nvl(accounted_dr,0)) diff
from ap_liability_balance where set_of_books_id= &ledger_id
and code_combination_id IN (&Give_CCIDs_that_dont_tally)
and accounting_date <= to_Date('&upgrade_period_end_date')
group by code_combination_id, invoice_id
having sum(nvl(accounted_cr,0)) <> sum(nvl(accounted_dr,0));
QR2 - Run this SQL script to show the data in the SLA Trial Balance table that
should show up in the Trial Balance as of the upgrade period
create table xla_tb as
select tb.code_combination_id ,xte.transaction_number, xte.source_id_int_1,
tb.diff
from xla.xla_transaction_entities xte,
(select tb.code_combination_id, nvl(tb.applied_to_entity_id,
tb.source_entity_id) entity_id, sum(nvl(tb.acctd_rounded_cr,0)),
sum(nvl(tb.acctd_rounded_dr,0)),sum(nvl(tb.acctd_rounded_cr,0)) sum(nvl(tb.acctd_rounded_dr,0)) diff
from xla_trial_balances tb
where tb.ledger_id=&ledger_id and tb.definition_code= '&definition_code'
and tb.gl_date <= to_date('&upgrade_period_end_date')
and tb.code_combination_id IN (&Give_CCIDs_that_dont_tally)
group by tb.code_combination_id, nvl(tb.applied_to_entity_id,
tb.source_entity_id)
having sum(nvl(tb.acctd_rounded_cr,0)) <> sum(nvl(tb.acctd_rounded_dr,0)))tb
where
tb.entity_id=xte.entity_id and
xte.ledger_id=&ledger_id and
xte.application_id=200
Run the following two SQL scripts to provide details about the transactions there are causing the
differences.
QR3 - Check for transactions in the SLA Trial Balance (SLA TB) table but
not in the 11i APTB
select xla.code_combination_id, sum(xla.diff) from
xla_tb xla where not exists
(select 1 from ap_tb ap
where
QR4 - Check for transactions in 11i APTB table but not in the SLA TB table
select ap.code_combination_id, sum(ap.diff) from
ap_tb ap where not exists
(select 1 from xla_tb xla
where
ap.invoice_id= xla.source_id_int_1 and xla.code_combination_id=ap.code_combination_id )
group by ap.code_combination_id
QR7 - Check whether the invoice is missing or payment is missing in the XTB table
Select * from xla_trial_balances
where definition_code=&DEF_CODE and
nvl(applied_to_entity_id, source_entity_id)=&ENTITY_ID
and gl_date <= to_date('&upgrade_period_end_date')
Using these SQL scripts, you can investigate the particular transaction by comparing the AP accounting
data with the SLA accounting data (for ae_header_id, ae_line_id/num).
The following five queries will help you determine if the AE_LINE_ID in AP is the same as that in the
SLA tables.
QR8 - 11i - AP Invoice accounting
select al.ae_header_id, al.ae_line_id, al.ae_line_number, ah.accounting_event_id
from ap_accounting_events_all ae, ap_ae_headers_all ah, ap_ae_lines_all al
QR10 - 11i - AP Liability balance (source for upgrade to R12 XLA TB table)
select ae_header_id, ae_line_id
from ap_liability_balance
where invoice_id = &invoice_id
and set_of_books_id = &ledger_id
GL
Account
GL
Manual
AP
Diff GL SLA+Man JE
F=C-E-D
15151 XXX
188900.93
15071 YYY
15511 ZZZ
0.00
380382.98
-191482.05
Net Impact
from Nov-07
Diff as of
Jan-08
-192121.21
639.16
0.00
85439.64
11850812.71 0.00
0.00
8156.70
11842656.01 8156.70
Adjust the difference as of the Upgrade period. Then calculate the new Difference. If there is a difference
then:
First and foremost is to establish that the data in XLA_AE_LINES for application_id=200 per
month, per CCID is the same as the data in GL_JE_LINES for the same CCID/source/month (and
gl_je_headers.je_from_sla_flag=Y). Adjust the manual entries in GL accordingly.
Once you have reconciled the amounts in XLA_AE_LINES & GL_JE_LINES, the next step is to
verify the amounts in XLA_AE_LINES and XLA_TRIAL_BALANCES (for the CCID/entity_id)
assuming that only LIABILITY accounts are defined in the TB definition.
Understanding how UNDO Accounting can impact Reconciliation, for more details. Such entries will
match in SLA-to-GJL lines comparison, but will not match between XAL-to-XTB
QR16 - Get the XTB Difference
select SUM(NVL(ACCTD_ROUNDED_CR,0)) - SUM(NVL(ACCTD_ROUNDED_DR,0)) diff,
trx_currency_code
from xla_trial_balances xtb
where definition_code = &definition_code
and code_combination_id=15011
and gl_date between '01-MAR-2008' and '31-MAR-2008'
group by trx_currency_code
The Difference of the sum of Credit-Debit for the CCID/Currency combination in XAL (lines) should
match the difference of the Sum Credit-Debit for the CCID/Transaction Currency in XTB, assuming all
LIABILITY CCIDs are defined in the Trial Balance Definition.
QR17 - Get the difference from the SLA Lines table per CCID and currency
select /*+ parallel (xah,xal) leading(xah) */ sum(nvl(accounted_cr,0)) -sum(nvl(accounted_dr,0)) diff,
currency_code, entity_id
from xla_ae_lines xal, xla_Ae_headers xah
where xal.accounting_class_code = 'LIABILITY'
and xal.code_combination_id =15011
-- i/p def code
and xal.application_id = 200
and xal.ae_header_id = xah.ae_header_id
and xal.application_id =xah.application_id
and xah.ledger_id = 1
and xah.gl_transfer_status_code = 'Y'
and xah.accounting_entry_status_code='F'
and xah.accounting_date between '01-MAR-2008' and '31-MAR-2008'
group by entity_id, currency_code,entity_id
In GL
In SLA
Diff
Comments
0.00
13387.50
Null GROUP_ID in GL would generally mean it is a reversal batch in GL itself. There may be multiple
batches that were reversed during the month. So in the above example, you see group_id=2067078 that
has the same amounts in SLA and GL. The other group_id=2069110 in SLA has a period-Dec, but in GL
it is posted in May.
In SLA
Diff
Comments
28652.75
A GROUP_ID in SLA has data of in two different periods, but in GL it is posted in one period.
Someone may have edited the journal to change the period in GL.
You enter an invoice with one distribution of $200, which uses a GL date of 04-JAN-2001.
It is accounted incorrectly for a $205 LIABILITY, but it is posted to the GL.
Subsequently, you use the UNDO Accounting API to reverse the transaction as of 1-FEB-2001.
You pay the full invoice and the payment date is 20-DEC-2000.
If you submit the R12 Accounts Payable Trial Balance report as of 31-DEC-2000, the invoice is
NOT displayed on the report.
Similarly, if you submit the Accounts Payable Trial Balance report as of 31-JAN-2001, the
invoice is still not displayed on the report, as it is fully paid.
However, the Posted Payment Register as of 31-DEC-2000 reports the Payment and the Posted
Invoice Register as of 31-JAN-2001 reports the Invoice.
Original Event/Accounting
XLA_AE_HEADERS (XAH) Table
EVENT_ID EVENT_TYPE_CODE ACC_DATE AE_HEADER_ID UPG_BATCH_ID ENTITY_ID
E1
INVOICE_VALIDATE 04-JAN-2001 H1
XT1
ACCOUNTING_CLASS_CODE
CCID
H1
ITEM EXPENSE
C1
H1
LIABILITY
C2
DR
CR
220
220
SOURCE_ENT_ID
DEF_CODE
CCID
DR
CR
H1
XT1
AP_200_X
X1
220
After Undo:
XLA_AE_HEADERS (XAH) Table
EVENT_ID EVENT_TYPE_CODE ACC_DATE AE_HEADER_ID UPG_BATCH_ID ENTITY_ID
E1
INVOICE_VALIDATE
XT1
E2
MANUAL
01-FEB-2001 H2
-9999
XT2
E3
MANUAL
04-JAN-2001 H1
-9999
XT3
ACCOUNTING_CLASS_CODE CCID
DR CR
220
DESC
H1
ITEM EXPENSE
C1
H1
LIABILITY
C2
H2
ITEM EXPENSE
C1
220
H2
LIABILITY
C2
220
SOURCE_ENT_ID
DEF_CODE
CCID
DR
CR
If you try to reconcile the AP Trial Balance (APTB) as of Jan 2001 with the GL Balance as of
Jan 2001, after the UNDO accounting created the reversal entry in Feb 2001, the AP Trial Balance will
not match the GL Balance. If you look at the "After Undo" example, GL has the E1 event 's entry but
APTB does not because it was converted to MANUAL.
Use the following SQL script to determine if the UNDO Accounting correctly reversed all the amounts in
a CCID:
QR22 - Determine if the UNDO Accounting correctly reversed
all the amounts in a CCID
select h.event_id, sum(nvl(entered_cr,0)), sum(nvl(entered_dr,0))
,sum(nvl(accounted_dr,0))- sum(nvl(accounted_cr,0))
from xla_ae_headers h, xla_ae_lines l
where h.application_id = 200
and l.application_id = h.application_id
and l.ae_header_id = h.ae_header_id
--and h.accounting_date between :p_period_start_date AND :p_period_end_date
and h.ledger_id = 1
and h.event_type_code='MANUAL'
and h.upg_batch_id =-9999
and h.balance_type_code='A'
AND h.gl_transfer_status_code='Y'
AND h.accounting_entry_status_code='F'
AND l.code_combination_id=&CCID
and h.description like 'Data fix entry: event_id of%'
and not exists
(select 1 from xla_ae_headers h3
where h3.application_id=200 and h3.ledger_id=1 and h3.upg_batch_id=-9999
and h3.event_type_code='MANUAL' and h3.balance_type_code='A'
and h3.description='Data fix reversal entry: event_id of '||h.event_id)
group by h.event_id
having sum(nvl(accounted_dr,0))- sum(nvl(accounted_cr,0)) <> 0
6. APPENDIX
The following are some useful queries that may help you to further analyze why you have a
Reconciliation Issue.
QR23 - Run this SQL script to determine the Segment from a CCID
select concatenated_segments from gl_code_combinations_kfv
where code_combination_id=52261
QR24 - Run this SQL script to determine the Batch ID for a Group
select je_batch_id from gl_je_batches where group_id=2068553
QR26 - Run this SQL script to list all transactions that are marked as transferred from SLA, but is not
present in the GL
SELECT l.ae_header_id, l.gl_sl_link_id, l.gl_sl_link_table
FROM xla_ae_lines l, xla_ae_headers h WHERE
l.application_id=h.application_id AND
l.ae_header_id=h.ae_header_id AND
h.application_id=:p_application_id AND
h.ledger_id= :p_ledger_id AND
h.upg_batch_id IS NULL AND
h.gl_transfer_status_code='Y' AND
h.accounting_entry_status_code='F' AND
h.accounting_date BETWEEN :p_period_start_date AND :p_period_end_date AND
h.event_type_code <> ' MANUAL'
AND NOT EXISTS
(SELECT 1 FROM gl_import_references ir , gl_je_headers gh
WHERE ir.gl_sl_link_id=l.gl_sl_link_id AND
ir.gl_sl_link_table=l.gl_sl_link_table AND
ir.je_header_id=gh.je_header_id AND
ir.je_batch_id=gh.je_batch_id AND
gh.ledger_id>0);
QR27 - Run this SQL script periodically to check for multiple postings
select distinct a.gl_sl_link_id, a.gl_sl_link_table
from gl_import_references a
where (a.gl_sl_link_id,a.gl_sl_link_table) in
(select distinct gl_sl_link_id, gl_sl_link_table
QR29 - Run this SQL script to list all the Batches with Null Group IDs:
select je_batch_id from gl_je_batches where group_id is null
and je_batch_id in
(select distinct je_batch_id from gl_je_headers
where ledger_id=2 and je_source='Payables' and status='P'
and period_name='Jan-08')