08-27-2008 1:24 PM
hi experts,
i have a simple problem. i want to display one report. in this report, i want display date. Means, in one column, i want to display difference b/w dates. i took a one local variable.
Problem: if dates are same, it doesn't display any thing, it shows only blank. how can i define that variable in date format?
Thanks in advance!!!
08-27-2008 1:26 PM
declare variable as
l_date type sy-datum.
if the difference is 0, then populate l_date with 00000000
08-27-2008 1:28 PM
hi Babu Anagani
if you want to display the differnce between 2 dates means
HR_99S_INTERVAL_BETWEEN_DATES use FM and declare one seperate variable of data type numeric and pass the FM return DAYS to that Variable
Regards
Deva
08-27-2008 1:30 PM
Hi
data :
w_d1 type sy-datum,
w_d2 type sy-datum,
w_diff type d.
w_d1 = sy-datum.
w_d2 = sy-datum.
w_diff = w_d1 - w_d2.
if w_diff is initial.
write :
/ w_diff. "<<<<----- 00000000
else.
write :
/ w_diff. "<<<<------Number of days between the w_d1 & w_d2
endif.
Regards
Pavan
08-27-2008 1:30 PM
Hi Babu,
Declare the variable as type sy-datum, in which you are displaying the difference of dates.
data:
w_date type sy-datum,
w_date1 type sy-datum,
w_diff type sy-datum.
w_date = sy-datum.
w_date1 = sy-datum.
w_diff = w_date - w_date1.
write: w_date.
Regards,
Chandra Sekhar
08-27-2008 1:30 PM
Hi..
if you want difference in no. of DAYS,
use
DTRESR-WEEKDAY
Thanks,
Gaurav J.
08-27-2008 1:32 PM
data : t_data type sy-datum .
t_date = date1 - date 2
if t_data = '00000000'
write blank
else
write date
endif
~hitesh
08-27-2008 1:36 PM
Hi Babu,
Try the FM below:
SD_DATETIME_DIFFERENCE
Give the difference in Days and Time for 2 dates
With luck,
Pritam.
08-27-2008 1:37 PM
HR_ECM_GET_PERIOD_BETW_DATES
using this u can find difference between the dates
hope this will be useful for you