cancel
Showing results for 
Search instead for 
Did you mean: 

Work days in a month

Former Member
0 Kudos

Hi,

I have a planning area with storage bucket profile in months and weeks. My planning book has rolling weeks.

I am trying to calculate the number of work days in the month the current week falls under.

Is there a function to calculate the number of working days in a month(with may be input as current week or bucket)??

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

You can use below macro for that :

BUCKET_WDAYS() :BUCKET_WDAYS( <calendar> ; X1 ; ... ; Xn) returns the number of workdays in the periods given by the cell(s), row(s), and/or column(s) (not areas) X1 through Xn. In the attributes of the argument elements, you must specify Period data as the data source. The specification of a calendar as the first argument is optional. If you do not specify a calendar, the system reads the calendar given by the time stream in the storage buckets profile. If no time stream is defined, the system uses calendar days.

one more :

CALENDAR_WDAYS():CALENDAR_WDAYS( u2018calendaru2019 ; from date ; <to date> ) returns the number of workdays between the from-date and the to-date in the calendar specified. The calendar is the timestream ID.

http://help.sap.com/saphelp_scm50/helpdata/en/1d/310eb0d0ee11d4b2e40050da385632/content.htm

Manish

Former Member
0 Kudos

Thanks for the reply Sai and Manish. But my data view buckets are weekly.

lets say I am on 10th October, then it is week 2 in the month. But my storage bucket profile still has month and week.

I am trying to calculate the number of working days in the month my week falls under.

if I user BUCKETWDAYS, it looks at the current bucket (week) and gives me the result as may be 5 days but I want the working in the month this bucket falls under and return a value, may be 22.

Thanks.

Former Member
0 Kudos

Visu,

Please use the macro and specify date .

CALENDAR_WDAYS( u2018calendaru2019 ; from date ; <to date> ) returns the number of workdays between the from-date and the to-date in the calendar specified. The calendar is the timestream ID.

or in the BUCKET_WDAYS() you need to put logic , calculate todays date and than subtract it from cell date to get the date from the start of the month or use macro MONTH_BDATE()

MONTH_BDATE( X ) returns the start date of the month given in the argument in integer format with reference to the date 0001/01/01.

Manish

Edited by: Manish Kumar Rathi on Oct 10, 2008 12:02 PM

Former Member
0 Kudos

I think you can try using a macro BUCKET_WDAYS():BUCKET_WDAYS( <calendar> ; X1 ; ... ; Xn) returns the number of workdays in the periods given by the cell(s), row(s), and/or column(s) (not areas) X1 through Xn. In the attributes of the argument elements, you must specify Period data as the data source. The specification of a calendar as the first argument is optional. If you do not specify a calendar, the system reads the calendar given by the time stream in the storage buckets profile. If no time stream is defined, the system uses calendar days.

or CALENDAR_WDAYS():CALENDAR_WDAYS( u2018calendaru2019 ; from date ; <to date> ) returns the number of workdays between the from-date and the to-date in the calendar specified. The calendar is the timestream ID

Former Member
0 Kudos

Hi,

Have you checked transaction SCAL for calculating your company's no. of working days.