Hi
I have a date range (Pay period). now from the start date i Need to find out both Dates of a specific day of that Pay period.
For Example If i know the date range is
01/06/2007 to 01/19/2007
Then I need to know what are the dates for both Saturdays.
Here it should be 01.06.2007 and 01.13.2007.
Please help. I always award points. Thanks
Message was edited by:
Anwarul Kabir
If I understand correctly...
The simple solution would be just to add 7 to lower date. In your case 01/06/2007.
Or else
1) get the difference in no. if days between the 2 dates.
2) divide the number by 7
3) Ignore the decimal places.
4) Multiply the number you get by 7
5) Add this number to the lower date. <b>Thats the result</b>
Dont know if that sounds good to you.
Else, please give another example.
Hope it helps.
Lokesh
Message was edited by:
Lokesh Aggarwal
Hi,
Please try this.
PARAMETERS: P_START LIKE SY-DATUM, P_END LIKE SY-DATUM. DATA: DAYS TYPE I, WEEKDAY LIKE DTRESR-WEEKDAY. DAYS = P_END - P_START. DO DAYS TIMES. CALL FUNCTION 'DATE_TO_DAY' EXPORTING DATE = P_START IMPORTING WEEKDAY = WEEKDAY. IF WEEKDAY = 'Sat.'. WRITE: / P_START. ENDIF. P_START = P_START + 1. ENDDO.
Regards,
Ferry Lianto
Add a comment