07-22-2008 10:18 AM
i want to subtract two dates and then the answer must divide by 365 ..then i will get the experiance of person in the company ..
But the answer is comming
INTEGER ( WHERE RESULT VARIABLE IS TYPE P DECIMALS 3)
(E.G divide 458 / 365 = 1.000)
&
againg wrong answer (when result variable is type f )
07-22-2008 10:21 AM
hi,
try this
data year type p value '365'.
data answer type p.
answer = 458 / year.
WRITE answer decimals 3.
regards,
Peter
Edited by: Peter Ruiz on Jul 22, 2008 5:23 PM
07-22-2008 10:20 AM
Hi,
DATA: work_exe TYPE p DECIMALS 4,
years TYPE f VALUE '+365',
days TYPE f VALUE '+458'.
work_exe = days / years.
WRITE work_exe.
Regards,
Sandeep
07-22-2008 10:21 AM
hi
use this Fm to calculate the dayes between two dates and then divide it by 365 .
SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours
L_MC_TIME_DIFFERENCE : Find the time difference between two date/time
HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months
once u get the number of days after using any of this FM u only need to divide it by using DIV
Cheers
Snehi
07-22-2008 10:21 AM
07-22-2008 10:21 AM
hi,
try this
data year type p value '365'.
data answer type p.
answer = 458 / year.
WRITE answer decimals 3.
regards,
Peter
Edited by: Peter Ruiz on Jul 22, 2008 5:23 PM
07-22-2008 10:26 AM
Friend the same thing i am doing ........ but answer comming is 1.000......
so first you execute it and then see wats answer is ....
07-22-2008 10:30 AM
Hi,
I have written the code like this
DATA: v_temp TYPE P DECIMALS 3.
v_temp = 458 / 365.
write v_temp.
and the answer commins is- 1.255.
Regards,
Rajesh Akarte
07-22-2008 10:21 AM
Hi,
declare variable with type float or packed.
data:
result type p decimals 3.
result = 458 / 365.
WRITE result.
regards
Adil
07-22-2008 10:25 AM
Hi ,
can u use FMs like this
FIMA_DAYS_AND_MONTHS_AND_YEARS
or
HR_SGPBS_YRS_MTHS_DAYS
regards
Prabhu
07-22-2008 10:28 AM