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

DATE & TIME

sivakrishna_boddapati
Participant
0 Likes
692

hI experts

i have one field created_at it contains data '20091005221011' i want to split that data into two parts like 20091005 and '2210111'

how?

1 ACCEPTED SOLUTION
Read only

GauthamV
Active Contributor
0 Likes
645

Use proper subject line in future.

Just split them like this into 2 variables.

Date = created_at +0(8).

Time = created_at +8(6).


Total Posts:  16  
Total Questions:  8 (8 unresolved)  

Note: Plz close your threads once they are resolved.

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
646

Use proper subject line in future.

Just split them like this into 2 variables.

Date = created_at +0(8).

Time = created_at +8(6).


Total Posts:  16  
Total Questions:  8 (8 unresolved)  

Note: Plz close your threads once they are resolved.

Read only

Former Member
0 Likes
645

Hi Siva,

Have a look at the following statement,

CONVERT TIME STAMP tst

TIME ZONE tz

INTO DATE d

TIME t DAYLIGHT SAVING TIME dst.

For more infor, read the below blog ...

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

Also have a look at this FM

'CIF_GEN_CONVERT_TIMESTAMP'.

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
645

Hi,

V_datetime = '20091005221011' .

vdate = v_datetime+0(8).

vtime = v_datetime+9(7).

Try this, this will solve ur problem

Rani.

Read only

venkat_o
Active Contributor
0 Likes
645

Hello, Try this way.


report ztest.
data:
      date_time type c LENGTH 14 VALUE '20091005221011',
      date      TYPE sy-datum,
      time      TYPE sy-uzeit.

date = date_time+0(8).
time = date_time+8(6).

WRITE date.
WRITE:/ time.
Thanks Venkat.O

Read only

Former Member
0 Likes
645

Hi,

You can simply use offset method to split it as date will always contain 8 characters and further will be date.

Thanks,

Archana

Read only

sivakrishna_boddapati
Participant
0 Likes
645

thank u