2008 Nov 13 1:09 PM
Dear All,
I'm using the FM DATE_GET_WEEK to convert a Date into a Week.
I gave a Date as 12/28/2008 (MM/DD/YYYY).
The output was 200953.
I think this is absurd. As far as I know there will not be any Calendar week with 53 for the Year 2009.
Is this the Problem with the Fm ?
Is there any SAP note reg. this ?
Request your help !
Thanks & Regards,
Deepu.K
2008 Nov 13 1:42 PM
2009 has 53 weeks, As the first week of a year is the week that contains the first Thursday of a year. In 2009 this is january 1st, in 2010 this will be januaty 7th, so the last week of 2009 will be the 53th. (the week of 2009 begins with 2009.01 monday 12/29/2008 end ends with 2009.53 sunday 01/03/2010, a long year)
(Look at [ISO week date at wikipedia|http://en.wikipedia.org/wiki/ISO_week_date])
Regards
Dear All,
I'm using the FM DATE_GET_WEEK to convert a Date into a Week.
I gave a Date as 12/28/2008 (MM/DD/YYYY).
The output was 200953.
I think this is absurd. As far as I know there will not be any Calendar week with 53 for the Year 2009.
Is this the Problem with the Fm ?
Is there any SAP note reg. this ?
Request your help !
Thanks & Regards,
Deepu.K
2008 Nov 13 1:14 PM
Hi Deepu,
I have executed the FM by putting the same input 12/28/2008 which you have put. But my output is different that is '200852'.
I Think you might enter some wrong value. I am pretty sure. check it again.
Thanks,
Chidanad
2008 Nov 13 1:15 PM
It is giving correct o/p 200852 if i give date as 28.12.2008 in DATE_GET_WEEK function module
2008 Nov 13 1:15 PM
Indeed is really absurd. But I tried it , gave me 200852. How did you pass the date to the function I passed it as 20081228 ?
regards,
Advait
2008 Nov 13 1:18 PM
Dear All,
When I pass the Date as 12/28/2008 (MM/DD/YYYY Format) I'm getting the week as 200852.
But when I pass the Date as 12/28/2009 I'm getting the week as 200953.
Regards,
Deepu.k
2008 Nov 13 1:19 PM
Hello Deepu,
Fm DATE_GET_WEEK works fine
just provide the date as per your sustem default date
my system default date is DD.MM.YYYY
give the date in the same for mat as 13.11.2008
Answer is WEEK : 200846
Thanks
RK
Edited by: RK on Nov 13, 2008 2:20 PM
2008 Nov 13 1:30 PM
Hello RK,
Did u check with MM/DD/YYYY Format and with the Date as 12/28/2009 ?
Let me know what value u r getting for the above params !
Regards,
Deepu.k
.
2008 Nov 13 1:34 PM
Hello,
Year 2009 has 53 weeks. FM is returning the correct values. Have checked the same.
Thanks,
Jayant
2008 Nov 13 1:35 PM
Yes , you are right it does give 200953 for that date. But it is correct. If you notice your outlook calendar , you will see that the week starting from 28th December has week number 53.
regards,
Advait
2008 Nov 13 1:40 PM
Hello Deepu,
Iam sorry , Iam not able to change my defalut parameters, If I give the date 12/28/2009 , system not accepting and it returns an error message like enter valid value.
For date 28.12.2009 , Iam getting Week 200953.
Thanks
RK
Edited by: RK on Nov 13, 2008 2:40 PM
2008 Nov 13 1:44 PM
if the date value is in cell B4 of an excell doc
=INT((B4-DATE(YEAR(B4-WEEKDAY(B4-1)4),1,3)WEEKDAY(DATE(YEAR(B4-WEEKDAY(B4-1)4),1,3))5)/7) formula gives the week number.
DATA: date LIKE scal-date,
week LIKE scal-week.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = sy-datum
IMPORTING
week = week
EXCEPTIONS
date_invalid = 1.
WRITE / week.output:200846
2008 Nov 13 1:42 PM
2009 has 53 weeks, As the first week of a year is the week that contains the first Thursday of a year. In 2009 this is january 1st, in 2010 this will be januaty 7th, so the last week of 2009 will be the 53th. (the week of 2009 begins with 2009.01 monday 12/29/2008 end ends with 2009.53 sunday 01/03/2010, a long year)
(Look at [ISO week date at wikipedia|http://en.wikipedia.org/wiki/ISO_week_date])
Regards
2008 Nov 13 1:49 PM
2008 Nov 13 1:54 PM
Hello Deepu,
There were many other correct replies in the thread too... not just 1 (and that too in last).
Thanks,
Jayant
2008 Nov 13 1:58 PM
Yes Jayanth,
U r right ! But the Reply with reasoning which is suitable for the Queries scenario will be appreiciated !
Anyways ...credit is given
Regards,
Deepu.k
2008 Nov 13 2:02 PM
Thank you Deepu, We should always be thankful to all the people replying to your post. This should be the best practice to make SDN Best. Thank you for your understanding.
Thanks,
Jayant
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |