07-13-2006 10:55 AM
how can i get the start date and end date for a given week
like if i give week no. 28 then it will return the dates of the week like
start date = 10-07-2006
end date = 16-07-2006.
abhishek
07-13-2006 11:00 AM
Hi Abhishek,
try using function group SCAL and in it FM like this:
call function 'DATE_GET_WEEK'
exporting
date = date_in
importing
week = week
exceptions
date_invalid = 1
others = 2.
call function 'WEEK_GET_FIRST_DAY'
exporting
week = week
importing
date = date_out
exceptions
week_invalid = 1
others = 2.
Last day of the next week you can get by just SUBTRACT 1 FROM date_out of next week.
Hope that helps,
Oliver
07-13-2006 10:57 AM
Hello,
U can try with this FM DAY_IN_WEEK
If useful reward points.
Regards,
Vasanth
07-13-2006 10:58 AM
hi,
Check FM <b>DAY_IN_WEEK</b>
CALL FUNCTION 'DAY_IN_WEEK'
EXPORTING
DATUM = P_DATE
IMPORTING
WOTNR = DAY_NUM.
IF DAY_NUM <> 1.
MESSAGE I000(ZICPR).
LEAVE LIST-PROCESSING.
ENDIF.
Check date section of
http://www.geocities.com/victorav15/sapr3/abapfun.html
Regards,
Santosh
07-13-2006 10:58 AM
Hello,
For first date : WEEK_GET_FIRST_DAY
Give input as 200628.
FOr last date = first date + 6.
Regards,
Naimesh
07-13-2006 11:00 AM
Hi Abhishek,
try using function group SCAL and in it FM like this:
call function 'DATE_GET_WEEK'
exporting
date = date_in
importing
week = week
exceptions
date_invalid = 1
others = 2.
call function 'WEEK_GET_FIRST_DAY'
exporting
week = week
importing
date = date_out
exceptions
week_invalid = 1
others = 2.
Last day of the next week you can get by just SUBTRACT 1 FROM date_out of next week.
Hope that helps,
Oliver
07-13-2006 11:02 AM
WEEK_GET_FIRST_DAY
week = '200628'.
It will return the first date.
last_date = first_date + 6.
Regards,
Wasim Ahmed
07-13-2006 11:08 AM
Hi,
You can use the FM <b>GET_WEEK_INFO_BASED_ON_DATE</b>
Import parameters Value
DATE 07/13/2006
Export parameters Value
WEEK 200628
MONDAY 07/10/2006
SUNDAY 07/16/2006
Regards
vijay