2008 Jan 23 11:40 AM
hi all ,
can anybody tell me how can we calculate the difference between dates like in (01.03.2008 - 02.11.2001) or in (22.01.2007 - 03.11.1984) or in ..............
its urgent .
regards saurabh .
hi all ,
can anybody tell me how can we calculate the difference between dates like in (01.03.2008 - 02.11.2001) or in (22.01.2007 - 03.11.1984) or in ..............
its urgent .
regards saurabh .
2008 Jan 23 11:43 AM
Hi,
check this program..
data:date1 type d value '20080204'.
data:date2 type d value '20080208'.
data:days type i.
days = date2 - date1.
write:days.
2008 Jan 23 11:46 AM
Hi,
You can use below FMs to calculate and days and months for given two days.
DAYS_BETWEEN_TWO_DATES "For Days
MONTHS_BETWEEN_TWO_DATES "For months.
Thanks,
Sriram Ponna.
2008 Jan 23 11:47 AM
hi,
use function module 'DAYS_BETWEEN_TWO_DATES'
regards,
Sowmya.
2008 Jan 23 11:54 AM
Hi,,
Saurabh..
here no need of any function modules as sap provides a great ease for programers unlike in other languages no need to calculate no of days etc etc
all this will be taken care by the data type conversion
if u assign data type d to type i then the variable with the type i holds no of days in it
so u can do directly like this
data:
d1 type d value '20080120',
d2 type d value '20080115',
days type i.
days = d1 - d2.
write days.
o/p will be 5.
as the difference days is 5.
plzz reward if it is usefull...
plzz dont forget to rerward........
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |