Thursday, December 4, 2014

Verify data between Inventory and GL through SLA transactions

 GL transfer is done through SLA so the GL_SL_LINK_ID in GL would be matching with

the GL_SL_LINK_ID of SLA tables and not of MTL_TRANSACTION_ACCOUNTS.
2) To compare the value of MTA- SLA - GL customer can do the following :

Make sure that you run the create accounting for the
period and also transferred to GL.

/*------- Verify that all MTA txns transferred to SLA -----------
If the following query returns any rows then that means there are
accounting in MTA which has not been created in SLA---------------*/

SELECT *
FROM mtl_transaction_accounts a
WHERE a.transaction_date between TO_DATE('&&from_dt','DD-MM-YYYY')
AND TO_DATE('&&to_dt','DD-MM-YYYY')+0.99999
AND a.reference_account =&&Account_id
AND a.organization_id = &&organization_id
AND NOT EXISTS (SELECT NULL
FROM xla_distribution_links
WHERE source_distribution_type =
'MTL_TRANSACTION_ACCOUNTS'
AND application_id = 707
AND source_distribution_id_num_1 =
a.inv_sub_ledger_id)




/*-------- Verify MTA values matches that transferred to SLA ----
If the following query returns any rows then that means there are
accounting in MTA which has been created in SLA but the value in SLA
doesn't match with MTA--------------------------------------------*/

SELECT SUM(NVL(l.accounted_dr,0) - NVL(l.accounted_cr,0)) SLA_VAL,
SUM(a.base_transaction_value) MTA_VAL,
l.ae_header_id,
l.ae_line_num,
l.code_combination_id
FROM mtl_transaction_accounts a,
xla_distribution_links b,
xla_ae_lines l
WHERE a.transaction_date between TO_DATE('&&from_dt','DD-MM-YYYY')
AND TO_DATE('&&to_dt','DD-MM-YYYY')+0.99999
AND a.reference_account =&&Account_id
AND a.organization_id = &&organization_id
AND b.source_distribution_type = 'MTL_TRANSACTION_ACCOUNTS'
AND b.application_id = 707
AND b.source_distribution_id_num_1 = a.inv_sub_ledger_id
AND l.application_id =707
AND l.ae_header_id = b.ae_header_id
AND l.ae_line_num = b.ae_line_num
GROUP BY l.code_combination_id,
l.ae_header_id,
l.ae_line_num,
l.code_combination_id
HAVING (SUM(NVL(l.accounted_dr,0) - NVL(l.accounted_cr,0))
- SUM(a.base_transaction_value)) <> 0

/* -- SLA marked as transferred to GL but don't exist in GL ------
If the following query returns any rows then that means there are
accounting in SLA which has not been created in GL---------------*/

SELECT l.ae_header_id,
l.gl_sl_link_id,
l.gl_sl_link_table,
l.code_combination_id,
SUM(NVL(l.accounted_dr,0) - NVL(l.accounted_cr,0)) SLA_VAL
FROM xla_ae_lines l,
xla_ae_headers h,
xla_distribution_links b,
mtl_transaction_accounts a
WHERE a.transaction_date between TO_DATE('&&from_dt','DD-MM-YYYY')
AND TO_DATE('&&to_dt','DD-MM-YYYY')+0.99999
AND a.organization_id = &&organization_id
AND b.source_distribution_type = 'MTL_TRANSACTION_ACCOUNTS'
AND b.application_id = 707
AND b.source_distribution_id_num_1 = a.inv_sub_ledger_id
AND l.ae_header_id = b.ae_header_id
AND l.ae_line_num = b.ae_line_num
AND l.application_id=h.application_id
AND l.ae_header_id=h.ae_header_id
AND h.application_id = 707
AND h.ledger_id= &&Ledger_id
AND l.code_combination_id = &&Account_id
AND h.gl_transfer_status_code ='Y'
AND h.accounting_entry_status_code='F'
AND h.accounting_date BETWEEN TO_DATE('&&from_dt','DD-MM-YYYY')
AND TO_DATE('&&to_dt','DD-MM-YYYY')+0.99999
AND NOT EXISTS
(SELECT 1 FROM gl_import_references ir
WHERE ir.gl_sl_link_id=l.gl_sl_link_id
AND ir.gl_sl_link_table=l.gl_sl_link_table)
group by l.ae_header_id,
l.gl_sl_link_id,
l.gl_sl_link_table,
l.code_combination_id;

Once you have detected that all distributions from MTA are posted to XLA.

The reconciliation problem is between XLA and GL.

To check the balance from GL, user should use GL account balance inquiry.

No comments:

Post a Comment