Long live the ACCUMULATE function!
DEF temp-table2 LIKE temp-table1.
FOR EACH temp-table1
BREAK BY temp-table1.artikel_nr:
ACCUMULATE temp-table1.artikel_val(SUB-TOTAL BY temp-table1.artikel_nr).
IF LAST-OF(temp-table1.artikel_nr) THEN DO:
CREATE temp-table2.
ASSIGN temp-table2.artikel_nr = temp-table1.artikel_nr
temp-table2.artikel_val = (ACCUM SUB-TOTAL BY temp-table1.artikel_nr temp-table1.artikel_val).
END.
END.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.