Application Development and Automation 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: 
Read only

working days

Former Member
0 Likes
930

Hi Gurus,

How to calculate working days between two dates? Is there any FM for it?

Thx in advance.

Regards,

Shaik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
901

Please check the below funtion module,

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'

Regards,

Line

Please check the below funtion module,

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'

Regards,

Line

6 REPLIES 6
Read only

Former Member
0 Likes
901

hi,

use

K_ABC_WORKDAYS_FOR_PERIODS_GET

RKE_SELECT_FACTDAYS_FOR_PERIOD

Refer

Read only

Former Member
0 Likes
901

hi,

WEEK_GET_NR_OF_WORKDAYS

Reward if useful!

Read only

Former Member
0 Likes
901

Hi,

Check these FM's :-

FIMA_DAYS_AND_MONTHS_AND_YEARS

HR_SGPBS_YRS_MTHS_DAYS

RKE_SELECT_FACTDAYS_FOR_PERIOD

You can use the following FM

CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'

EXPORTING

i_datab = date1

i_datbi = date2

i_factid = 'GB'

TABLES

eth_dats = l_it_dat.

In i_factid you have to pass factory Id like for india 'IN' or some other coutnry

n pass two dates you will get only working days in between those two dates

according to that calender

Use the function module

WDKAL_DATE_ADD_FKDAYS

to get the No of working days between the date range.

and the function module,

WEEK_GET_NR_OF_WORKDAYS

K_ABC_WORKDAYS_FOR_PERIODS_GET

Regards,

Padmam.

Read only

Former Member
0 Likes
901
report zdata_0003.
 
data: begin of itab occurs 0,
      datum type sy-datum,
      end of itab.
 
data: weekday like dtresr-weekday.
data: number_lines type i.
 
parameters: p_sdatum type sy-datum,
            p_edatum type sy-datum.
 
 
itab-datum = p_sdatum.
append itab.
 
do.
 
  if itab-datum = p_edatum.
    exit.
  endif.
 
  itab-datum = itab-datum + 1.
 
 
  call function 'DATE_TO_DAY'
       exporting
            date    = itab-datum
       importing
            weekday = weekday.
  if weekday = 'Sat.'
    or weekday = 'Sunday'.
    continue.
  endif.
 
  append itab.
 
 
enddo.
 
describe table itab lines number_lines.
 
write:/ 'Number of days between dates is', number_lines.

reward points if it is usefull ....

girish

Read only

Former Member
0 Likes
902

Please check the below funtion module,

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'

Regards,

Line

Read only

Former Member
0 Likes
901

<b>Find the difference between two days in days, months and years</b>

REPORT ZDATEDIFF.

DATA: EDAYS   LIKE VTBBEWE-ATAGE,
      EMONTHS LIKE VTBBEWE-ATAGE,
      EYEARS  LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
            TODATE   LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
  exporting
    i_date_from          = FROMDATE
    i_date_to            = TODATE
*   I_FLG_SEPARATE       = ' '
  IMPORTING
    E_DAYS               = EDAYS
    E_MONTHS             = EMONTHS
    E_YEARS              = EYEARS.

WRITE:/ 'Difference in Days   ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years  ', EYEARS.

INITIALIZATION.
FROMDATE = SY-DATUM - 60.

reward points if it is usefull ...

Girish