Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TimeStamp conversion

prasad_reddy9
Explorer
0 Likes
2,894

I am convertind date and time into timestamp and I am getting the timestamp as following 19,991,101,143,146.

I want the timestamp in yyyy-mm-dd hh:mm:ss format.

Help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,090

Hi,

you can use the function module MA_CNV_TIMESTAMP_IN_GMTTSTAMP

Thanks.

3 REPLIES 3
Read only

Former Member
0 Likes
1,091

Hi,

you can use the function module MA_CNV_TIMESTAMP_IN_GMTTSTAMP

Thanks.

Read only

Clemenss
Active Contributor
0 Likes
1,090

Hi Prasad,

19,991,101,143,146 looks like a SAP standard timestamp. It could be recognized in various locations/Modules of various SAP systems around the universe.

If you want a human-readable timestamp like yyyy-mm-dd hh:mm:ss you can define it as a string or char field lenght 18. Use a simple statement to get this:


concatenate 
  date(2) '-'
  date+4(2) '-'
  date+6(2) ` `
  time(2) ':'
  time+2(2) ':'
  timr+4(2) 
  into timestamp

date is a field of type sy-datum, time is type sy-uzeit. The space between date and time is encloded in back quotes: ` not '.

Regards,

Clemens

Read only

Former Member
0 Likes
1,090

Hi,

date = timestamp+0(8)

time = timestamp+8(6).

else try this way

convert time stamp wa_rseqdone_ts

time zone sy-zonlo

into date wa_ts_date

time wa_ts_time.

check this link for full details

http://www.bwexpertonline.com/downloads/DBConnectMakingDELTAABAPCode.doc

Regards,

Sudheer