2007 Jul 12 8:58 AM
Hi Gurus,
How to calculate working days between two dates? Is there any FM for it?
Thx in advance.
Regards,
Shaik
2007 Jul 12 9:05 AM
Please check the below funtion module,
CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
Regards,
Line
Hi Gurus,
How to calculate working days between two dates? Is there any FM for it?
Thx in advance.
Regards,
Shaik
2007 Jul 12 9:01 AM
2007 Jul 12 9:01 AM
2007 Jul 12 9:02 AM
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.
2007 Jul 12 9:04 AM
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
2007 Jul 12 9:05 AM
Please check the below funtion module,
CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
Regards,
Line
2007 Jul 12 9:05 AM
<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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |