‎2006 Jul 15 11:28 PM
Hi friends,
I need to move data into an internal table from a data base table based on the year and the month.
However if there is no data for a particular month it has pick data for the immediate next month..
Below is my code and am having some syntax error at the if statements where i am doing addition on the month.
TABLES : t009b,
tvarvc.
DATA : month TYPE i,
year TYPE i,
day TYPE i.
DATA : BEGIN OF t_period OCCURS 0,
bdatj TYPE bdatj,
bumon TYPE bumon,
butag TYPE butag,
poper TYPE poper,
END OF t_period.
month = sy-datum+4(2).
day = sy-datum+6(2).
year = sy-datum+0(4).
START-OF-SELECTION.
SELECT t009bbdatj t009bbumon t009bbutag t009bpoper
INTO t_period
FROM t009b
WHERE t009b~bdatj = year.
IF t_period-bumon = month.
APPEND t_period.
ELSEIF t_period-bumon = month + 1.
APPEND t_period.
ELSE.
EXIT.
ENDIF.
ENDSELECT.
Thanks,
Shejal.
‎2006 Jul 15 11:36 PM
Hi,
In your ELSEIF condition, you cannot do the addition (month + 1).
You should first assign a varaible:
next_mont = month + 1.
IF ...
...
ELSEIF t_period-bumon = nexst_month.
...
ENDIF.Best regards,
Guillaume
‎2006 Jul 15 11:36 PM
Hi,
In your ELSEIF condition, you cannot do the addition (month + 1).
You should first assign a varaible:
next_mont = month + 1.
IF ...
...
ELSEIF t_period-bumon = nexst_month.
...
ENDIF.Best regards,
Guillaume
‎2006 Jul 15 11:46 PM