以下查询透过SLA的几张table(xla_events/xla_transaction_entities/xla_ae_headers/xla_ae_lines),来查询资产具体折旧传票状况,包括折旧金额,是否抛转等信息。
Select fab.asset_number
,xah.period_name
,xe.event_type_code
,xe.event_status_code
,xe.process_status_code
,xah.gl_transfer_status_code
,xah.gl_transfer_date
,xah.accounting_entry_status_code
,gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4 account_name
,xal.gl_transfer_mode_code
,xal.gl_sl_link_id
,xal.gl_sl_link_table
,xal.accounting_class_code
,xal.ledger_id
,xal.currency_code
,xal.entered_dr
,xal.entered_cr
,xal.accounted_dr
,xal.accounted_cr
From xla_events xe
,xla.xla_transaction_entities xte
,fa_books fb
,fa_additions_b fab
,xla_ae_headers xah
,xla_ae_lines xal
,gl_code_combinations gcc
Where xe.entity_id= xte.entity_id
And xte.source_id_int_1=fb.asset_id
And fb.asset_id = fab.asset_id
And fb.book_type_code='AP ASSET BOOK'
And xe.event_id=xah.event_id
And xah.ae_header_id=xal.ae_header_id
And xal.code_combination_id=gcc.code_combination_id
And xe.event_id=6581336;