管理记者 2012 数据市场集成错误 “索引不足”

本文提供了问题索引与 Microsoft Dynamics GP 的集成时出现的范围不足错误的解决方案

适用于: Microsoft Management Reporter 2012,Microsoft Dynamics GP
原始 KB 数: 3029952

现象

对于维度值任务,管理记者 Dynamics GP Data Mart 集成中可能会出现以下错误消息:

DimensionValueProvider 到维度值:错误文本:索引范围不足。 必须为非负数且小于集合大小。

此外,托管 Management Reporter 服务的服务器上的事件查看器将在 Windows 应用程序日志中显示以下错误详细信息。

索引已超出范围。 必须为非负数且小于集合大小。
参数名称:索引
---异常转储---
捕获异常:[System.ArgumentOutOfRangeException] 索引范围不足。 必须为非负数且小于集合大小。
参数名称:索引

堆栈跟踪:
at Microsoft.Dynamics.Performance.Integration.Reporting.Adapter.GP.DimensionValueProvider.CreateGLDimensionValueFromReader(SqlDataReader reader, Company cmp)
at Microsoft.Dynamics.Performance.Integration.Reporting.Adapter.GP.DimensionValueProvider.<ReadObjects>d__0.MoveNext()
at Microsoft.Dynamics.Integration.Service.Tasks.MapWork.ProcessRecordsImplementation(OperationType operationType)

尝试打开构建基块或生成报表时,也可能发生此错误消息。

原因

如果在帐户设置表(SY00300)或帐户索引表(GL00100)中不存在的 Microsoft Dynamics GP 应用程序数据库的帐户段表(GL40200)中存在对帐户的引用,则会发生此错误。

解决方案

注意

在按照本文中的说明操作之前,请确保拥有数据库的完整备份副本,如果出现问题,可以还原该副本。

  1. 在 SQL Management Studio 中针对 Microsoft Dynamics GP 公司数据库运行以下查询,以标识无效的帐户段:

    select * from GL40200 where SGMTNUMB not in (select SGMTNUMB from SY00300)
    select * from GL40200 where SGMTNUMB=1 and SGMNTID not in (select distinct ACTNUMBR_1 from GL00100)
    select * from GL40200 where SGMTNUMB=2 and SGMNTID not in (select distinct ACTNUMBR_2 from GL00100)
    select * from GL40200 where SGMTNUMB=3 and SGMNTID not in (select distinct ACTNUMBR_3 from GL00100)
    select * from GL40200 where SGMTNUMB=4 and SGMNTID not in (select distinct ACTNUMBR_4 from GL00100)
    

    可能需要调整语句,具体取决于段数。

  2. 在 SQL 中运行以下语句,从GL40200表中删除错误的记录:

    delete GL40200 where SGMTNUMB not in (select SGMTNUMB from SY00300)
    delete GL40200 where SGMTNUMB=1 and SGMNTID not in (select distinct ACTNUMBR_1 from GL00100)
    delete GL40200 where SGMTNUMB=2 and SGMNTID not in (select distinct ACTNUMBR_2 from GL00100)
    delete GL40200 where SGMTNUMB=3 and SGMNTID not in (select distinct ACTNUMBR_3 from GL00100)
    delete GL40200 where SGMTNUMB=4 and SGMNTID not in (select distinct ACTNUMBR_4 from GL00100)
    
  3. 从 GL40200 表中删除记录后,在 Microsoft Dynamics GP 中的帐户主节点上运行检查链接:

    1. 选择 Dynamics GP,然后选择“维护,然后选择“检查链接”。
    2. 选择“ 财务 ”系列。 选择“帐户母版”,选择“插入,然后选择“确定”。
  4. 更正帐户段后,将 Management Reporter Data Mart 集成重新配置为新的数据市场数据库。

    注意

    所有步骤必须由分配给 Management Reporter Security 中管理员角色的域用户完成,该用户也是服务器上的本地管理员组的成员

    1. 打开管理记者配置控制台。

    2. 选择 ERP 集成下的 GP 集成

    3. 选择“ 禁用集成”。

    4. 选择右上角的“删除”以删除集成。

    5. 退出配置控制台。

    6. 打开 SQL Server Management Studio。

    7. 备份管理记者数据库。

    8. 备份数据市场(通常是 DDM 或 ManagementReporterDM)数据库。

    9. 删除数据市场数据库。

    10. 打开配置控制台。

    11. 停止管理记者 2012 进程服务。

    12. 停止管理记者 2012 应用程序服务。

    13. 启动管理记者 2012 应用程序服务。

    14. 启动管理记者 2012 进程服务。

    15. 选择“文件,然后选择“配置”。

    16. 选择“ 添加Microsoft Dynamics GP Data Mart”。

    17. 按照 Microsoft Dynamics GP 提供程序的步骤操作:

      Microsoft Dynamics ERP 的管理记者 2012:安装、迁移和配置指南

    18. 完成后,在配置控制台中选择“ 启用集成 ”。