11-15-2006 6:51 AM
Dear all .
Is there any funcion module which gives first and last day of the current week .
Eg . todays day is 15.11.2006
start date of week : 13.11.2006
end date of week : 19.11.2006
in the same way I want how many days are there in month .
Eg : for Nov month :
30 days .
for dec month 31 days .
Thank you in advance
11-15-2006 6:55 AM
11-15-2006 6:57 AM
use fm<b> WEEK_GET_FIRST_DAY</b>, It find out the first day of a week, after you can calculate the last: last_day = first_day + 5.
11-15-2006 6:57 AM
Use FM GET_WEEK_INFO_BASED_ON_DATE
Import parameters Value
DATE 15.11.2006
Export parameters Value
WEEK 200646
MONDAY 13.11.2006
SUNDAY 19.11.2006
Use FM HR_E_NUM_OF_DAYS_OF_MONTH
Import parameters Value
P_FECHA 15.11.2006
Export parameters Value
NUMBER_OF_DAYS 30
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
11-15-2006 6:57 AM
11-15-2006 7:00 AM
HR_E_NUM_OF_DAYS_OF_MONTH use this fm for getting the days in month
11-15-2006 7:00 AM
hi,
you can use FM week_get_first_day to get first day of current week.
Eg:
data: v_week type scal-week,
v_date type scal_date.
CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = v_week
IMPORTING
date = v_date
regards,
Prema A
11-15-2006 7:03 AM
hI,
You can use the FM <b>NUMBER_OF_DAYS_PER_MONTH_GET</b> to get the no. of days.
Use <b>WEEK_GET_FIRST_DAY</b> for getting first day of the week.
11-15-2006 7:07 AM
Hi,
the FM
GET_WEEK_INFO_BASED_ON_DATE works well.
pass any date of the week, you will get the start date and end date of week.
Check it.
Regards
vijay
11-15-2006 7:08 AM
HI,
check the logic below for getting first and last day of week.
report z_test2 line-size 100 line-count 50.
data: dat type datum.
data: days type p.
data: lastday type datum.
data: firstday type datum.
dat = sy-datum.
CALL FUNCTION 'DAY_IN_WEEK'
EXPORTING
DATUM = dat
IMPORTING
WOTNR = days
.
lastday = dat + days + 1.
firstday = lastday - 6.
write:/ firstday, lastday.