‎2008 Oct 21 5:43 PM
Guys,
Can somebody please let me know the FM, that will give me the dates between 2 dates?
Thanks in advance....
‎2008 Oct 21 5:47 PM
Hi
You don't need any fm (and I don't know if there's any one):
DATA: DAY_1 TYPE SY-DATUM VALUE '20081020',
DAY_2 TYPE SY-DATUM VALUE '20081231'.
DATA: DAY TYPE SY-DATUM.
DO.
DAY = DAY_1 + 1.
IF DAY = DAY_2.
EXIT.
ENDIF.
WRITE / DAY.
ENDDO.Max
‎2008 Oct 21 5:47 PM
Hi
You don't need any fm (and I don't know if there's any one):
DATA: DAY_1 TYPE SY-DATUM VALUE '20081020',
DAY_2 TYPE SY-DATUM VALUE '20081231'.
DATA: DAY TYPE SY-DATUM.
DO.
DAY = DAY_1 + 1.
IF DAY = DAY_2.
EXIT.
ENDIF.
WRITE / DAY.
ENDDO.Max
‎2008 Oct 21 5:47 PM
‎2008 Oct 21 5:52 PM
This might be the 10th time I am seeing this question in the last couple of weeks.
‎2008 Oct 21 7:05 PM
Rob,
I did try, and then only I posted it on the forum. I found those are not relevent to me.
MxG,
I have not found it when I searched it.
I would have appriciated had you answered it.
‎2008 Oct 21 7:08 PM
Hi Sam,
Check out the Function Module
RKE_SELECT_FACTDAYS_FOR_PERIOD
Or
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
Thanks,
Chidanand
‎2008 Oct 21 7:11 PM
‎2008 Oct 21 7:19 PM
Hi,
Sorry to enter into discussion in the middle.
I tried to execute max's code but it took me to DUmp and its serious error my system adminstartor has given worng regarding this program. He said highly memory consuming code and may damage kernal . i think its so strange.
When i tried to find where the error occurs its in the write statement
write:/ day.
Program is requesting for 740232384 bytes.
Regards
Balu
‎2008 Oct 21 7:25 PM
Not really a serious error - I don't see how it could damage the kernel. But yes, it's in an infinite loop.
Rob
‎2008 Oct 21 7:28 PM
‎2008 Oct 21 7:34 PM
we can correct the code.
DATA: DAY_1 TYPE SY-DATUM VALUE '20081020',
DAY_2 TYPE SY-DATUM VALUE '20081231'.
DO.
IF DAY_1 = DAY_2.
EXIT.
ENDIF.
WRITE / DAY_1.
DAY_1 = DAY_1 + 1.
ENDDO.
‎2008 Oct 21 7:29 PM
Hi ,
this is FM for the finding the diff b/w 2 dats.
FIMA_DAYS_BETWEEN_TWO_DATES.
Regards,
Bharani
‎2008 Oct 21 7:57 PM
Hello Sam
Class CL_RECA_DATE provides many useful methods, e.g.:
GET_DATE_DIFF
GET_DAYS_BETWEEN_TWO_DATESAnother interesting classes is CL_RECA_DATE_SLICES.
Regards
Uwe
‎2008 Oct 22 4:27 PM
Sorry for responding late, Max's code worked for me. Actually it was simple but did not strike to me before. I had to make minor changes.
Thanks all.