如:2008.02.03 -> 20080203
REPORT z_barry_test_date_format .
DATA: dat TYPE erdat,
str(10) TYPE c,
df .
dat = '20070803'.
WRITE dat TO str .
SELECT SINGLE datfm INTO df FROM usr01 WHERE bname = sy-uname.
CALL FUNCTION 'DATE_STRING_CONVERT'
EXPORTING
date_format = df
date_string = str
IMPORTING
result_date = dat.
WRITE dat .
阅读(4605) | 评论(0) | 转发(0) |