Friday, October 14, 2016

GL source_id_int_1 Mappings

The source_id_int_1 on the xla_transaction_entities table can be used to join from SLA to related transactions in the sub-ledgers.
There is a very useful table called xla_entity_id_mappings which contains the mapping information.
This covers the mappings used for some common transaction types:
APPLICATION_ID
APPLICATION_NAME ENTITY_CODE SOURCE_ID_COL_NAME_1 TRANSACTION_ID_COL_NAME_1 SOURCE_ID_COL_NAME_2 TRANSACTION_ID_COL_NAME_2
200
Payables AP_INVOICES SOURCE_ID_INT_1 INVOICE_ID    
200
Payables AP_PAYMENTS SOURCE_ID_INT_1 CHECK_ID    
275
Projects BUDGETS SOURCE_ID_INT_1 BUDGET_VERSION_ID    
275
Projects EXPENDITURES SOURCE_ID_INT_1 EXPENDITURE_ITEM_ID    
275
Projects REVENUE SOURCE_ID_INT_1 PROJECT_ID SOURCE_ID_INT_2 DRAFT_REVENUE_NUM
201
Purchasing PURCHASE_ORDER SOURCE_ID_INT_1 PO_HEADER_ID    
201
Purchasing REQUISITION SOURCE_ID_INT_1 REQ_ID    
222
Receivables RECEIPTS SOURCE_ID_INT_1 CASH_RECEIPT_ID    
222
Receivables TRANSACTIONS SOURCE_ID_INT_1 CUSTOMER_TRX_ID    
For example, for a Revenue in Projects, you could see that accounting info that flows from Projects through to GL would have and source_id_int_1 value related to the PROJECT_ID and a source_id_int_2 value related to the DRAFT_REVENUE_NUM.
Having access to the xla_entity_id_mappings helps take the guess work out of linking source transactions to the sub ledger tables.
-- ##############################################################################
--       SOURCE_ID_INT_1 MAPPINGS
-- ############################################################################*/
     
-- source_id_int_1 mappings
-- for a given application, find out what entity (e.g. AP_INVOICES) and column_name (e.g. INVOICE_ID)
-- found via Application Diagnostics > Subledger Accounting > Setup Diagnostics > Xla Setup Diagnostics Diagnostics Script
 
    SELECT fa.application_id
         , fa.application_short_name app
         , fat.application_name
         , DECODE(fpi.status,'I','Licensed','S','Shared','N','Not Licensed') status
         , fpi.product_version
         , fpi.patch_level
         , xeim.entity_code
         , xeim.source_id_col_name_1
         , xeim.transaction_id_col_name_1
         , xeim.source_id_col_name_2
         , xeim.transaction_id_col_name_2
         , xeim.source_id_col_name_3
         , xeim.transaction_id_col_name_3
         , xeim.source_id_col_name_4
         , xeim.transaction_id_col_name_4
      FROM xla.xla_entity_id_mappings xeim
      JOIN applsys.fnd_application fa ON xeim.application_id = fa.application_id
      JOIN applsys.fnd_application_tl fat ON fa.application_id = fat.application_id
 LEFT JOIN applsys.fnd_product_installations fpi ON fpi.application_id = fa.application_id
     WHERE 1 = 1
       AND xeim.source_id_col_name_1 IS NOT NULL
--       AND fpi.status <> 'N'
  ORDER BY fat.application_name
         , xeim.entity_code;

1 comment: