Showing results for 
Search instead for 
Did you mean: 

only working days after calculating date difference in update rule

0 Kudos

Hello all,

I want to calcute days within a update rule either by using a routine or the formula (date_diff).

How can i make sure that I only get working days as result. For example I calculate the difference between 05/14/2007 and 05/21/2007. the resulkt should be 5 days (not 7)

Any help would be great.

Best regards,

Stefan from Munich/Germany

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Bit of a programing effort; but nor difficult. There is a FM : /OSP/GETDATE_WEEKDAY.

You may study this FM .

You have to system date and check if the day is a week day. There is also another FM that get you the day of the week gievn the date. With this logic, you can get the no of weekdays between 2 dates.

Ravi Thothadri

Former Member
0 Kudos


See steps below to be applied in the routine to the update rules for the required characteristic:

1. You must choose an appropiate factory calendar to work with.

2. Convert your two dates into the factory dates (using FM 'DATE_CONVERT_TO_FACTORYDATE').

3. Use FACTORYDATE parameter in the above FM to calculate the difference bteween the 2 factory dates.

Hope this helps