如果有abcd,at end of B,是对B以及B之前的字段进行判断
不是仅仅对b进行判断,而且如果at end of b,就会对b后面的数据清空初始化,
所以在at end of 前用 另一个工作区接收一下,
一定注意,是B之前的所有字段进行判断
at new也一样
例子:
REPORT
zlm_at_end_of
.
TYPES
:
BEGIN
OF ty_itab
,
a
TYPE
i
,
b
TYPE
i
,
c
TYPE decfloat34
,
d
TYPE
i
,
e
TYPE
i
,
END
OF ty_itab
.
DATA
:d
TYPE
i
.
DATA
: wa_itab
TYPE ty_itab
,
it_itab
LIKE
STANDARD
TABLE
OF wa_itab
.
DATA
: wa_itab2
TYPE ty_itab
,
it_itab2
LIKE
STANDARD
TABLE
OF wa_itab2
.
wa_itab
-a
=
1
.
wa_itab
-b
=
2
.
wa_itab
-
c
=
3
.
wa_itab
-d
=
4
.
wa_itab
-e
=
5
.
APPEND wa_itab
TO it_itab
.
CLEAR
:wa_itab
.
wa_itab
-a
=
1
.
wa_itab
-b
=
2
.
wa_itab
-
c
=
8
.
wa_itab
-d
=
9
.
wa_itab
-e
=
10
.
APPEND wa_itab
TO it_itab
.
CLEAR
:wa_itab
.
wa_itab
-a
=
1
.
wa_itab
-b
=
2
.
wa_itab
-
c
=
13
.
wa_itab
-d
=
14
.
wa_itab
-e
=
15
.
APPEND wa_itab
TO it_itab
.
CLEAR
:wa_itab
.
wa_itab
-a
=
12
.
wa_itab
-b
=
3
.
wa_itab
-
c
=
13
.
wa_itab
-d
=
14
.
wa_itab
-e
=
15
.
APPEND wa_itab
TO it_itab
.
CLEAR
:wa_itab
.
REFRESH it_itab2
.
LOOP
AT it_itab
INTO wa_itab
.
AT
END
OF b
.
WRITE
: /
wa_itab
-a
,wa_itab
-b
,wa_itab
-
c
.
ULINE
.
ENDAT
.
ENDLOOP
.
特别注意: at end of 或者new of 后,
of参考字段后面的所有字段都会 被清空 有时候是变成 * (星号)。
使用时特别注意,是否使用of 后面的字段了