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: 

Date and time difference for weekdays - urgent

Former Member
0 Kudos

Hi,

Is there any fun.module which will caluculate the difference between two dates and time excluding weekends?

Thanks in advance.

Srini.

9 REPLIES 9

Former Member
0 Kudos

Hi Srinivasa,

Use thif FM <b>RKE_SELECT_FACTDAYS_FOR_PERIOD</b>

Regards

Aneesh.

Former Member
0 Kudos

Please use the function module 'DATE_CHECK_WORKINGDAY'

Former Member
0 Kudos

REPORT ZEXAMPLE.

DATA V_DIFF TYPE I.

PARAMETERS P_BIRTHD LIKE SY-DATUM.

Sample code::

CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'

EXPORTING

I_DATUM_BIS = SY-DATUM

I_DATUM_VON = P_BIRTHD

IMPORTING

E_TAGE = V_DIFF

EXCEPTIONS

DAYS_METHOD_NOT_DEFINED = 1

OTHERS = 2.

Former Member
0 Kudos

Hi Srini,

Use the following FM

SD_DATETIME_DIFFERENCE

which Give the difference in Days and Time for 2 dates

Reawrd points if helpful.

Regards

Srikanta Gope

srikanta.gope@tcs.com

0 Kudos

Hi,

It will include weekends..but I want to exclude weekends while calculating difference.

Thanks

Srini.

0 Kudos

Just Saturdays and Sundays? What about holidays?

Rob

0 Kudos

Hi,

Refer to the following link:

http://sap-img.com/abap/function-to-return-next-business-day.htm

Hope this helps.

Reward if helpful.

regards,

Sipra

Former Member
0 Kudos

<b> /SDF/CMO_DATETIME_DIFFERENCE</b>

check with it..

Reward if helpful..

Regards

Prax

Former Member
0 Kudos

Hi,

Try functions,

=> DATE_CONVERT_TO_FACTORYDATE

=> HR_HK_DIFF_BT_2_DATES

Regards,

Bhaskar