R12月末关帐的异常检查和处理

http://www.cnblogs.com/toowang/p/3492004.html

在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‘);

时间: 2024-12-19 19:33:08

R12月末关帐的异常检查和处理的相关文章

Microsoft 帐户异常登录活动,QQ邮箱代收hotmail邮件不成功

最近打算让QQ邮箱代收hotmail的邮件,总是提示不成功,而且homail里的备用邮箱一直到"安全阻止登录"邮件,同时QQ添加代收也不成功.而且关闭了二步验证还是不行.经过和微软客服沟通,说是为了安全. 好吧,只能自己想办法了. 方法一: 网上说修改密码为强密码(包括,大写字母,小写字母,字符).但是我没成功. 两步验证开启,需要有至少两个能接受"验证码"的设备,如邮箱和手机.如果只有其中的一个,而且你没有看到"关闭两步验证"的字样那就说明你没

Oracle EBS R12财务月结基础(转)

一.月结概述 1.什么叫月结:从字面含义上,即为月底结帐. 2.月结的目的 1)会计分期 2)财务报告 3.什么叫对帐:即将两套帐核对.在Oracle中,主要指将子模块的帐与总帐核对. 4.为什么要对帐:总帐接收到的财务信息与子模块业务必须保持一致,才能保证整个系统的帐务是正确的,所以要进行对帐.在日常事务处理中,存在录入或系统异常等导致的错误,通过对帐及时发现并解决. 5.月结与对帐之间的关系: 对帐是月结过程中的一个重要事项. 2.子模块与总帐之间的关系 n总帐模块处于财务核算的核心地位,它

S5PV210-arm裸机-异常中的中断实现过程

210中的异常中的中断实现过程: 首先异常分为很多种,异常中包含了中断异常,有一个东西叫做异常向量表,在异常向量表中有很多相应异常的的地址.异常向量表中的所有异常中断的地址是不会变化的.地址都是固定的,但这些地址都是一个基于基地址的一个地址.不同的CPU中,基地址是不同的. 在210中,CPU内部给了一个发生异常时的异常向量的基地址,查阅官方资料知道,这个基地址为0XD0037400,所以我们需要自己把异常向量表中的地址加在210给的发生异常时的异常向量的基地址上.比如:reset(复位异常)在

批量创建AD帐号如何去除空格

在前面文章中介绍过一篇文章,主要讲的是"关于Exchange Server 2010 启用邮箱时MMC控制台崩溃问题处理"方法,其中排错思路中也提到过是由于批量创建帐号过程中部分字段带空格导致的,其实这个是不能够完全避免的,由于毕竟是人工操作出现错误再所难免,完全解决导入数据不带空格其实是有办法的. 方法一:通过Excel的替换将空格去掉. 方法二:利用Excel中的SUBSTITUTE函数法去掉. 方法三:利用Excel中的CLEAN函数去掉. 当然上述都是需要运维人员对Excel中

【编程篇】使用异常巧妙获取交叉链表的交点

这里的交叉链表,是Y型交叉链表. 话不多说,上代码: 首先定义一些用到的宏和链表节点,这里使用最简单的单向链表 1 #define ARRAY_SIZE(a) sizeof((a)) / sizeof((a)[0]) 2 #define ABS(a) (a) > 0 ? (a) : (-(a)) 3 4 typedef struct _Node 5 { 6 int data; 7 _Node* pNext; 8 }Node, *PNode; 下面是建立链表函数: 1 /* 2 新建链表 3 若p

SAP-财务知识点

[转自 http://blog.itpub.net/195776/viewspace-1023912/] SAP FI/CO Reading RepositorySAP财务成本知识库 目 录前言.一.SAP FI/CO 模块设置二.SAP R/3 财务基本概念及集成性浅释--主数据概念篇2.1 总账主数据2.2 供应商主数据2.3 客户主数据2.4 商品主数据2.5 固定资产主数据三.SAP R/3 财务基本概念及集成性浅释--总帐等概念篇3.1 科目表的建立及分配3.2 统驭科目3.3 凭证的

SAP问题【转载】

1.A:在公司代码分配折旧表时报错? 在公司代码分配折旧表时报错,提示是"3000 的公司代码分录不完全-参见长文本" 希望各位大侠帮我看看. 3000 的公司代码分录不完全-参见长文本 R: a.你把零进项税的代码分配给这个公司代码就可以了 .没有指定非税代码,OBCL b.据此可能company code 设置有问题,检查一下OBY6 2.a,维护客户科目组:财政供应链管理->现金和流转情况管理->现金管理->主数据->子分类帐科目->客户控制->

SAP错误问题汇总

1.A:在公司代码分配折旧表时报错? 在公司代码分配折旧表时报错,提示是"3000 的公司代码分录不完全-参见长文本" 希望各位大侠帮我看看. 3000 的公司代码分录不完全-参见长文本 R: a.你把零进项税的代码分配给这个公司代码就可以了 .没有指定非税代码,OBCL b.据此可能company code 设置有问题,检查一下OBY6 2.a,维护客户科目组:财政供应链管理->现金和流转情况管理->现金管理->主数据->子分类帐科目->客户控制->

开源介绍:Google Guava、Google Guice、Joda-Time

一.Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, 等等. 这些高质量的 API 可以使你的JAVa代码更加优雅,更加简洁,让你工作更加轻松愉悦.下面我们就开启优雅Java编程学习之旅! 项目相关信息: 官方首页:http://code.googl