‎2008 Dec 18 5:58 AM
I will give 2 dates in input. For example 01.01.1973 and 01.09.1974
I need output as 1.8
above 1.8 is (1 year 8 months) for ur understanding...
Friends...need ur help...
--
Raj
‎2008 Dec 18 6:00 AM
‎2008 Dec 18 6:00 AM
‎2008 Dec 18 6:04 AM
Hi Rajkamal,
See the following code.
REPORT abc.
DATA : d2 TYPE sy-datum.
DATA : days LIKE p0347-scrdd.
PARAMETERS : d1 TYPE sy-datum.
CONCATENATE d1(4) '0101' INTO d2.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
date1 = d1
date2 = d2
output_format = '02'
IMPORTING
YEARS =
MONTHS =
days = days
EXCEPTIONS
invalid_dates_specified = 1
OTHERS = 2.
WRITE 😕 days.
U CAN USE THIS FUNCTION MODULE ALSO *FIMA_DAYS_AND_MONTHS_AND_YEARS
*
Regards,
Flavya
‎2008 Dec 18 6:05 AM
hi
try this Fm...
CALL FUNCTION 'HR_SGPBS_YRS_MTHS_DAYS'
EXPORTING
beg_da = p_begda
end_da = p_stat_date
IMPORTING
NO_DAY =
NO_MONTH =
NO_YEAR =
no_cal_day = p_no_day
EXCEPTIONS
dateint_error = 1
OTHERS = 2
.
‎2008 Dec 18 6:07 AM
Hi,
check out the following code. It will work.
Data: yr type n,
Month(2) type n.
Diff = date2 u2013 date1.
Yr = diff / 365.
Diff = diff u2013 yr * 365.
Month = diff / 30.
Concatenate yr u2018.u2019 Month to output_string.
thanks,
Kirti.
‎2008 Dec 18 6:12 AM
Hi,
Check the FM: 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
Regards,
Bhaskar
‎2008 Dec 18 6:15 AM
use this FM
FIMA_DAYS_AND_MONTHS_AND_YEARS
u'll get years months and days in seperate variables then u can convert them into ur required format by little application of logic
‎2008 Dec 18 6:20 AM
Hi,
Use the function module 'HR_HK_DIFF_BT_2_DATES'.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
‎2008 Dec 18 9:39 AM
‎2008 Dec 18 9:42 AM