Hi,
Use FM: RP_CALC_DATE_IN_INTERVAL.
Ric,
Try this Function Module RP_CALC_DATE_IN_INTERNAL
K.Kiran.
use function module
HR_HK_DIFF_BT_2_DATES
give output format = 03 and get the value in days.
code is as below :
data : DATE1 type P0001-BEGDA,
DATE2 type P0001-BEGDA,
YEARS type P0347-SCRYY,
MONTHS type P0347-SCRMM,
DAYS type P0347-SCRDD.
date1 = '20070331'.
date2 = '20070101'.
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
EXPORTING
DATE1 = date1
DATE2 = date2
OUTPUT_FORMAT = '03'
IMPORTING
YEARS = years
MONTHS = months
DAYS = days
EXCEPTIONS
INVALID_DATES_SPECIFIED = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
write : days.
regards,
sandeep Kaushik
Hi,
Data:Input type sy-datum value '20071205'.
Data:output type sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = input
DAYS = '7'
MONTHS = '0'
SIGNUM = '+'
YEARS = '0'
IMPORTING
CALC_DATE = output.
write:/ output.
Hi,
If You want the Difference between dates..
Check this... Program
Data:Date1 type sy-datum value '20071205'.
Data:Date2 type sy-datum value '20071215'.
Data:output type i.
Output = date2 - date1.
write:/ output.
Add a comment