You are on page 1of 7

<Document Title>

NOTICE

The information contained in this document is not to be used for any purpose other than the purposes for
which this document is furnished by GENPACT, nor is this document (in whole or in part) to be reproduced
or furnished to third parties or made public without the prior express written permission of GENPACT.

Version Control

Version Version Changes Owner/ Date of


No. Date Author Review/Expiry

Classification: Genpact Internal


Revenue & SLA join

SELECT
xah.period_name,
xel.accounted_dr,
xel.accounted_cr
FROM
apps.pa_draft_revenues_all pdra,
apps.pa_projects_all ppa,
apps.pa_draft_revenue_items pdri,
apps.pa_cust_event_rdl_all pcea,
apps.pa_events pe,
apps.xla_distribution_links xdl,
apps.xla_ae_lines xel,
apps.xla_ae_headers xah
WHERE

Classification: Genpact Internal


ppa.project_id = pdra.project_id
AND pdri.draft_revenue_num = pdra.draft_revenue_num
AND ppa.project_id = pdri.project_id
AND ppa.project_id = pcea.project_id
AND pcea.draft_revenue_num = pdra.draft_revenue_num
AND pdri.line_num = pcea.line_num
AND ppa.project_id = pe.project_id
AND pcea.task_id = pe.task_id
AND pcea.event_num = pe.event_num
AND xdl.source_distribution_id_num_1 = pe.event_id
AND xdl.source_distribution_id_num_2 = pcea.line_num
AND xdl.ae_header_id = xel.ae_header_id
AND xdl.ae_line_num = xel.ae_line_num
AND xah.ae_header_id = xel.ae_header_id
AND xah.event_id IN (
53304065,
53304067
)

SELECT
GJB.NAME GL_BATCH_NAME,
GJH.NAME JOURNAL_NAME,
GJL.JE_LINE_NUM,

GJL.PERIOD_NAME,
GJL.ACCOUNTED_DR,
GJL.ACCOUNTED_CR,ppa.segment1,pe.description,substr(pe.description,1,10) AR#,
gcc.segment2
FROM
apps.pa_draft_revenues_all pdra,
apps.pa_projects_all ppa,
apps.pa_draft_revenue_items pdri,
apps.pa_cust_event_rdl_all pcea,
apps.pa_events pe,
apps.xla_distribution_links xdl,
apps.xla_ae_lines xel,
apps.xla_ae_headers xah,
APPS.GL_IMPORT_REFERENCES GIR,
APPS.GL_JE_HEADERS GJH,
APPS.GL_JE_LINES GJL,
APPS.GL_JE_BATCHES GJB,
apps.gl_code_combinations_kfv gcc
WHERE
ppa.project_id = pdra.project_id
AND pdri.draft_revenue_num = pdra.draft_revenue_num
AND ppa.project_id = pdri.project_id
AND ppa.project_id = pcea.project_id
AND pcea.draft_revenue_num = pdra.draft_revenue_num

Classification: Genpact Internal


AND pdri.line_num = pcea.line_num
AND ppa.project_id = pe.project_id
AND pcea.task_id = pe.task_id
AND pcea.event_num = pe.event_num
AND xdl.source_distribution_id_num_1 = pe.event_id
AND xdl.source_distribution_id_num_2 = pcea.line_num
AND xdl.ae_header_id = xel.ae_header_id
AND xdl.ae_line_num = xel.ae_line_num
AND xah.ae_header_id = xel.ae_header_id
AND XEL.GL_SL_LINK_ID = GIR.GL_SL_LINK_ID
AND GIR.GL_SL_LINK_TABLE = XEL.GL_SL_LINK_TABLE
AND GJL.JE_HEADER_ID = GJH.JE_HEADER_ID
AND GJH.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GJL.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GIR.JE_LINE_NUM = GJL.JE_LINE_NUM
AND GJL.code_combination_id=gcc.code_combination_id
AND GJB.JE_BATCH_ID = GJH.JE_BATCH_ID

-- AND PPA.segment1='D_2854431'
and pe.event_id in (11095580,
)
-- and pe.creation_date >sysdate-10

Cost SLA Join

SELECT GJB.NAME GL_BATCH_NAME,


GJH.NAME JOURNAL_NAME,
GJL.JE_LINE_NUM,
GCC.CONCATENATED_SEGMENTS,
GJL.PERIOD_NAME,
GJL.ACCOUNTED_DR,
GJL.ACCOUNTED_CR,
PPA.SEGMENT1 PROJECT_NUMBER,
PEIL.EXPENDITURE_TYPE
FROM APPS.PA_PROJECTS_ALL PPA,
APPS.PA_EXPENDITURE_ITEMS_ALL PEIL,
APPS.PA_COST_DISTRIBUTION_LINES_ALL PCD,
APPS.XLA_DISTRIBUTION_LINKS XDL,
APPS.XLA_AE_LINES XEL,
APPS.XLA_AE_HEADERS XAH,
APPS.XLA_EVENTS XAE,
APPS.GL_IMPORT_REFERENCES GIR,
APPS.GL_JE_HEADERS GJH,
APPS.GL_JE_LINES GJL,
APPS.GL_CODE_COMBINATIONS_KFV GCC,
APPS.GL_JE_BATCHES GJB
WHERE 1 = 1

Classification: Genpact Internal


AND PEIL.PROJECT_ID = PPA.PROJECT_ID
AND PCD.EXPENDITURE_ITEM_ID = PEIL.EXPENDITURE_ITEM_ID

AND XDL.SOURCE_DISTRIBUTION_ID_NUM_1 = PCD.EXPENDITURE_ITEM_ID


AND XDL.SOURCE_DISTRIBUTION_ID_NUM_2 = PCD.LINE_NUM
AND XAH.AE_HEADER_ID = XDL.AE_HEADER_ID
AND XEL.AE_LINE_NUM = XDL.AE_LINE_NUM
AND XAH.AE_HEADER_ID = XEL.AE_HEADER_ID
AND XAH.EVENT_ID = XAE.EVENT_ID
AND PCD.ACCT_EVENT_ID = XAE.EVENT_ID
AND XEL.GL_SL_LINK_ID = GIR.GL_SL_LINK_ID
AND GIR.GL_SL_LINK_TABLE = XEL.GL_SL_LINK_TABLE
AND GJL.JE_HEADER_ID = GJH.JE_HEADER_ID
AND GJH.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GJL.JE_HEADER_ID = GIR.JE_HEADER_ID
AND GIR.JE_LINE_NUM = GJL.JE_LINE_NUM
AND GCC.CODE_COMBINATION_ID = XEL.CODE_COMBINATION_ID
AND GCC.CODE_COMBINATION_ID = GJL.CODE_COMBINATION_ID
AND GJB.JE_BATCH_ID = GJH.JE_BATCH_ID
and GJL.PERIOD_NAME = 'JAN-15'

AP- GL

SELECT
aia.invoice_num,
gjb.name batch_name,
gjh.name journal_name,
gjh.period_name,
gjh.je_source,
gjh.je_category,
gjl.je_line_num,
gcc.concatenated_segments,
gjl.entered_dr,
gjl.entered_cr,
gjl.accounted_dr,
gjl.accounted_cr,aia.set_of_books_id
FROM
apps.ap_invoices_all aia,
--xla.XLA_TRANSACTION_ENTITIES_UPG xta,
apps.xla_events xe,
apps.xla_ae_headers xah,
apps.xla_ae_lines xal,
apps.gl_import_references gir,
apps.gl_je_headers gjh,
apps.gl_je_lines gjl,
apps.gl_je_batches gjb,
apps.gl_code_combinations_kfv gcc,

Classification: Genpact Internal


apps.xla_distribution_links xdl,
apps.ap_invoice_distributions_all aida
WHERE
aida.invoice_id = aia.invoice_id
AND aida.invoice_distribution_id = 129152921
and aia.set_of_books_id=xah.ledger_id
AND xdl.event_id = xe.event_id
AND xdl.application_id = 200
AND xdl.event_id = xah.event_id
AND xah.ae_header_id = xal.ae_header_id
AND xal.gl_sl_link_id = gir.gl_sl_link_id
AND xdl.ae_line_num = xal.ae_line_num
AND xdl.ae_header_id = xah.ae_header_id
AND xal.gl_sl_link_table = gir.gl_sl_link_table
AND gir.je_header_id = gjh.je_header_id
AND gjl.je_header_id = gjh.je_header_id
AND gjb.je_batch_id = gjh.je_batch_id
AND gjl.je_line_num = gir.je_line_num
AND gjl.code_combination_id = gcc.code_combination_id
AND xdl.source_distribution_type = 'AP_INV_DIST'
AND xdl.source_distribution_id_num_1 = aida.invoice_distribution_id
ORDER BY
aia.invoice_num,
gjl.je_line_num

Cost Management

SELECT
gcc.concatenated_segments,
SUM(nvl(xel.accounted_dr,0) ),
SUM(nvl(xel.accounted_cr,0) )
FROM
apps.xla_distribution_links xdl,
apps.xla_ae_lines xel,
apps.xla_ae_headers xah,
apps.gl_code_combinations_kfv gcc
WHERE
xah.ae_header_id = xdl.ae_header_id
AND xel.ae_line_num = xdl.ae_line_num
AND xah.ae_header_id = xel.ae_header_id
AND gcc.code_combination_id = xel.code_combination_id
AND xah.ledger_id = 325
AND xah.application_id = 707
AND xah.event_id IN (55901127
)
GROUP BY
gcc.concatenated_segments

Classification: Genpact Internal


SELECT
gcc.concatenated_segments ,
SUM(nvl(gjl.accounted_dr,0) ),
SUM(nvl(gjl.accounted_cr,0) )
FROM
apps.xla_distribution_links xdl,
apps.xla_ae_lines xel,
apps.xla_ae_headers xah,
apps.gl_code_combinations_kfv gcc,
apps.gl_import_references gir,
apps.gl_je_headers gjh,
apps.gl_je_lines gjl
WHERE
xah.ae_header_id = xdl.ae_header_id
AND xel.ae_line_num = xdl.ae_line_num
AND xah.ae_header_id = xel.ae_header_id
AND gcc.code_combination_id = gjl.code_combination_id
AND xah.ledger_id = 325
AND xah.application_id = 707
AND xel.gl_sl_link_id = gir.gl_sl_link_id
AND xel.gl_sl_link_table = gir.gl_sl_link_table
AND gir.je_header_id = gjh.je_header_id
AND gjl.je_header_id = gjh.je_header_id
AND gjl.je_line_num = gir.je_line_num
AND xah.event_id IN (56525763)
GROUP BY
gcc.concatenated_segments

Classification: Genpact Internal

You might also like