Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Dates between 2 given dates

hi,

i want to know is there any function module which will return all the dates between the given range of dates.

example : if i give 20/01/2006 and 25/01/2006 it should return 20/01/2006,21/01/2006,22/01/2006,23/01/2006,24/01/2006,25/01/2006.

regards

Srikanth Kidambi.

Intelligroup.

Tags:
Former Member
replied

Please check this sample program.


report zrich_0001.

data: begin_date type sy-datum value '20060110',
      end_date type sy-datum value '20060125'.

data: idatum type table of sy-datum with header line.

idatum = begin_date.
append idatum.

do.
  if idatum  = end_date.
    exit.
  endif.
  idatum =  idatum + 1.
  append idatum.
enddo.


loop at idatum.

  write:/ idatum.
endloop.

Regards,

Rich Heilman

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question