2006 Aug 10 11:56 AM
Hi Experts,
when i enter starting date, starting time and ending date, ending time. I need to get the total duration in hours.
Is there any function module to resolve these issue or please provide me the logic.
Thanks and regards.
vijay
Hi Experts,
when i enter starting date, starting time and ending date, ending time. I need to get the total duration in hours.
Is there any function module to resolve these issue or please provide me the logic.
Thanks and regards.
vijay
2006 Aug 10 12:03 PM
Hello,
Use FM : DELTA_TIME_DAY_HOUR
Pass:
T1 - start time
T2 end time
D1 start date
D2 start time
It give you the minutes. Devide it by 60 so, you get the hours.
regards,
Naimesh
2006 Aug 10 12:05 PM
you can use
SD_DATETIME_DIFFERENCE
data : date1 type sy-datum,
date2 type sy-datum,
time1 type sy-uzeit,
time2 type sy-uzeit,
v_datediff type p,
v_timediff type p.
date1 = '20060101'.
date2 = sy-datum.
time1 = '010101'.
time2 = sy-uzeit.
CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
EXPORTING
DATE1 = DATE1
TIME1 = TIME1
DATE2 = DATE2
TIME2 = TIME2
IMPORTING
DATEDIFF = v_DATEDIFF
TIMEDIFF = v_TIMEDIFF
* EARLIEST = EARLIEST
EXCEPTIONS
INVALID_DATETIME = 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.regards
srikanth
added program
Message was edited by: Srikanth Kidambi
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |