‎2006 Nov 27 3:38 AM
Hi all,
I need help in this case. for example i have to ranges of dates the begin and the end date. so for example the begin date is 01.01.2006 and the final date is 31.12.9999 so when i modify the end date to 31.12.2006 so, i want to put other row with the same values but the begin date i wanna put it for the next day in this case 01.01.2007.
How can i do this??? is it possible?
‎2006 Nov 27 3:48 AM
Hi Jose
Hope below code gives you some idea:
select-options: s_datum for sy-datum obligatory.
at selection-screen.
perform change_date.
*&---------------------------------------------------------------------*
*& Form change_date
*&---------------------------------------------------------------------*
FORM change_date .
data: l_datum like sy-datum value '99991231',
l_line type i.
describe table s_datum lines l_line.
loop at s_datum.
if s_datum-high is initial.
s_datum-high = l_datum.
modify s_datum.
elseif s_datum-high lt l_datum and sy-tabix eq l_line.
s_datum-low = s_datum-high + 1.
s_datum-high = l_datum.
append s_datum.
endif.
endloop.
ENDFORM. " change_dateKind Regards
Eswar
‎2006 Nov 27 3:43 AM
now, after first row, when ur inserting second row with changing end date then for begin date do this....take v1, v2, v3 as variable.
v1 = date+6(4).
v2 = date+0(2).
v3 = date+3(2).
v1 = v1 + 1.
concatenate v2 v3 v1 into date separated by '.'.
use this date........
‎2006 Nov 27 3:47 AM
LOOP AT R_DATES.
TEMP = R_DATES-HIGH.
R_DATES-HIGH = '12312006 '.
MODIFY R_DATES.
R_DATES-LOW = R_DATES-HIGH + 1.
R_DATES-HIGH = TEMP.
APPEND R_DATES.
ENDLOOP.Regards,
Ravi
Note - Please mark all the helpful answers
‎2006 Nov 27 3:48 AM
Hi Jose
Hope below code gives you some idea:
select-options: s_datum for sy-datum obligatory.
at selection-screen.
perform change_date.
*&---------------------------------------------------------------------*
*& Form change_date
*&---------------------------------------------------------------------*
FORM change_date .
data: l_datum like sy-datum value '99991231',
l_line type i.
describe table s_datum lines l_line.
loop at s_datum.
if s_datum-high is initial.
s_datum-high = l_datum.
modify s_datum.
elseif s_datum-high lt l_datum and sy-tabix eq l_line.
s_datum-low = s_datum-high + 1.
s_datum-high = l_datum.
append s_datum.
endif.
endloop.
ENDFORM. " change_dateKind Regards
Eswar