11-30-2005 3:44 PM
Hi experts ,
Is there any function module to calculate No of working days between two days.
Please help
11-30-2005 3:48 PM
11-30-2005 3:46 PM
Try one of these,
WEEK_GET_NR_OF_WORKDAYS
WLB3_GET_NUMBER_OF_WORKDAYS
11-30-2005 3:48 PM
11-30-2005 3:52 PM
Try this...
report zrich_0001.
parameters: p_start type sy-datum,
p_end type sy-datum.
data: idays type table of rke_dat with header line.
data: workingdays type i.
call function 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
exporting
i_datab = p_start
i_datbi = p_end
i_factid = 'P8' " Fact Calender ID
tables
eth_dats = idays
exceptions
date_conversion_error = 1
others = 2.
describe table idays lines workingdays.
write:/ workingdays.
Regards,
Rich Heilman
11-30-2005 3:49 PM
Hi experts,
i am using one date function module that is accepting only one date format that is yyyymmdd.
why it is behaving like this.
is there any function module to convert date to yyyymmdd
from diff date formates.
Pleas help
11-30-2005 3:52 PM
11-30-2005 3:54 PM
You can convert your data via the following function modules.
call function 'CONVERT_DATE_TO_EXTERNAL'
* EXPORTING
* DATE_INTERNAL = SY-DATUM
* IMPORTING
* DATE_EXTERNAL =
* EXCEPTIONS
* DATE_INTERNAL_IS_INVALID = 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.
call function 'CONVERT_DATE_TO_INTERNAL'
exporting
date_external =
* IMPORTING
* DATE_INTERNAL =
* EXCEPTIONS
* DATE_EXTERNAL_IS_INVALID = 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.
Regards,
Rich Heilman
11-30-2005 3:54 PM
Ramesh
Use <b>FM CONVERT_DATE_TO_INTERNAL</b> convert date to <b>yyyymmdd</b>.
Thanks
Kam
11-30-2005 3:49 PM
HI Ramesh,
YOu can use the FM DATE_CHECK_WORKINGDAY for checking whether it is a woking day or not.
you can loop a internal table with all the range of dates and check in this Function module as well.
11-30-2005 4:14 PM
whatever date u use internally it is converted to yyyymmdd.
Use the code.
v_date1 like sy-datum,
v_date2 like sy-datum.
v_date1 = date1.
v_date2 = date2.
then pass on this values to the function module and u will get the desired output.