REDUCE not concatenating strings

Why does the following code with REDUCE not concatenate the table into the string ‘ABC’?

 

DATA t TYPE TABLE OF kna1.
t = VALUE #(
( kunnr = ‘A’ )
( kunnr = ‘B’ )
( kunnr = ‘C’ )
).

DATA(log1) = REDUCE string( INIT x1 = ” FOR wa IN t NEXT x1 = x1 && wa-kunnr ).

WRITE: /, log1. ” A

DATA log2 TYPE string.
LOOP AT t INTO DATA(wa2).
log2 = log2 && wa2-kunnr.
ENDLOOP.

WRITE: /, log2. ” ABC

 

 

 

The LOOP approach works just fine.

Scroll to Top