11-12-2005 8:44 PM
hi i m new member of this group.
how can i find the number of day between start date and end date.
difference of start date and end date convert(store)in number of days
11-12-2005 9:01 PM
All you need to do is subtract them. The ABAP runtime will take care of the rest.
Data: number_of_days type i,
begin_date type sy-datum,
end_date type sy-datum.
numbers_of_days = end_date - begin_date.
Welcome to SDN!! Please remember to award points for helpful answers and mark your posts as solved when solved completely. Thanks.
Regards,
Rich Heilman
11-12-2005 9:13 PM
Hi Amarendra,
Welcome to SDN>
Use Function : DAYS_BETWEEN_TWO_DATES
or use Rich's logic as
No.of days = LAstdate - Startdate.
Message was edited by: Lanka Murthy
Message was edited by: Lanka Murthy
11-12-2005 10:08 PM
Amrendra ,
Alternatively you can use function module SD_DATETIME_DIFFERENCE that could also provide you the time difference apart from date difference.
Cheers
Raghava
11-13-2005 2:15 AM
11-13-2005 2:06 PM
Amrendra ,
If you are only looking for number of working days between two date using some factory calendar here is one more idea.
call function 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
exporting
i_datab = starting date
i_datbi = ending date
i_factid = 'US'
tables
eth_dats = it_eth_dats.
You need to pass starting date , end date & factory id as input to the function module . The output would contain all the working days in between according to the factory calendar id supplied to the function module.
after you get the output table populated , You can describe the same to get number of days in between those dates for that factory calendar.
Cheers
Raghava