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: 

how i will calculate the day between start date and end date

Former Member
0 Kudos

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

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Amrendra ,

Alternatively you can use function module SD_DATETIME_DIFFERENCE that could also provide you the time difference apart from date difference.

Cheers

Raghava

Former Member
0 Kudos

Check this thread.

Former Member
0 Kudos

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