Application Development and Automation 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: 
Read only

date calculation

Former Member
0 Likes
825

Hi all,

Is there a way to directly calculate the no of days between 2 given dates?

Thanks & Regards,

Ananda

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
800

Hi

DATA: DATE1 LIKE SY-DATUM,

DATE2 LIKE SY-DATUM.

DATA: DAYS TYPE I.

DAYS = DATE1 - DATE2.

Max

8 REPLIES 8
Read only

Former Member
0 Likes
801

Hi

DATA: DATE1 LIKE SY-DATUM,

DATE2 LIKE SY-DATUM.

DATA: DAYS TYPE I.

DAYS = DATE1 - DATE2.

Max

Read only

Former Member
0 Likes
800

Hai Ananda

Check the following Code

report zrich_0001.

data: begin_date type sy-datum value '20060110',

end_date type sy-datum value '20060125'.

data: idatum type table of sy-datum with header line.

idatum = begin_date.

append idatum.

do.

if idatum = end_date.

exit.

endif.

idatum = idatum + 1.

append idatum.

enddo.

loop at idatum.

write:/ idatum.

endloop.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
800

Hi

Please use the following FM

SD_DATETIME_DIFFERENCE

Read only

Former Member
0 Likes
800

Hi,

days type i.


days = date1 - date2.

Read only

0 Likes
800

1)Use this FM

DAYS_BETWEEN_TWO_DATES

2)data: days type i.

days = date1 - date2.

Read only

Former Member
0 Likes
800

SD_DATETIME_DIFFERENCE and 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

Read only

Former Member
0 Likes
800

hi,

check these fm's.

<b>FIMA_DAYS_BETWEEN_TWO_DATES

FIMA_DAYS_BETWEEN_TWO_DATES_2 </b>

Regards

vijay

Read only

Former Member
0 Likes
800

Hi,

you can use this function module,

HRVE_GET_TIME_BETWEEN_DATES

reward points if find helpful.