R12月末关帐的异常检查和处理
在R12版本中月末关帐时经常会出现关不了的情况,而系统的异常报表的信息太过简单且不完全。结合项目本身发生的情况,做了以下的总结,希望能对公司其他R12项目有所启示。
R12月度关帐的要点:
检查SLA传送给GL的数据是否重复和丢失。
-- 检查SLA传送给GL的数据重复
select aeh.gl_transfer_date,
aeh.accounting_date,
aeh.description,
aeh.doc_sequence_value,
cc.concatenated_segments,ael.*
from xla_ae_lines ael, xla_ae_headers aeh, gl_code_combinations_kfv cc
where ael.gl_sl_link_id in
(
select gl_sl_link_id
from APPS.gl_import_references
where je_header_id in
(select je_header_id
from APPS.gl_je_headers
where period_name = '2008-06')
group by gl_sl_link_id
having count(*) = 2
)
and ael.ae_header_id=aeh.ae_header_id
and ael.code_combination_id=cc.code_combination_id
如果存在则为传送给GL的数据重复。 -- 检查SLA传送给GL的数据是否缺失
SELECT xe.event_id, xh.ae_header_id
FROM xla_events xe, xla_ae_headers xh
WHERE xe.event_id = xh.event_id
AND xe.application_id = xh.application_id
AND xh.accounting_entry_status_code = 'F'
AND xe.event_status_code = 'P'
AND xh.application_id = application_id -- (like 200 for AP, 222 for AR etc.,)
AND xh.upg_batch_id IS NULL
AND xh.ledger_id = ledger_id -- give the ledger_id
AND NOT EXISTS
(SELECT 1
FROM xla_ae_lines xl
WHERE xl.ae_header_id = xh.ae_header_id
AND xl.application_id = xh.application_id);
这个问题在oracle Doc ID: Note:729296.1 Subject: SLA: Accounting Data Missing from the SLA Tables
碰到这样的问题需要installed R12 Fin RUP5 or the Subledger Accounting Critical Patches 这个在Doc已经
有了详细的介绍。 关闭AP的会计期:
关闭AP的会计期的check主要是集中在xla这一块。 SELECT xte.*
FROM xla.xla_events xle,
xla.xla_transaction_entities xte,
gl_ledger_relationships glr1,
gl_ledger_relationships glr2,
xla.xla_ledger_options xlo
WHERE xle.entity_id = xte.entity_id
AND xle.application_id = xte.application_id
AND xle.event_date BETWEEN to_date('2008-08-01', 'YYYY-MM-DD') AND
to_date('2008-08-30', 'YYYY-MM-DD')
AND glr2.target_ledger_id = p_ledger_id
AND glr2.source_ledger_id = glr1.source_ledger_id
AND glr2.application_id = glr1.application_id
AND glr1.target_ledger_id = xlo.ledger_id
AND xle.application_id = xlo.application_id
AND xlo.capture_event_flag = 'Y'
AND (glr1.target_ledger_id = xte.ledger_id OR
glr1.primary_ledger_id = xte.ledger_id)
AND (glr1.relationship_type_code = 'SUBLEDGER' OR
(glr1.target_ledger_category_code = 'PRIMARY' AND
glr1.relationship_type_code = 'NONE'))
AND glr2.application_id = 101
AND xte.application_id = p_application_id
AND xle.event_status_code IN ('I', 'U'); SELECT xte.*
FROM xla.xla_ae_headers aeh,
xla.xla_transaction_entities xte,
gl_ledger_relationships glr1,
gl_ledger_relationships glr2
WHERE aeh.ledger_id = glr2.target_ledger_id
AND glr2.source_ledger_id = glr1.source_ledger_id
AND glr2.application_id = glr1.application_id
AND glr1.target_ledger_id = p_ledger_id
AND glr1.application_id = 101
AND xte.entity_id = aeh.entity_id
AND xte.application_id = aeh.application_id
AND aeh.gl_transfer_status_code IN ('N', 'E')
AND aeh.accounting_date BETWEEN to_date('2008-07-01', 'YYYY-MM-DD') AND
to_date('2008-07-31', 'YYYY-MM-DD')
AND xte.application_id = p_application_id ; 当上述的2SQL中存在值时,这个时候AP的会计期是关闭不了的。我们可以通过
xla.xla_transaction_entities.source_id_int_1,ENTITY_CODE 去找到相应的子帐数据。
如果ENTITY_CODE = 'AP_PAYMENTS' 则source_id_int_1 = AP_CHECKS_ALL.CHECK_ID
如果ENTITY_CODE = 'AP_INVOICES' 则source_id_int_1 = AP_INVOICES_ALL.INVOICE_ID
如果ENTITY_CODE = 'TRANSACTIONS' 则source_id_int_1 = RA_CUSTOMER_TRX_ALL.customer_trx_id
如果ENTITY_CODE = 'RECEIPTS' 则source_id_int_1 = AR_CASH_RECEIPTS_ALL.CASH_RECEIPT_ID
如果ENTITY_CODE = 'ADJUSTMENTS' 则source_id_int_1 = AR_ADJUSTMENTS_ALL.ADJUSTMENT_ID 另外Oracle也提供了AP的异常检查的 Doc ID: Note:437422.1
Subject: R12 Troubleshooting Closing Periods in Payables
主要是以下几个方面:
•All payment batches must be confirmed
•All transactions must be accounted
•All accounting entries must be transferred to general ledger
•All future dated payments which have reached maturity in the accounting period must have their
status updated to negotiable and be accounted
详细细节请参考Note:437422.1 以及上面的SQL语句就可以找到问题。其中check AP会计期的程序其实是调用
XLA_EVENTS_PUB_PKG.PERIOD_CLOSE程序真正的检查程序是XLA_PERIOD_CLOSE_EXP_PKG.check_period_close 。 关闭AR的会计期:
关闭AR的会计期时,Oracle没有象关闭AP会计期那样严格,只是检查收款和发票的核销。 /* check for Revenue recognition */
SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS (SELECT /*+ ORDERED USE_NL(sys_org gld ct) */
'x'
FROM (SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id
AND accounting_method <> 'CASH') sys_org,
ra_cust_trx_line_gl_dist_all gld,
ra_customer_trx_all ct
WHERE gld.account_class = 'REC'
AND gld.latest_rec_flag = 'Y'
AND gld.account_set_flag = 'Y'
AND gld.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND ct.customer_trx_id = gld.customer_trx_id
AND ct.complete_flag = 'Y'
AND gld.org_id = sys_org.org_id
AND ct.org_id = gld.org_id); /*** 'Unposted Items Exist' ***/
SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS (SELECT 'x'
FROM ar_adjustments_all adj
WHERE adj.posting_control_id = -3
AND adj.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND nvl(adj.postable, 'Y') = 'Y'
AND adj.org_id IN
(SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id
AND accounting_method <> 'CASH')); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS
(SELECT 'x'
FROM ar_misc_cash_distributions_all
WHERE posting_control_id = -3
AND gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND (org_id IS NULL OR
org_id IN
(SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id))); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS (SELECT /*+ ORDERED USE_NL(sys_org gl ct) */
'x'
FROM (SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id
AND accounting_method <> 'CASH') sys_org,
ra_cust_trx_line_gl_dist_all gl,
ra_customer_trx_all ct
WHERE gl.customer_trx_id = ct.customer_trx_id
AND ct.complete_flag = 'Y'
AND gl.account_set_flag = 'N'
AND gl.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND gl.posting_control_id = -3
AND gl.set_of_books_id = :control.set_of_books_id
AND ct.org_id = sys_org.org_id
AND gl.org_id = ct.org_id); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS (SELECT /*+ ORDERED USE_NL(sys_org ra ct) */
'x'
FROM (SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id) sys_org,
ar_receivable_applications_all ra,
ra_customer_trx_all ct
WHERE ra.posting_control_id = -3
AND ra.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND nvl(ra.postable, 'Y') = 'Y'
AND (ra.customer_trx_id = ct.customer_trx_id OR
ra.applied_customer_trx_id = ct.customer_trx_id)
AND ra.org_id = sys_org.org_id
AND ra.org_id = ct.org_id); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS
(SELECT 'x'
FROM ar_cash_receipt_history_all crh
WHERE posting_control_id = -3
AND gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND postable_flag = 'Y'
AND (crh.org_id IS NULL OR
crh.org_id IN
(SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id))); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS
(SELECT 'x'
FROM ar_interim_cash_receipts_all icr
WHERE icr.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND (icr.org_id IS NULL OR
icr.org_id IN
(SELECT org_id
FROM ar_system_parameters_all
WHERE set_of_books_id = :control.set_of_books_id))); SELECT COUNT(1)
INTO temp
FROM dual
WHERE EXISTS
(SELECT 'x'
FROM ar_transaction_history_all trh
WHERE trh.posting_control_id = -3
AND trh.gl_date BETWEEN :gl_period_statuses.start_date AND
:gl_period_statuses.end_date
AND trh.postable_flag = 'Y'
AND (trh.org_id IS NULL OR
trh.org_id IN
(SELECT sp.org_id
FROM ar_system_parameters_all sp
WHERE sp.set_of_books_id = :control.set_of_books_id)));
假如上面的Sql中有任何一个存在值,当期的会计期是关闭不了的。其实这些都是关闭AR
会计期的check条件。 关闭GL的会计期:
关闭GL的会计期,没有AP/AR条件那么苛刻,只要验证以下SQL就可以了 SELECT xte.*
FROM xla.xla_events xle,
xla.xla_transaction_entities xte,
gl_ledger_relationships glr1,
gl_ledger_relationships glr2,
xla_ledger_options xlo
WHERE xle.entity_id = xte.entity_id
AND xle.application_id = xte.application_id
AND xle.event_date BETWEEN to_date('2008-07-01', 'YYYY-MM-DD') AND
to_date('2008-07-31', 'YYYY-MM-DD')
AND glr2.target_ledger_id = 2022
AND glr2.source_ledger_id = glr1.source_ledger_id
AND glr2.application_id = glr1.application_id
AND glr1.target_ledger_id = xlo.ledger_id
AND xle.application_id = xlo.application_id
AND xlo.capture_event_flag = 'Y'
AND (glr1.target_ledger_id = xte.ledger_id OR
glr1.primary_ledger_id = xte.ledger_id)
AND (glr1.relationship_type_code = 'SUBLEDGER' OR
(glr1.target_ledger_category_code = 'PRIMARY' AND
glr1.relationship_type_code = 'NONE'))
AND glr2.application_id = 101
AND xle.event_status_code IN ('I', 'U');
R12月末关帐的异常检查和处理的更多相关文章
- T100——取得系统参数值,如关帐日期
CALL cl_get_para(g_enterprise,g_site,'S-MFG-0031') RETURNING l_para_data 用此方法获取关帐日期
- SAP月末结账年结流程
SAP月末结账年结流程 SAP月末结账操作指南 流程描述:FI期末结帐流程包括应收帐款.应付帐款.固定资产.管理会计结帐.总帐结帐等一系列结帐过程,对于年结增加了余额结转及固定资产年度改变等动作,通过 ...
- Monyer's Game 6~10关过关方法
从Monyer's Game开通到现在,已经有50多人通关了.其中绝大部分人,不管是自己独立完成也好,参考别人也罢,都是自己一步一步过去的.像陆羽兄弟甚至已经为游戏做好了整个通关的教程,在此Monye ...
- KingbaseES V8R6 账号异常登录锁定案例
数据库版本: test=> select version(); version --------------------------------------------------------- ...
- SAP-财务知识点
[转自 http://blog.itpub.net/195776/viewspace-1023912/] SAP FI/CO Reading RepositorySAP财务成本知识库 目 录前言.一. ...
- POS与EPOS区别
本文分文三个部分来介绍,第一部分是两个概念(POS与EPOS),第三部分是 POS与EPOS的区别. 一.epos ( electronic point of sale ) 俗称电话pos机: .EP ...
- GL_GL系列 - 总账系统基础(概念)
2014-07-07 Created By BaoXinjian
- SAP问题【转载】
1.A:在公司代码分配折旧表时报错? 在公司代码分配折旧表时报错,提示是"3000 的公司代码分录不完全-参见长文本" 希望各位大侠帮我看看. 3000 的公司代码分录不完全-参见 ...
- SAP FI配置步骤
http://blog.sina.com.cn/s/blog_8eda1a620100uwzj.html No. 配置对象 事务代码 配置内容 路径 备注 1 定义公司 OX15 企业结构>定义 ...
随机推荐
- SQL backup&restore
--完整备份Backup Database NorthwindCSTo disk='G:\Backup\NorthwindCS_Full_20070908.bak' --差异备份Backup Data ...
- .Net程序员安卓学习之路6:等待条
一般在需要访问网络或者长时间操作的时候避免界面无响应才使用:等待条 本例将实现一个无框架的等待条,效果如下: 点击后,使线程Sleep5秒,就出现如下效果: 实现代码如: private Progre ...
- MANIFEST.MF详解(转)
转载自http://blog.csdn.net/zhifeiyu2008/article/details/8829637 打开Java的JAR文件我们经常可以看到文件中包含着一个META-INF目录, ...
- graphviz - Node Shapes
Node Shapes There are three main types of shapes : polygon-based, record-based and user-defined. The ...
- 使用jQuery基本过滤选择器
<script type="text/javascript"> $(function(){ //增加第一个元素的类别 $("li:first").a ...
- iOS面试题01
1.#import和#include.@class有什么区别?#import<>和#import“”又有什么区别? 答:1.#import和#include都能完整地包含某个文件的内容,# ...
- 小白教你玩转php的闭包
php5.3有一个非常赞的新特性,那就是支持匿名函数(闭包).匿名函数可用于动态创建函数,并保存到一个变量中.举个栗子: $func = function(){ exit('Hello world!! ...
- boost 1.57.0安装
一. PC编译安装boost boost是C++的准标准库,其有两种安装方法. 1. ubuntu下,通过sudo apt-get install libboost-all-dev. 2. 通过源码包 ...
- int[] List<int> 排序
; List<,,,,,,}; ,,,,}; List<int> result = allingInts.ToList(); result.Sort(); allingInts = ...
- Java学习——基本数据类型
Java两大数据类型 内置数据类型 引用数据类型 变量就是申请内存存储值,内存管理系统根据变量的类型分配相应的存储空间存储该类型的数据. 内置数据类型 8中基本类型(四个整数型,两个浮点型),一种字符 ...