Tuesday, August 8, 2017

PO XLA GL and RCV XLA GL queries in Oracle Applications

/* Formatted on 2017/08/08 14:31 (Formatter Plus v4.8.8) */
SELECT poh.org_id, poh.segment1 po_num, pol.line_num, poll.shipment_num, por.release_num, pod.distribution_num, NVL (poll.price_override, pol.unit_price) unit_price, pod.quantity_ordered, pod.quantity_delivered, pod.quantity_billed,
       pod.quantity_cancelled, xdl.accounting_line_code, xdl.line_definition_code, xdl.event_class_code, xal.accounted_dr, xal.accounted_cr, jeh.ledger_id, jeb.NAME, jeb.creation_date, jeh.je_source, jeh.je_category, jel.je_line_num,
       NVL (jel.accounted_dr, 0) accounted_dr, NVL (jel.accounted_cr, 0) accounted_cr, glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4, glcc.segment5, glcc.segment6
  FROM apps.po_headers_all poh,
       apps.po_lines_all pol,
       apps.po_line_locations_all poll,
       apps.po_distributions_all pod,
       apps.po_releases_all por,
       apps.xla_distribution_links xdl,
       apps.xla_ae_lines xal,
       apps.gl_import_references gif,
       apps.gl_je_lines jel,
       apps.gl_je_headers jeh,
       apps.gl_je_batches jeb,
       apps.gl_code_combinations glcc
 WHERE 1 = 1
   AND xdl.ae_line_num = xal.ae_line_num
   AND xdl.ae_header_id = xal.ae_header_id
   AND xal.gl_sl_link_table = gif.gl_sl_link_table
   AND xal.gl_sl_link_id = gif.gl_sl_link_id
   AND gif.je_header_id = jel.je_header_id
   AND gif.je_line_num = jel.je_line_num
   AND jel.code_combination_id = glcc.code_combination_id
   AND jel.je_header_id = jeh.je_header_id
   AND jeh.je_batch_id = jeb.je_batch_id
   AND xdl.source_distribution_type = 'PO_DISTRIBUTIONS_ALL'
   AND xdl.application_id = 201
   AND pod.po_distribution_id = xdl.source_distribution_id_num_1
   AND pod.line_location_id = poll.line_location_id
   AND poll.po_line_id = pol.po_line_id
   AND pol.po_header_id = poh.po_header_id
   AND pod.po_release_id = por.po_release_id(+)

No comments:

Post a Comment