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

function module to convert to time stamp format

Former Member
0 Likes
14,179

Hi friends,

can you tell me any function module to convert date and time to time stamp format?

kind regards.

1 ACCEPTED SOLUTION
Read only

raja_thangamani
Active Contributor
0 Likes
6,318

Just use


CONVERT DATE d 
TIME t [DAYLIGHT SAVING TIME dst] 
INTO TIME STAMP tst 
TIME ZONE tz.

look at this example



DATA: 
tstamp type timestamp, 
d TYPE D VALUE '19971224', 

t TYPE T VALUE '235500'. 

SET COUNTRY 'US'. 


CONVERT DATE d TIME t INTO 
TIME STAMP tstamp TIME ZONE 'UTC+12'. 

" tstamp : 19971224115500 
" (12/24/1997 11:55:00) 

CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO 
DATE d TIME t. 

Also look at the blog..

/people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps

Raja T

Message was edited by:

Raja Thangamani

6 REPLIES 6
Read only

raja_thangamani
Active Contributor
0 Likes
6,319

Just use


CONVERT DATE d 
TIME t [DAYLIGHT SAVING TIME dst] 
INTO TIME STAMP tst 
TIME ZONE tz.

look at this example



DATA: 
tstamp type timestamp, 
d TYPE D VALUE '19971224', 

t TYPE T VALUE '235500'. 

SET COUNTRY 'US'. 


CONVERT DATE d TIME t INTO 
TIME STAMP tstamp TIME ZONE 'UTC+12'. 

" tstamp : 19971224115500 
" (12/24/1997 11:55:00) 

CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO 
DATE d TIME t. 

Also look at the blog..

/people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps

Raja T

Message was edited by:

Raja Thangamani

Read only

0 Likes
6,318

hi raja!

thank you for your response.

if i want to convert to eastern standard time, i shud write 'utc-6' instead of utc+12?

regards

Read only

0 Likes
6,318

Look at this link

http://tycho.usno.navy.mil/zones.html

Raja T

Read only

0 Likes
6,318

Hi,

Try these FMs;

LXHME_TIMESTAMP_CONVERT_INTO

ABI_TIMESTAMP_CONVERT_INTO

hope this will help you

Thanks

Shiva

Read only

satykumar
Product and Topic Expert
Product and Topic Expert
0 Likes
6,318

Hi,

Try any one of thease

data x type t value '002900'.

data w type sy-uzeit value '002900'.

write (8) x using edit mask '__:__:__'.

write w.

Thanks,

Satyendra

Read only

kishorekumar_vemula
Active Participant
0 Likes
6,318

you can use this fm

CMS_DATE_TO_TIMESTAMP

regds,

Kish