09-24-2008 7:25 AM
Hi Experts,
I have a scenario in which I am giving Week no on the selection screen.
Week _______ to _______.
This is a field of table S012-SPWOC.
Now I have to calcualte the date on First Monday in the given range.
Say user enters
Week 04/2008 to 16/2008.
Now I have to calculate the date on the first Monday in this range.
Regards,
Krishan
09-24-2008 7:37 AM
Hi,
Try this.
Use the function module 'WEEK_GET_FIRST_DAY' and give the value of WEEK as 200804, you wil get the date of the first monday.
Sharin.
09-24-2008 7:37 AM
Hi,
Try this.
Use the function module 'WEEK_GET_FIRST_DAY' and give the value of WEEK as 200804, you wil get the date of the first monday.
Sharin.
09-24-2008 7:42 AM
hi,
use FM "VELO03_WEEK_OR_MONTH_TO_DATE"
give week as 04 and year as 2008.
you will get the correct output.
09-24-2008 7:43 AM
it is not possible to calculate Month from week, as a week can be in 2 months. (example week 31 is partly in juli and august)
Without more information (e.g. day) it is just not possible.
Therefore you will not find any routines that can do that.
The same with week to quarter.
For calweek to week just leave the year out.
in the above told case we cant give week number as 16 if user gaved 16/2008 to 45/2008
Edited by: Midhun Abraham on Sep 24, 2008 8:44 AM
09-24-2008 7:49 AM
Hi,
try this:
PARAMETERS: WEEKF LIKE S012-SPWOC.
*
DATA: DATEF LIKE SY-DATUM.
*
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
WEEK = WEEKF
IMPORTING
DATE = DATEF.
*
WRITE: / WEEKF, DATEF.
*
Regards, Dieter