‎2009 Feb 06 9:25 AM
Hello Friends,
How to convert the time 13 to 1 PM OR 8 to 8 AM.
Do we have any FM to convert the time like above example.
Thank you,
Shreekant
‎2009 Feb 06 9:33 AM
Hi Shreekant,
Try the FM: HRVE_CONVERT_TIME
TYPE_TIME A ( Use 'B' for the other format)
INPUT_TIME 13:00:00
INPUT_AM_PM AM
Export parameters Value
OUTPUT_TIME 01:00:00
OUTPUT_AM_PM PM
Regards,
Nitin.
‎2009 Feb 06 9:33 AM
Hi Shreekant,
Try the FM: HRVE_CONVERT_TIME
TYPE_TIME A ( Use 'B' for the other format)
INPUT_TIME 13:00:00
INPUT_AM_PM AM
Export parameters Value
OUTPUT_TIME 01:00:00
OUTPUT_AM_PM PM
Regards,
Nitin.
‎2009 Feb 06 9:35 AM
Hi,
Hi Use this FM
HRVE_CONVERT_TIME
in that you need to specify
TYPE_TIME 'A'
INPUT TIME
INPUT_AM_PM 'AM' or 'PM'
-
TYPE_TIME A
INPUT_TIME 13:00:00
INPUT_AM_PM AM
Export parameters Value
OUTPUT_TIME 01:00:00
OUTPUT_AM_PM PM
Regards,
Omkaram.
‎2009 Feb 06 9:38 AM
Hi,
try this
CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'
EXPORTING
i_datlo = sy-datum
i_timlo = sy-uzeit
I_TZONE = 'INDIA'
IMPORTING
E_TIMESTAMP = timestamp.
Thanks
Arun
‎2009 Feb 06 9:38 AM
Hi
Go with the following code
Data: w_a type t,
w_b(2) type c,
w_c type i.
w_b = w_a(2).
w_c = w_b.
if w_b GE 12.
w_a(2) = w_b - 12.
write: w_b ,'PM '.
else.
write: w_b, 'AM'.
endif.
Use of Function module might reduce the performance as it loads the whole function group in same internal session.
Thanks
Viquar Iqbal
Edited by: Viquar Iqbal on Feb 6, 2009 10:39 AM
‎2009 Feb 06 9:44 AM
hi,
you can use this instead of function:
if w_date gt 12.
w_date2 = w_date - 12.
w_type = 'PM'.
else
w_date2 = w_date.
w_type = 'AM'.
endif.
regards,
Mon Magallanes
‎2009 Feb 06 9:47 AM
Hi,
parameters: w_time type sy-uzeit.
if w_time+0(2) > 12.
w_time+0(2) = w_time+0(2) - 12.
write: w_time,'PM'.
else.
write: w_time,'AM'.
endif.
This will resolve the issue.
Using function module willl degrade performance.
Regards,
Gurpreet.
‎2009 Feb 06 9:50 AM