I'd like to format a time (SY-TIMLO) to the user defined format in SU01. For US users, this often involves AM/PM. The easiest way I've found is:
lv_formatted_time = |{ lv_time TIME = USER }|
Is there an easy way to remove the seconds without the use of more extensive methods like the one below?
*-- Convert time to user time format based on environment setting.
*-- As we are not using SET COUNTRY this has the same effect as
*-- user settings in SU01 > Defaults > Time Format. US users will see AM/PM.
CALL METHOD CL_ABAP_TIMEFM=>CONV_TIME_INT_TO_EXT
EXPORTING
TIME_INT = lv_time
WITHOUT_SECONDS = ABAP_TRUE
FORMAT_ACCORDING_TO = CL_ABAP_TIMEFM=>ENVIRONMENT
IMPORTING
TIME_EXT = lv_formatted_time.