‎2005 Sep 19 4:12 PM
Hi Friends,
please help me to convert seconds into date & time, if any FM available in SAP?
Cheers,
Thayalan
‎2005 Sep 19 8:40 PM
If you want to convert some number of seconds into the number of days, hours, minutes and seconds:
REPORT ztest LINE-SIZE 250.
DATA: seconds TYPE i VALUE 180001,
days TYPE i,
dur_ti LIKE sy-uzeit.
days = seconds DIV 86400. "Seconds per day
seconds = seconds MOD 86400.
dur_ti = seconds.
WRITE : /001 days, dur_ti.It doesn't make sense to convert the number of days into years, months and days because both months and years can have different number of days.
Rob
‎2005 Sep 19 4:28 PM
I guess you are trying to convert time stamp.
Try IB_CONVERT_FROM_TIMESTAMP .
‎2005 Sep 19 4:37 PM
I am not sure how you can? You need some date and time plus seconds to calculate the resultant date and time.
If I give 3600 seconds as input and ask for the date and time, how can it be calculated without a reference date and time? I just know that it is 1 hour, but I cannot give it a date time stamp.
Can you please restate your requirement?
regards,
Srinivas
‎2005 Sep 19 8:40 PM
If you want to convert some number of seconds into the number of days, hours, minutes and seconds:
REPORT ztest LINE-SIZE 250.
DATA: seconds TYPE i VALUE 180001,
days TYPE i,
dur_ti LIKE sy-uzeit.
days = seconds DIV 86400. "Seconds per day
seconds = seconds MOD 86400.
dur_ti = seconds.
WRITE : /001 days, dur_ti.It doesn't make sense to convert the number of days into years, months and days because both months and years can have different number of days.
Rob
‎2005 Sep 20 9:24 AM
Hi Rob,
It was helpful answer for me,But I've solved the problem by using calling some UNIX rountines.
Thanks.
‎2005 Sep 20 10:18 AM
can you share the UNIX routine here
Thanks in advance.
Regards
Raja