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: 

Number of days of month excluding only Saturday ,Sundays

Former Member
0 Kudos

Hi,

I am looking for FM which will give me number of days of Months excluding only Saturdays and Sundays....Other holidays should be included in the count...I think 'HR_E_NUM_OF_DAYS_OF_MONTH' and 'NUMBER_OF_DAYS_PER_MONTH_GET' will not serve the purpose.

Thanks in advance for your help.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Try

NUMBER_OF_DAYS_PER_MONTH_GET -> It ll give you the number of days in month

And then

use HOLIDAY_GET -->to calculate Holidays in that particular month.

And Subtract it from total no of days.

Sri

Former Member
0 Kudos

Try FM RKE_SELECT_FACTDAYS_FOR_PERIOD to get number of business days within two dates.

Please give me reward point if it is useful.

Thanks

Murali Poli

Former Member
0 Kudos

Try:

REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.

DATA: day LIKE  hrvsched-daytxt,
      start LIKE sy-datum,
      count TYPE i,
      month(2).

start = sy-datum.
start+6(2) = '01'.
month = start+4(2).

WHILE start+4(2) = month.
  CALL FUNCTION 'RH_GET_DATE_DAYNAME'
    EXPORTING
      langu  = sy-langu
      date   = start
    IMPORTING
      daytxt = day.

  IF day <> 'Saturday' AND
     day <> 'Sunday'.
    count = count + 1.
  ENDIF.
  start = start + 1.
ENDWHILE.

Rob