Skip to Content
0
Former Member
Mar 05, 2007 at 03:45 PM

loop help

13 Views

hallow i have a table with employee and score and i wont to sum the score of employee and move it to another field after <b>every</b> employee .

this ex. of my table with just 2 employee i have more

Emp_num score

123*************5

123 ************2

123************ 7

456************ 2

456************3

The asterisk is just for the example .

I wont to do sum in loop like emp 123 score is 17 and emp num 456 is 5 .

<b>I try like that but is not working what i doing wrong?</b>

LOOP AT score_tab_3 INTO wa_score_tab_3.

AT END OF Emp_num.

SUM.

sum_all = wa_score_tab_3-score.

ENDAT.

ENDLOOP.

if i have 2 field in my table where i get the sum? i have to declare anter field?

regards

LOOP AT score_tab INTO wa_score_tab.

ON CHANGE OF wa_score_tab-emp_num.

ADD wa_score_tab-score_sum TO sum_all.

ENDON.

sum_n = sum_all.

ENDLOOP.

But its not working

regards