Wednesday, December 15, 2021

Link between po and xla tables.po to gl query in r12

Join between po and gl


 select

poh.segment1 po_number, pol.line_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,poh.org_id,poll.shipment_num, por.release_num, pod.distribution_num,

xal.accounted_dr, xal.accounted_cr,

jeh.ledger_id, jeb.name, jeb.creation_date, jeh.je_source, jeh.je_category,

glcc.segment1, glcc.segment2, glcc.segment3, glcc.segment4, glcc.segment5, glcc.segment6,

jel.je_line_num, nvl(jel.accounted_dr,0) accounted_dr, nvl(jel.accounted_cr,0) accounted_cr

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 poh.segment1='1234444' --PO NUMBER

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

SQL Important Queries

  How to delete rows with no where clause The following example deletes  all rows  from the  Person.Person  the table in the AdventureWork...