技术开发 频道

ABAP实例:内表重复字段如何删除

【IT168 技术文章】

* 処理概要:
*    内表重复字段如何删除

*   开始的数据如下:

  f1            f2               f3                              f4                   f5

-----------------------------------------------------------------------

 a              100          2009-01-01                   20                 2009-01-01

 a              100          2009-01-01                   30                 2009-01-03

a              100          2009-01-01                    50                 2009-01-04

 a             30            2009-01-12                    30                 2009-01-14

 b             20            2009-01-03                    10                 2009-01-22

最后得到的结果数格式为:

f1            f2               f3                              f4                   f5

-----------------------------------------------------------------------

 a              100          2009-01-01                   20                 2009-01-01

                                    30                 2009-01-03

                                      50                 2009-01-04

             30            2009-01-12                    30                 2009-01-14

 b             20            2009-01-03                    10                 2009-01-22

*----------------------------------------------------------------------*
* 使用テーブル:
*    IT_TABLE
*   
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
*                                                           方法一
*----------------------------------------------------------------------*

REPORT  Z_TEST5 .

*----------------------------------------------------------------------*
* 类型定义
*----------------------------------------------------------------------*
TYPES:
  BEGIN OF T_STR_CLASS,
    f1(1)    TYPE C,
    f2(5)    TYPE C,
    f3(12)   TYPE C,
    f4(10)   TYPE C,
    f5(12)   TYPE C,
END OF T_STR_CLASS,

T_IT_TABLE   TYPE STANDARD TABLE OF T_STR_CLASS.

0
相关文章