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 in month excluding Sunday's.

Former Member
0 Kudos

Dear All,

I searched lot on sdn for number or Sunday's in month but i unable to find that FM.

Please tell me the FM for the same.

Actually i want to get number of working days excluding Sunday's from the month.If any holidays is coming in month that should not minus from the total days.

If in month 30 days are there and in that 4 sunday is there and 2 holidays suppose for diwali.

In this case only that 4 sunday have to remove from 30 days means working days comes to 30 - 4 = 26.(26 days).

Thanks & Regards,

Sanket.

1 ACCEPTED SOLUTION

former_member705122
Active Contributor
0 Kudos

Similar post:

->Get the number of sundays for a given month code is show in link

link:

->Use this FM to get number of days in a given month

NUMBER_OF_DAYS_PER_MONTH_GET

-> result = number of days in a month - number of sundays in a month

6 REPLIES 6

Former Member
0 Kudos

Hi Sanket,

Try this FM:

FIMA_DAY_CONVERT_TO_WORKINGDAY

Cheers,

Heinz

0 Kudos

which parameter i have to pass only date or more.

0 Kudos

Hi Sanket,

In addition to my first recommendation, please try this:

DATA: it_days LIKE STANDARD TABLE OF rke_dat .
 
  SELECT SINGLE fabkl INTO calendar_code FROM t001w CLIENT          
  SPECIFIED  WHERE mandt = sy-mandt AND werks = plant.
 
  CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
    EXPORTING
      i_datab               = first_date 
      i_datbi               =  last_date
      i_factid              = calendar_code
    TABLES
      eth_dats              = it_days
    EXCEPTIONS
      date_conversion_error = 1
      OTHERS                = 2.
  IF sy-subrc  0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
 
  DESCRIBE TABLE it_days LINES working_days.

FABKL is the company's calendar-code - some holidays are company-specific.

Heinz

0 Kudos

Hi Heinz,

thanks for your reply but it is not suitable for my requirement.

thanks,

Sanket.

former_member705122
Active Contributor
0 Kudos

Similar post:

->Get the number of sundays for a given month code is show in link

link:

->Use this FM to get number of days in a given month

NUMBER_OF_DAYS_PER_MONTH_GET

-> result = number of days in a month - number of sundays in a month

Former Member
0 Kudos

closed