‎2007 Aug 13 3:29 PM
Is there any standard function module to find the date within a week.
for example my input is 10-08-2007 and required date's day of week 3. it should return the wednesday's date 08-08-2007.
dynamically i will specify the return date by giving the day of week.
is there any function module.
Any idea.
Thanks in advance.
Maya.
‎2007 Aug 13 3:53 PM
Hi,
Please use FM RP_CALC_DATE_IN_INTERVAL.
data: wa_sdate like sy-datum,
wa_edate like sy-datum.
move sy-datum to wa_sdate.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = wa_sdate
days = 3
months = 0
signum = '-'
years = 0
importing
calc_date = wa_edate.
write: / wa_edate.
Regards,
Ferry Lianto
‎2007 Aug 13 3:31 PM
Why dont you directly Subtract it.
v_date = sy-datum - p_date.
this works.
Regards,
Amit
Reward all helpful replies.
‎2007 Aug 13 3:43 PM
Hi,
Subracting the day number from the date given to you as an input will give you the date of the day of the week.
Hope it was useful.
Thanks,
Sandeep.
‎2007 Aug 13 3:53 PM
Hi,
Please use FM RP_CALC_DATE_IN_INTERVAL.
data: wa_sdate like sy-datum,
wa_edate like sy-datum.
move sy-datum to wa_sdate.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = wa_sdate
days = 3
months = 0
signum = '-'
years = 0
importing
calc_date = wa_edate.
write: / wa_edate.
Regards,
Ferry Lianto
‎2007 Aug 13 4:51 PM