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: 

need to subtract 2 date field

Former Member
0 Kudos

i need to find delay%

delay% = ((aufk-idat2) - (caufvd-gltrp))/((caufvd-gltrp) - (caufvd-gstrp))* 100.

how to subtract two date field and then divide it.

5 REPLIES 5

Former Member
0 Kudos

You can just do - (minus).

For example: if you do (vsy-daum -1), it will give you yesterdays date.

And lets say, if you do '12/10/2005' - '12/02/2005' it will give you 8.

then divide it by 100 to bet the percentage.

Did i answer your question.

Please close the issue with appropriate points if it helps.

Good luck.

Venu

0 Kudos

Is this what you are looking for?



report zrich_0001
       no standard page heading.

data: aufk-idat2 type sy-datum  value '20051215',
      caufvd-gltrp type sy-datum value '20051210',
      caufvd-gstrp type sy-datum value '20051207',
      delay% type p decimals 2.

delay% = ( ( aufk-idat2 - caufvd-gltrp )
         / ( caufvd-gltrp - caufvd-gstrp ) ) * 100 .

write:/ delay%.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Josephine,

Use this FM

RP_CALC_DATE_IN_INTERVAL

Best Regards,

Aslam Riaz

Former Member
0 Kudos

Reminder:

Please close this with appropriate points if the problem is sloved.

Thanks.

Venu

Former Member
0 Kudos

Hi,

Use this function module

'RP_CALC_DATE_IN_INTERVAL' Add/subtract years/months/days from a date .

Hope this solves your problem.

Thanks,

Naga