Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3123736
  • 博文数量: 238
  • 博客积分: 864
  • 博客等级: 军士长
  • 技术积分: 2940
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-08 23:01
个人简介

WeChat: cj_william / Mail: william.chen.cn@outlook.com

文章分类

全部博文(238)

文章存档

2018年(2)

2016年(35)

2015年(47)

2014年(104)

2013年(38)

2012年(12)

分类: 敏捷开发

2014-02-24 22:23:14

客户报回来的一个金额字段Overflow的异常,记录一下喽。

Exception Info.:

 Laufzeitfehler  COLLECT_OVERFLOW_TYPE_P 
 Ausnahme CX_SY_ARITHMETIC_OVERFLO 



提示:
An internal table field has been defined too small.

错误分析:
 

错误分析
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_ARITHMETIC_OVERFLOW', was not
     caught in
    procedure "F_FETCH_DATA" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    The COLLECT statement stores totals in the internal table
     "\PROGRAM=Z_CNVR_CUS_REBATE_REPORT\DATA=I_REBATE_UPLOAD[]",
    but the values are too large for the type P field intended to store
    them.

    The name of the field is "WRBTR_RM".


源码摘录:
     LOOP AT  I_REBATE_LOG.
      IF I_REBATE_LOG-VBELN CA 'ST' OR I_REBATE_LOG-VBELN CA 'RE'.
        CLEAR: I_REBATE_LOG-VBELN, I_REBATE_LOG-LOG_DATE, I_REBATE_LOG-LOG_TIME,
               I_REBATE_LOG-VKORG,I_REBATE_LOG-VTWEG,I_REBATE_LOG-SPART,I_REBATE_LOG-POSTING_DATE.
        COLLECT I_REBATE_LOG INTO I_REBATE_UPLOAD.
      ELSE.
        CLEAR: I_REBATE_LOG-VBELN, I_REBATE_LOG-LOG_DATE, I_REBATE_LOG-LOG_TIME,
               I_REBATE_LOG-VKORG,I_REBATE_LOG-VTWEG,I_REBATE_LOG-SPART,I_REBATE_LOG-POSTING_DATE.
        COLLECT I_REBATE_LOG INTO I_REBATE_CONSUME.
      ENDIF.
    ENDLOOP.
经查证内表I_REBATE_UPLOAD的字段WRBTR_RM的定义类型为WRBTR
凭证货币金额
Data Type  CURR       货币字段,作为 DEC 存储
Length     13         Decimal Places   2

显然应该换个长度比较长的类型,
此处建议:金额字段数据元素可以考虑使用DATA Type: WERTV13 
Data Type  CURR       货币字段,作为 DEC 存储
Length     25         Decimal Places   2

附加:此处异常体现在金额字段,如果是数量字段,可以考虑使用DATA Type:MENGE13:
带 3 位小数位字符的数量字段 13(25)
Data Type  QUAN       数量字段,指向带 UNIT 格式的单位字段
Length     25         Decimal Places   3    

阅读(1628) | 评论(0) | 转发(0) |
0

上一篇:模块名词中英对照

下一篇:SAP--锁机制

给主人留下些什么吧!~~