好男人就是我,我就是你兵哥
分类: IT职场
2015-03-31 13:35:09
REPORT ztest1.
DATA lt_006 TYPE TABLE OF ztsal006.
DATA ls_006 TYPE ztsal006.
DATA num TYPE i.
DATA num2 TYPE i.
DATA month1 TYPE i.
DATA month2 TYPE i.
DATA gbl TYPE ze_month.
DATA money TYPE ze_month.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_006
FROM ztsal006
WHERE zyear = '2014'.
month1 = 1.
month2 = 12.
num = month2 - month1.
num2 = month2 - num - 1.
LOOP AT lt_006 INTO ls_006.
DO month2 TIMES VARYING gbl FROM ls_006-month_1 NEXT ls_006-month_2.
IF sy-INDEX > num2.
money = money + gbl.
ENDIF.
* CLEAR GBL.
ENDDO.
ENDLOOP.