Hello Omer,
You can makeuse of a variable for solving this problem.
Data : V_HAFTA type hafta or Character of length 30 or 40.
you continue the samee code.
Clear V_HAFTA.
LOOP AT gt_itab.
gt_itab-spmon = gt_itab-begdt+0(6).
IF gt_itab-begdt+6(2) le '05' .
V_HAFTA = V_HAFTA + gt_itab-whour.
gt_itab-hafta1 = V_HAFTA.
ENDIF.
modify gt_itab.
ENDLOOP.
You can try this.