01-30-2008 6:53 PM
Hello All:
I have a ABAP program that creates an XML file and everything is fine. I just need one date field in XML to conform to W3CC standard (EX: 2006-12-01T10:53:05.2170000). I need datetime in the format "2006-12-01T10:53:05.2170000". How do I acheive this in ABAP?
Thanks.
Mithun
01-30-2008 8:23 PM
That seems to be easy:
DATA:
lv_timestamp TYPE timestampl,
lv_xml_date TYPE string.
GET TIME STAMP FIELD lv_timestamp.
CONCATENATE lv_timestamp+0(4)
lv_timestamp+4(2)
lv_timestamp+6(2)
INTO lv_xml_date
SEPARATED BY '-'.
CONCATENATE lv_xml_date
'T'
INTO lv_xml_date.
CONCATENATE lv_timestamp+8(2)
lv_timestamp+10(2)
lv_timestamp+12(2)
INTO lv_xml_date+12(8)
SEPARATED by ':'.
CONCATENATE lv_xml_date
lv_timestamp+5(7)
INTO lv_timestamp
SEPARATED BY '.'.
Reward points, if reply is applicable
Edited by: Mike Schernbeck on Jan 30, 2008 9:24 PM
01-30-2008 8:23 PM
That seems to be easy:
DATA:
lv_timestamp TYPE timestampl,
lv_xml_date TYPE string.
GET TIME STAMP FIELD lv_timestamp.
CONCATENATE lv_timestamp+0(4)
lv_timestamp+4(2)
lv_timestamp+6(2)
INTO lv_xml_date
SEPARATED BY '-'.
CONCATENATE lv_xml_date
'T'
INTO lv_xml_date.
CONCATENATE lv_timestamp+8(2)
lv_timestamp+10(2)
lv_timestamp+12(2)
INTO lv_xml_date+12(8)
SEPARATED by ':'.
CONCATENATE lv_xml_date
lv_timestamp+5(7)
INTO lv_timestamp
SEPARATED BY '.'.
Reward points, if reply is applicable
Edited by: Mike Schernbeck on Jan 30, 2008 9:24 PM
01-30-2008 8:53 PM
Thanks Mike. I rewarded full points. One more question. Is there a FM to get Greenwich standard time applicable to your time zone?
Thanks.
Mithun
01-31-2008 7:18 AM
Perhaps, one of these fits your need:
MA_CNV_TIMESTAMP_IN_GMTTSTAMP
MA_CNV_TSTAMP_IN_GMTDATETIME