03-16-2007 5:28 AM
Hi ,
Suppose I have a DATE : 03.03.2007, is thr any function module to find out whether its a Sunday, Monday, Tuesday....Saturday of the week.
Regards
Avi
03-16-2007 5:31 AM
Use Function Module DAY_IN_WEEK... pass the date to this FM and it will return the day in number..
Then use FM DAY_NAMES_GET and pass the number to this FM to get the actual Day as u want...
reward points if helpful
03-16-2007 5:31 AM
Use Function Module DAY_IN_WEEK... pass the date to this FM and it will return the day in number..
Then use FM DAY_NAMES_GET and pass the number to this FM to get the actual Day as u want...
reward points if helpful
03-16-2007 5:32 AM
Hi,
You can use function module DATE_COMPUTE_DAY or DAY_IN_WEEK to get the numeric value of the day of the week. You can use function module WEEKDAY_GET to retrieve the language specific name of the week and an abbreviation of the name.
I hope this helps.
Sample code..
DATA : DATE like SCAL-DATE,
DAY LIKE SCAL-INDICATOR.
DATE = '20050728'.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = DATE
IMPORTING
DAY = DAY.
CASE DAY.
WHEN 1.
WRITE 😕 'MONDAY'.
WHEN 2.
WRITE 😕 'TUESDAY'.
WHEN 3.
WRITE 😕 'WEDNESDAY'.
WHEN 4.
WRITE 😕 'THURSDAY'.
WHEN 5.
WRITE 😕 'FRIDAY'.
WHEN 6.
WRITE 😕 'SATURDAY'.
WHEN 7.
WRITE 😕 'SUNDAY'.
ENDCASE.
Cheers,
Simha.
03-16-2007 5:32 AM
hi,
chk this
DATE_TO_DAY
PARAMETERS date LIKE sy-datum DEFAULT sy-datum.
DATA day LIKE dtresr-weekday.
CALL FUNCTION 'DATE_TO_DAY'
EXPORTING
date = date
IMPORTING
weekday = day.
WRITE: / date , day.
1. Monday 2. Tuesday ...
Message was edited by:
Chandrasekhar Jagarlamudi
03-16-2007 5:32 AM
03-16-2007 5:34 AM
date_compute_day FM will give u the day of that date
regards,
bharat.
03-16-2007 5:34 AM
hi,
chk this.
DATA : day LIKE SCAL-INDICATOR.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = sy-datum
IMPORTING
DAY = day
.
WRITE : day.
Regards,
Anversha.S
03-16-2007 5:35 AM
03-16-2007 5:36 AM
Hi,
Use the FM:
<b>RH_GET_DATE_DAYNAME</b> return the day based on the date provided
Hope this helps.
Reward if helpful.
Regards,
Sipra
03-16-2007 5:36 AM
Hi avi,
the fm not only gives the number of the day but also the name if u pass the
language parameter and date...
RH_GET_DATE_DAYNAME
hope this helps u a bit,
all the best,
regards,
sampath
mark helpful answers
03-16-2007 5:51 AM