Accrual Query (EBS) - May work in Cloud too!
SELECT (SELECT name
FROM hr_all_organization_units
WHERE organization_id = k.expenditure_organization_id)
exp_org,
l.concatenated_segments
po_dist_charge_account,
(SELECT segment1
FROM pa_projects_All
WHERE project_id = k.project_id)
project_num,
(SELECT name
FROM pa_projects_All
WHERE project_id = k.project_id)
project_name,
(SELECT task_number
FROM pa_tasks
WHERE task_id = k.task_id)
task_num,
(SELECT task_name
FROM pa_tasks
WHERE task_id = k.task_id)
task_name,
k.expenditure_type,
e.accounted_cr
project_raw_cost,
'83'
operating_unit,
'US Ledger'
Ledger_name,
b.period_name,
c.je_line_num
je_line_num,
i.segment1
po_number,
i.creation_date
Po_creation_date,
m.last_update_date
Po_shipment_last_update_date,
a.name
je_batch_name,
accounting_class_code
transaction_type,
NULL
release_num,
j.line_num
po_line_num,
(SELECT full_name
FROM per_all_people_f
WHERE person_id = k.deliver_to_person_id
AND SYSDATE BETWEEN effective_start_date
AND effective_end_date)
requester_name,
(SELECT agent_name
FROM po_agents_v
WHERE agent_id = i.agent_id)
buyer_name
FROM gl_je_batches a,
gl_je_headers b,
gl_je_lines c,
gl_import_references d,
xla_ae_lines e,
xla_ae_headers f,
xla.xla_transaction_entities g,
rcv_accounting_events h,
po_headers_all i,
po_lines_all j,
po_distributions_all k,
gl_code_combinations_kfv l,
po_line_locations_all m
WHERE b.je_batch_id = a.je_batch_id
AND c.je_header_id = b.je_header_id
AND d.je_header_id = b.je_header_id
AND d.je_batch_id = a.je_Batch_id
AND c.je_line_num = d.je_line_num
AND e.gl_sl_link_id = d.gl_sl_link_id
AND e.ae_header_id = f.ae_header_id
AND g.entity_id = f.entity_id
--
AND h.accounting_event_id = g.source_id_int_2
AND h.po_line_id = j.po_line_id
AND h.po_distribution_id = k.po_distribution_id
--
AND i.po_header_id = h.po_header_id
AND j.po_header_id = i.po_header_id
AND k.po_header_id = i.po_header_id
AND k.po_line_id = j.po_line_id
AND k.code_combination_id = l.code_combination_id
AND m.po_header_id = i.po_header_id
AND m.po_line_id = j.po_line_id
AND b.period_name = 'NOV-2022'
AND d.gl_sl_link_table = 'XLAJEL'
AND accounting_class_code = 'ACCRUAL'
AND a.name = :batch_name --'Cost Management A 113083 29632480'
--and expenditure_organization_id is null
order by exp_org, po_number, line_num
No comments:
Post a Comment