1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
FORM get_tmst_from_date USING date CHANGING tstmp TYPE loy_ma_timestamp. DATA lv_int_date TYPE sy-datlo. DATA lv_int_time TYPE sy-timlo. SPLIT date AT space INTO DATA(lv_date) DATA(lv_time) . CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL' EXPORTING date_external = lv_date IMPORTING date_internal = lv_int_date EXCEPTIONS date_external_is_invalid = 1 error_message = 2 OTHERS = 3. IF sy-subrc <> 0. RETURN. ENDIF. DATA: l_hours(2) TYPE n, l_minuts(2) TYPE n. SPLIT lv_time AT ':' INTO l_hours l_minuts. lv_int_time = |{ l_hours ALPHA = IN }{ l_minuts ALPHA = IN }00|. tstmp = |{ lv_int_date }{ lv_int_time }|. ENDFORM. |