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: 

Working days in a Month

dielom
Active Contributor
0 Kudos

Hi,

I need a FM that determines how many working days it has a month, based on a factory calendar.

Thanks,

Diego

1 ACCEPTED SOLUTION

LucianoBentiveg
Active Contributor
0 Kudos

Try FM HOLIDAY_GET

12 REPLIES 12

LucianoBentiveg
Active Contributor
0 Kudos

Try FM HOLIDAY_GET

Former Member
0 Kudos

This thread should have all the info you need:

Hope this helps.

Sudha

Former Member
0 Kudos

Use

WDKAL_DATE_ADD_FKDAYS

Former Member
0 Kudos

check:

<b>K_ABC_WORKDAYS_FOR_PERIODS_GET

HR_E_GET_SI_DAYS_TO_WORK

WLB3_GET_NUMBER_OF_WORKDAYS</b>

rgds,

TM

Former Member
0 Kudos

Hi Anitha,

1. DATE_CHECK_WORKINGDAY

This is one useful FM

2. Try this code (just copy paste)

IT DOES EXACTLY WHAT U REQUIRE.

REPORT abc.

data : num type i.

parameters : frdate type sy-datum default '20051216'.

parameters : todate type sy-datum default '20051221'.

perform getinfo using frdate todate changing num.

break-point.

&----


*& Form getinfo

&----


  • text

----


FORM getinfo USING fromdate todate CHANGING numofdays type i.

DATA : d TYPE sy-datum.

d = fromdate - 1.

DO.

d = d + 1.

IF d > todate.

EXIT.

endif.

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'

EXPORTING

date = d

factory_calendar_id = '01'

message_type = 'I'

EXCEPTIONS

date_after_range = 1

date_before_range = 2

date_invalid = 3

date_no_workingday = 4

factory_calendar_not_found = 5

message_type_invalid = 6

OTHERS = 7.

IF sy-subrc = 0.

numofdays = numofdays + 1.

write 😕 d.

ENDIF.

ENDDO.

ENDFORM. "getinfo

I hope it helps.

Regards,

Amit M.

Former Member
0 Kudos

hi

u can use WDKAL_DATE_ADD_FKDAYS .

otherwise u can use Holiday_get .by this u will get the no. of holidays and then subtract there days from month.

u will find no. of working days.

Naveen

Former Member
0 Kudos

Use this Function module WDKAL_DATE_ADD_FKDAYS.

other is holiday_get.

Then minus holidays.

Regards

Abhishek

0 Kudos

hi,

Use FM <b>WDKAL_DATE_ADD_FKDAYS</b>

DATA: c_date LIKE sy-datlo,
c_fkday LIKE mdcal-fkday.
 
 
CALL FUNCTION 'WDKAL_DATE_ADD_FKDAYS'
     EXPORTING
          i_date  = sy-datum
          i_fkday = 2
          i_fabkl = '01'
     IMPORTING
          e_date  = c_date
          e_fkday = c_fkday
     EXCEPTIONS
          error   = 1
          OTHERS  = 2.

Message was edited by: Santosh Kumar P

Former Member
0 Kudos

Hi,

WDKAL_DATE_ADD_FKDAYS . This is the one best suited for your requirement.

Regs,

Venkat Ramanan

Former Member
0 Kudos

Hi Diego,

There is the Function Module WDKAL_DATE_ADD_FKDAYS which will help you definitely.

Ankur Garg.

former_member184619
Active Contributor
0 Kudos

Hi Diego,

Use this Fm.

NUMBER_OF_DAYS_PER_MONTH_GET

To Get No of days in month.

And then

HOLIDAY_GET

to calculate Holidays in that particular month.

And Subtract it from total no of days.

Regards

-


Sachin Dhingra

dielom
Active Contributor
0 Kudos

Thanks all for your replies.

What i need is a FM that for a given month (f.e. 01.2006) and a factory calendar (f.e. AR) it returns me the quantity of working days.

Thanks a lot.

Regards,

Diego