Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
R12 – sql po xla-gl
1. /**************************
The following SQL should return information about:
PO Transaction
XLA Information
GL Information
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.RCV_RECEIVING_SUB_LEDGER RRSL,
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 poh.segment1='1100498'
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 RRSL.REFERENCE3=pod.po_distribution_id --- RCV_RECEIVING_SUB_LEDGER's
reference3 is equal to po_distributions_all's po_distribution_id
and RRSL.RCV_SUB_LEDGER_ID = XDL.SOURCE_DISTRIBUTION_ID_NUM_1
and xdl.SOURCE_DISTRIBUTION_TYPE='RCV_RECEIVING_SUB_LEDGER'
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(+)
=============================================
select po_header_id from po_headers_all where segment1='1100498' --
po_header_id=85
select PO_DISTRIBUTION_ID from apps.po_distributions_all ppod where
po_header_id=589850 -- PO_DISTRIBUTION_ID =652123
select RCV_SUB_LEDGER_ID from RCV_RECEIVING_SUB_LEDGER RRSL where REFERENCE3
= 652123
select xdl.AE_LINE_NUM ,XDL.AE_HEADER_ID from XLA_DISTRIBUTION_LINKS XDL
2. where SOURCE_DISTRIBUTION_ID_NUM_1 in
(836651,836652)
and
SOURCE_DISTRIBUTION_TYPE='RCV_RECEIVING_SUB_LEDGER'
select xal.gl_sl_link_table , xal.gl_sl_link_id from apps.xla_ae_lines xal
where xal.AE_LINE_NUM = 1
AND XAL.AE_HEADER_ID = 3008868
select gif.je_header_id , gif.je_line_num from APPS.GL_IMPORT_REFERENCES
gif where
gif.gl_sl_link_table = 'XLAJEL' and gif.gl_sl_link_id = 6194606
select jel.je_header_id , jel.code_combination_id from apps.gl_je_lines jel
where jel.je_header_id=560233 and jel.je_line_num=2
select jeh.je_batch_id from apps.gl_je_headers jeh where
jeh.je_header_id=560233
select * from gl_je_batches jeb where jeb.je_batch_id=581082
select * from apps.gl_code_combinations glcc where
glcc.code_combination_id=2005