selectb.status,
h.je_source,
(selectUSER_JE_CATEGORY_NAMEfromGL_JE_CATEGORIESwhere JE_CATEGORY_NAME =h.je_category) je_category,
B.DEFAULT_PERIOD_NAME,
b.name,
h.name,
h.currency_code,
b.running_total_dr,
b.running_total_cr,
h.description,
h.period_name,
h.default_effective_date,
(selectgcc.concatenated_segmentsfromgl_code_combinations_kfv gccwhere gcc.code_combination_id =l.code_combination_id) concatenated_segments,
l.accounted_dr,
l.accounted_cr,
l.description,
l.context,
l.attribute1,
l.attribute2,
l.attribute3,
l.attribute4,
l.attribute5,
l.attribute6,
l.attribute7,
l.attribute8,
l.attribute9,
l.attribute10,
l.attribute11,
l.attribute12,
l.attribute13,
l.attribute14,
l.attribute15,
l.attribute16,
l.attribute17,
l.attribute18,
l.attribute19,
l.attribute20fromgl_je_batches b, gl_je_headers h, gl_je_lines lwhere b.je_batch_id =h.je_batch_idAND (h.display_alc_journal_flag = 'Y' orh.display_alc_journal_flagis null)and h.je_header_id =l.je_header_idand h.je_source = 'Manual'
and h.doc_sequence_value like '5020%'
and b.default_period_name = 'JAN-17'