Oracle EBS 根据FA事务处理追溯SLA到GL脚本
注意:此脚本如果不满足业务场景,追加判断条件即可
SELECT fth.asset_id
,fth.transaction_header_id
,fav.asset_number
,xah.period_name
,xla_gcc.segment1
,xla_gcc.segment2
,xla_gcc.segment3
,xla_gcc.segment4
,xla_gcc.segment5
,xla_gcc.segment6
,xla_gcc.segment7
,xla_gcc.segment8
,gjh.name je_name
,gjb.name batch_name
FROM fa_transaction_headers fth
,fa_additions_v fav
,fa_books_v fbv
,xla.xla_transaction_entities xte
,xla.xla_ae_headers xah
,xla.xla_ae_lines xal
,gl_import_references gir
,gl_je_headers gjh
,gl_je_lines gjl
,gl_code_combinations gcc
,gl_code_combinations xla_gcc
,gl_je_batches gjb
WHERE fth.transaction_header_id = xte.source_id_int_1
AND fth.asset_id = fav.asset_id
AND fav.asset_id = fbv.asset_id
AND fth.book_type_code = fbv.book_type_code
AND xte.application_id = 140
AND xte.entity_code = 'TRANSACTIONS'
AND fav.asset_number = &p_asset_number
AND fbv.book_type_code = &p_book_type_code
AND xah.entity_id = xte.entity_id
AND xah.ledger_id = xte.ledger_id
AND xah.period_name =&p_period_name
AND xah.ae_header_id = xal.ae_header_id
AND xal.application_id = '140'
AND xal.gl_sl_link_id = gir.gl_sl_link_id
AND gjh.je_header_id = gjl.je_header_id
AND gjl.code_combination_id = gcc.code_combination_id
AND gir.je_header_id = gjh.je_header_id
AND gir.je_line_num = gjl.je_line_num
AND gjb.je_batch_id = gjh.je_batch_id
AND xal.code_combination_id = xla_gcc.code_combination_id
;
--刘轶鹤