‎2008 Nov 17 2:14 PM
Hi,
I have a time keyfigure which has the format hh:mm:ss, i need to convert this time into hrs, i mean, convert the minutes and seconds into hrs and add them to the "hh" . (For example, if the time is 1:30:20, i have to convert it into 2777 sec). Please let me know if there is any function module which can do this or please provide me the code. I know the logic for converting but i don't know the ABAP statements. Please provide me the code.
‎2008 Nov 17 2:32 PM
Use FM
RSSM_CONVERT_TIMESTAMP2DAYSEC
In your case put the timestamp in the TIME (01:30:20) input parameter
It will return the secs in the SEC output parameter
This will help!!
‎2008 Nov 17 2:18 PM
data: v_time type c length 8 value '10:11:23',
v_secs type i.
v_secs = ( ( v_time(2) * 60 ) + v_time+4(2) ) * 60 + v_time+7(2).matt
‎2008 Nov 17 2:32 PM
Use FM
RSSM_CONVERT_TIMESTAMP2DAYSEC
In your case put the timestamp in the TIME (01:30:20) input parameter
It will return the secs in the SEC output parameter
This will help!!
‎2008 Nov 17 2:50 PM
hi look at this example ......
REPORT ztests .
data: DATE_1 type sy-datum ,
DATE_2 type sy-datum ,
TIME_1 LIKE LTAK-BZEIT,
TIME_2 LIKE LTAK-BZEIT ,
SECONDS TYPE INT4 .
DATE_1 = sy-datum .
DATE_2 = sy-datum .
TIME_1 = '08'.
TIME_2 = '10'.
CALL FUNCTION 'SALP_SM_CALC_TIME_DIFFERENCE'
EXPORTING
DATE_1 = DATE_1
TIME_1 = TIME_1
DATE_2 = DATE_2
TIME_2 = TIME_2
IMPORTING
SECONDS = SECONDS
.
write:/ SECONDS , 'seconds'.