cancel
Showing results for 
Search instead for 
Did you mean: 

Want to calculate the total number of days excluding holidays and weekends ....?

vaibhav_rathore
Participant
0 Kudos

Hello all,

I am stuck with the situation here ,

what i need is to calculate the total number of days excluding the Holidays and Weekends in HANA. How can i calculate the same by not adding (excluding) the saturdays and sundays and also the holidays. I am not able to apply the logic here.

How can i achieve that. Need suggestions plz....

Thanks and Regards

Vaibhav

Accepted Solutions (0)

Answers (3)

Answers (3)

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Vaibhav,

Please check this blog.

Regards,

Muthuram

vaibhav_rathore
Participant
0 Kudos

Hi,

Is there any way to calculate it in views, means graphical form?

i dont have TFACS table and holiday list also.

What approach should i follow?

Thanks

Vaibhav

chandan_praharaj
Contributor
0 Kudos

can you try replicating the scenario which Muthuram has attached.

muthuram_shanmugavel2
Contributor
0 Kudos

Hi Vaibhav,

Are you using BW on HANA system?

Then you can find the TFACS Table in <SAPSID> schema.

If You are not using BW on HANA system,

For Holiday List, You have to Prepare the Holiday List in Excel and upload to HANA Table.

Then Use the Procedure mentioned in the blog.

Regards,

Muthuram

chandan_praharaj
Contributor
0 Kudos

Hi ,

Which SPS you are using.

1. You can replicate the TFACS(factory cal) replicated in your schema.

2. Use the select as below:


SELECT WORKDAYS_BETWEEN('01', '2014-01-10', '2014-01-09' , 'YOUR_SCHEMA_NAME')  FROM DUMMY;

Note: there is no optimal alternative to this solution. So use this.

Regards,

Chadan

Ibrahem
Participant
0 Kudos

If you have ecc system installed in top of HANA DB you can use : WORKDAYS_BETWEEN

example:

  1. create a Scripted Calculation view
  2.    WORKDAYS_BETWEEN(#Calender ID##Date 1#, #Date 2#), #Schema# ( As a Default : 'SAPNHP' ) ) AS "DIFF_DAYS"

Documentation:

WORKDAYS_BETWEEN - SAP HANA SQL and System Views Reference - SAP Library