Wednesday, 19 August 2015

Inventory to GL link in R12

/* Formatted on 8/19/2015 6:31:42 PM (QP5 v5.240.12305.39446) */
SELECT DISTINCT glh.*
  FROM xla_transaction_entities_upg xte,
       xla_events xe,
       xla_distribution_links xdl,
       mtl_transaction_accounts mta,
       xla_ae_headers xah,
       xla_ae_lines xal,
       gl_import_references gir,
       gl_je_headers glh
 WHERE     1 = 1
       AND xte.source_id_int_1 = &transaction_id
       AND xte.entity_id = xe.entity_id
       AND mta.transaction_id = xte.source_id_int_1
       AND xdl.source_distribution_type = 'MTL_TRANSACTION_ACCOUNTS'
       AND xdl.source_distribution_id_num_1 = mta.inv_sub_ledger_id
       AND xdl.ae_header_id = xah.ae_header_id
       AND xal.ae_header_id = xdl.ae_header_id
       AND xal.ae_header_id = xah.ae_header_id
       AND gir.gl_sl_link_table = 'XLAJEL'
       AND gir.gl_sl_link_id = xal.gl_sl_link_id
       AND gir.je_header_id = glh.je_header_id;

No comments:

Post a Comment