Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

regarding date

Former Member
0 Kudos

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!!!

8 REPLIES 8

Former Member
0 Kudos

declare variable as

l_date type sy-datum.

if the difference is 0, then populate l_date with 00000000

Former Member
0 Kudos

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

bpawanchand
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi..

if you want difference in no. of DAYS,

use

DTRESR-WEEKDAY

Thanks,

Gaurav J.

Former Member
0 Kudos

data : t_data type sy-datum .

t_date = date1 - date 2

if t_data = '00000000'

write blank

else

write date

endif

~hitesh

Former Member
0 Kudos

Hi Babu,

Try the FM below:

SD_DATETIME_DIFFERENCE

Give the difference in Days and Time for 2 dates

With luck,

Pritam.

Former Member
0 Kudos

HR_ECM_GET_PERIOD_BETW_DATES

using this u can find difference between the dates

hope this will be useful for you