07-06-2006 11:24 PM
I have a date stored in a variable vdat..
I want to know if this date is in between today and with in 7 days from today and depending on that, I want to perform some conditions.
How to do that?
Thanks a lot.
07-06-2006 11:29 PM
Hello nuren,
you can use range for checking
Ranges: r_date for vdat occurs 0.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = sy-datum.
r_date-high = sy-datum + 7.
if yourdatefield IN r_date.
with in 7 days.
Else.
outside 7 days.
ENDIF.
Thanks,
Amit
07-06-2006 11:29 PM
Hello nuren,
you can use range for checking
Ranges: r_date for vdat occurs 0.
r_date-sign = 'I'.
r_date-option = 'BT'.
r_date-low = sy-datum.
r_date-high = sy-datum + 7.
if yourdatefield IN r_date.
with in 7 days.
Else.
outside 7 days.
ENDIF.
Thanks,
Amit
07-06-2006 11:31 PM
hi Nuren,
Do this way...
<b>
data : v_date type sy-datum value '29/06/2006',
v_final type sy-datum,
v_week type sy-datum,
v_today type sy-datum.
v_today = sy-datum.
v_week = sy-datum - 7.
if ( v_date GE v_today ) and ( v_date LE V_WEEK ).
WRITE : 'TRUE'.
else.
WRITE : 'FALSE'.
ENDIF.
.</b>
Reward if it helps...
Regards,
Santosh
Message was edited by: Santosh Kumar P
07-06-2006 11:46 PM
Also look at FMs
<b>WDKAL_DATE_ADD_FKDAYS
HR_SEN_CALE_DAYS_DATE</b>
Thanks
Saquib