Saturday, 4 June 2016

Trial Balance detail Report in Oracle Apps

Query to get the Trial Balace Detail Report is given below. We can also cross check the same with Account Analysis Report.
The Below query is taking by the seeded view GL_JE_JOURNAL_LINES_V.
SELECT
gccv.concatenated_segments
,ffvv.DESCRIPTION
,b.default_period_name PERIOD_NAME,
ps.period_year PERIOD_YEAR
,lr.SLA_LEDGER_ID
,b.name BATCH_NAME,
h.name HEADER_NAME,
h.je_source JE_SOURCE,
h.je_category JE_CATEGORY,
DECODE (lr.relationship_type_code,
‘BALANCE’, NULL,
lines.accounted_dr)
LINE_ACCOUNTED_DR,
DECODE (lr.relationship_type_code,
‘BALANCE’, NULL,
lines.accounted_cr)
LINE_ACCOUNTED_CR,
lines.description LINE_DESCRIPTION,
lr.target_ledger_name LEDGER_NAME,
lr.target_currency_code LEDGER_CURRENCY
FROM   gl_period_statuses ps,
gl_je_lines lines,
gl_je_headers h,
gl_je_batches b,
gl_ledger_relationships lr,
gl_code_combinations_kfv gccv,
fnd_flex_values_vl ffvv
WHERE   lr.source_ledger_id = lr.target_ledger_id
AND lr.application_id = 101
AND b.average_journal_flag = ‘N’
AND b.je_batch_id = h.je_batch_id
AND lines.code_combination_id in (select code_combination_id from gl_code_combinations_kfv where segment1 between :seg1low and :seg1high  and segment3 between :seg3low and :seg3high)
AND b.actual_flag = ‘A’
AND h.je_header_id = lines.je_header_id
AND h.ledger_id = lr.source_ledger_id
AND lines.period_name = ps.period_name
AND ps.ledger_id = lines.ledger_id
AND b.default_period_name between :p_period_start_name and :p_period_end_name
AND ps.application_id = 101
and gccv.code_combination_id = lines.code_combination_id
and ffvv.flex_value =  gccv.segment3

No comments:

Post a Comment