路虽弥,不行不至;事虽少,不做不成。
分类: Oracle
2012-11-19 20:30:16
EBS R12中SLA子分类帐与子模块的关联关系
一、应付帐款
--发票分录
select ai.INVOICE_NUM, xal.*
from AP_INVOICES_ALL ai,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
XLA_AE_LINES xal
where ai.SET_OF_BOOKS_ID = 2027
and ai.SET_OF_BOOKS_ID = xte.LEDGER_ID
and ai.INVOICE_ID = xte.SOURCE_ID_INT_1
and ai.INVOICE_NUM = '4600060381@2012_1500000511_2'
and xte.ENTITY_ID = xe.ENTITY_ID
and xe.EVENT_ID = xah.EVENT_ID
and xal.AE_HEADER_ID = xah.AE_HEADER_ID
--付款分录
select ac.CHECK_NUMBER, xal.*
from AP_INVOICES_ALL ai,
AP_INVOICE_PAYMENTS_ALL aip,
AP_CHECKS_ALL ac,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
XLA_AE_LINES xal
where ai.SET_OF_BOOKS_ID =’&sob_id’
and ai.SET_OF_BOOKS_ID = xte.LEDGER_ID
and ac.check_id = xte.SOURCE_ID_INT_1
and ai.INVOICE_NUM = '&INVOICE_NUM '
and xte.ENTITY_ID = xe.ENTITY_ID
and xe.EVENT_ID = xah.EVENT_ID
and xal.AE_HEADER_ID = xah.AE_HEADER_ID
and ai.INVOICE_ID=aip.INVOICE_ID
and aip.CHECK_ID=ac.CHECK_ID
二、应收帐款
三、资产
FA_DEPRN_DETAIL_H 折旧回滚表
FA_DEPRN_EVENTS 折旧事件表
注:R12回滚是基于资产卡片,R11I回滚是基于资产帐簿
--资产折旧
select fa.TAG_NUMBER, fdp.PERIOD_NAME, xal.*
from FA_ADDITIONS_B fa,
FA_DEPRN_DETAIL fdd,
FA_DEPRN_PERIODS fdp,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
XLA_AE_LINES xal
where fa.TAG_NUMBER = '&TAG_NUMBER '
and fa.ASSET_ID = fdd.ASSET_ID
and xte.SOURCE_ID_INT_1 = fdd.ASSET_ID
and xte.SOURCE_ID_CHAR_1 = fdd.BOOK_TYPE_CODE
and xte.SOURCE_ID_INT_2 = fdd.PERIOD_COUNTER
and xte.SOURCE_ID_INT_3 = fdd.DEPRN_RUN_ID
and fdp.BOOK_TYPE_CODE = fdd.BOOK_TYPE_CODE
and fdp.PERIOD_COUNTER = fdd.PERIOD_COUNTER
and xte.ENTITY_ID = xe.ENTITY_ID
and xah.EVENT_ID = xe.EVENT_ID
and xah.AE_HEADER_ID = xal.AE_HEADER_ID
--资产事务
select xe.EVENT_TYPE_CODE,xah.EVENT_TYPE_CODE,xal.*
from FA_TRANSACTION_HEADERS fth,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
XLA_AE_LINES xal
where fth.TRANSACTION_HEADER_ID=xte.SOURCE_ID_INT_1
and xte.ENTITY_ID = xe.ENTITY_ID
and xah.EVENT_ID = xe.EVENT_ID
and xah.AE_HEADER_ID = xal.AE_HEADER_ID
and fth.ASSET_ID=15008335
FA_ASSET_HISTORY
Description: |
Historical information about asset reclassifications and unit adjustments |
四、成本管理
--库存
select xe.EVENT_TYPE_CODE, xah.EVENT_TYPE_CODE, xal.*
from MTL_TRANSACTION_ACCOUNTS mta,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
xla_ae_lines xal
where mta.ORGANIZATION_ID = 277
and mta.TRANSACTION_ID = xte.SOURCE_ID_INT_1
and mta.ORGANIZATION_ID = xte.SOURCE_ID_INT_2
and mta.TRANSACTION_SOURCE_TYPE_ID = xte.SOURCE_ID_INT_3
and mta.TRANSACTION_ID = 9871318
and xte.ENTITY_ID = xe.ENTITY_ID
and xe.EVENT_ID = xah.EVENT_ID
and xah.AE_HEADER_ID = xal.AE_HEADER_ID
--接收
select xte.ENTITY_CODE, xah.EVENT_TYPE_CODE, rae.EVENT_SOURCE, xal.*
from RCV_TRANSACTIONS rt,
RCV_ACCOUNTING_EVENTS rae,
XLA_TRANSACTION_ENTITIES xte,
xla_events xe,
XLA_AE_HEADERS xah,
xla_ae_lines xal
where rae.RCV_TRANSACTION_ID = xte.SOURCE_ID_INT_1
and rae.ACCOUNTING_EVENT_ID = xte.SOURCE_ID_INT_2
and rt.ORGANIZATION_ID = xte.SOURCE_ID_INT_3
and rt.TRANSACTION_ID = 498557