Google Search - Blog...........

Print All The Dates Between Two Dates

report zdates.


parameters: p_bdate type sy-datum ,
p_edate type sy-datum .


data: begin of it_date occurs 0,
date type sy-datum ,
end of it_date .

it_date-date = p_bdate.
append it_date.

do.

if it_date-date = p_edate.
exit.
endif.

it_date-date = it_date-date + 1.
append it_date.

enddo.


loop at it_date.

write:/ it_date-date.
endloop.


OUTPUT :

suppose if i input the start date as 12/04/2008
and enddate as 12/18/2008 then the output will be

12/04/2008
12/05/2008
12/06/2008
12/07/2008
12/08/2008
12/09/2008
12/10/2008
12/11/2008
12/12/2008
12/13/2008
12/14/2008
12/15/2008
12/16/2008
12/17/2008
12/18/2008

No comments:

Post a Comment