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

time stamp

Former Member
0 Likes
930

Hi all,

I have timestamp format like this '20070522064742'

but i need this like '22.05.2007 12:17:42'

Regards,

Suresh

8 REPLIES 8
Read only

Former Member
0 Likes
902

Hi,

First you can split it into different fields, then concatenate all the required fields into your required format.

Regards,

Bujji

Read only

Former Member
0 Likes
902

Use 'CONVERSION_EXIT_TSABI_OUTPUT' to get the

desired result.

Regards,

Michael

Read only

Former Member
0 Likes
902

data : v_date like sy-datum,

v_date1(10).

data : v_time like sy-uzeit,

v_time(8).

data : v_stamp(14) value '20070522064742'.

v_date = v_stamp+0(8).

v_time = v_stamp+8(6).

write v_date to v_date1.

write v_time to v_time1.

concatenate v_date1 v_time1 into v_result separated by space.

Read only

Former Member
0 Likes
902

hi,

do this way ...

do this way ...


data : v_string(15) value '20070522064742',
         v_out(20).

concatenate v_string+6(2) '.' v_string+4(2) '.'  v_string+0(4) ' ' v_string+8(2) ':'  v_string+10(2) ':'  v_string+12(2) into v_out.

write : v_out.

Regards,

Santosh

Read only

Former Member
0 Likes
902

Hi,

You can use the following function to get the date and time from time stamp

ABI_TIMESTAMP_CONVERT_FROM

after getting the value, you can use translate for using dot insted of '/'.

Please award points if you find the answer useful.

Read only

0 Likes
902

Hi ,

if i do anyof those i am getting wrong time stamp.

Please see my qusetion again.

For the time stamp 20070522064742 the date and time are

22.05.2007 12:17:42.

please guide me.

Read only

0 Likes
902

The problem is resolved.

I am using FM IB_CONVERT_FROM_TIMESTAMP for the same

Thanks to all.

Read only

Former Member
0 Likes
902

If you use conversion exit (function module) 'CONVERSION_EXIT_TSABI_OUTPUT' it expects the timestamp that you pass in to be in UTC. It will then convert the timestamp from UTC into the users local timezone and displays it as you want it. In case the timestamp you have is not in UTC, you have to convert it into UTC first.

Look at the ABAP documentation for the CONVERT statement.

Hope that explains it,

Michael