‎2006 Aug 07 7:36 AM
hello,how can i find the weeks pass the date what i input,if have any functions?
for example,i creat one PO on 2006.8.7,next time,i will judge the PO was pass 4 weeks.
‎2006 Aug 07 7:53 AM
Hi
Not sure about your requirement, if you want to add or subtract no.of weeks for a date you can try using FM: HRWPC_BL_DATES_WEEK_INTERVAL.
Kind Regards
Eswar
Note: Reward for helpful answers.
‎2006 Aug 07 7:49 AM
Here u can use a fm for a financial year. This will solve the problem but i think this is not the correct FM as u have to pass one more parameter i.e, the tax_year_begin. just check it out once if it helps u.
HR_IE_NUM_PRSI_WEEKS
‎2006 Aug 07 7:49 AM
Hi,
I am unablt o see any direct FM there for this.
But you can go like this, ?Use this FM DATE_GET_WEEK with Current date and then again with that PO date.
It will return you the Calender Week for both you can subtract it and there is your result.
Hope you find it helpful.
Regards,
Amit
‎2006 Aug 07 7:53 AM
Hi
Not sure about your requirement, if you want to add or subtract no.of weeks for a date you can try using FM: HRWPC_BL_DATES_WEEK_INTERVAL.
Kind Regards
Eswar
Note: Reward for helpful answers.
‎2006 Aug 07 8:41 AM
Hi,
DATA: weeknum1 LIKE SCAL-WEEK,
weeknum2 LIKE SCAL-WEEK,
week_diff type i.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = '20060907'
IMPORTING
WEEK = weeknum1
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
date = '20060807'
IMPORTING
WEEK = weeknum2
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2.
week_diff = weeknum1 - weeknum2.
write : 'No of weeks pass ' , week_diff.
Rgds,
Shakuntala
‎2006 Aug 07 8:46 AM
‎2008 Nov 10 4:33 PM
>
> week_diff = weeknum1 - weeknum2.
>
> write : 'No of weeks pass ' , week_diff.
>
> Rgds,
> Shakuntala
Sorry but this is the worst idea I can imagine. Hopefully you never used that in a productive environment. I'm now in a similar situation and found your thread while looking for some ideas to avoid unnecessary coding. Ok, it's now almost three years old, but perhaps someone might still read this.
Let weeknum1 be '200903' and weeknum2 be '200843' (yes, the FM returns YYYY.WW). Then the (mathematical) difference would be 60 "weeks", i.e. more than one year?? I don't think so.
Please be more carefully and test your coding against situations that one does not think about in the first moment, e.g. a change of year between to dates.
Regards,
Andreas