‎2007 Jul 19 1:23 PM
Dear experts,
I need two date functions one for difference of date A and Date B which should return DATE
and another difference of date A and Date B which should return DAY
Can anyone pls give solution for this
Regards
karhitk
‎2007 Jul 19 1:24 PM
‎2007 Jul 19 1:25 PM
Hi,
Use SD_DATETIME_DIFFERENCE
and..
DAYS_BETWEEN_TWO_DATES
<b>Reward points</b>
Regarsd
‎2007 Jul 19 1:25 PM
‎2007 Jul 19 1:26 PM
HI,
u can write
data:days type i.
parameters:date2 type sy-datum,
date1 type sy-datum.
days = date2 - date1.
write:/ days.
rgds,
bharat.
‎2007 Jul 19 1:26 PM
‎2007 Jul 19 1:26 PM
‎2007 Jul 19 1:27 PM
date3 = date1 - date2. tghis will give u the days.
or else
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = p_lv_start_date
I_KEY_DAY_FROM =
i_date_to = p_lv_date1
I_KEY_DAY_TO =
I_FLG_SEPARATE = ' '
importing
<b>* E_DAYS = p_day</b>
e_months = p_lv_month_diff
E_YEARS =
.
‎2007 Jul 19 1:27 PM
Hi,
Check out,
HR_HK_DIFF_BT_2_DATES
C14B_DIFF_BT_2_DATES
FIMA_DAYS_BETWEEN_TWO_DATES
FIMA_DAYS_BETWEEN_TWO_DATES_2
FIMA_LEAP_DAYS_BETWEEN_2_DATES
I think this would help,
<b>
Pls reward points if this helps,</b>
Kiran
‎2007 Jul 19 1:28 PM
Hi Karthik,
use FM :
DATE_COMPUTE_DAY Returns a number indicating what day of the week the date falls on. Monday is returned as a 1, Tuesday as 2, etc.
DATE_GET_WEEK will return the week that a date is in.
DATE_IN_FUTURE Calculate a date N days in the future.
DAY_ATTRIBUTES_GET Return useful information about a day. Will tell you the day of the week as a word (Tuesday), the day of the week (2 would be Tuedsay), whether the day is a holiday.
Find the difference between two days in days, months and years
*
* Type in two date and find the difference between the two dates in
* days, months and years.
*
* Written by : SAP Basis, ABAP Programming and Other IMG Stuff
* http://www.sap-img.com
*
REPORT ZDATEDIFF.
DATA: EDAYS LIKE VTBBEWE-ATAGE,
EMONTHS LIKE VTBBEWE-ATAGE,
EYEARS LIKE VTBBEWE-ATAGE.
PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,
TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.
call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
exporting
i_date_from = FROMDATE
i_date_to = TODATE
* I_FLG_SEPARATE = ' '
IMPORTING
E_DAYS = EDAYS
E_MONTHS = EMONTHS
E_YEARS = EYEARS.
WRITE:/ 'Difference in Days ', EDAYS.
WRITE:/ 'Difference in Months ', EMONTHS.
WRITE:/ 'Difference in Years ', EYEARS.
INITIALIZATION.
FROMDATE = SY-DATUM - 60.
Reward pts if found usefull : )
Regards
Sathish