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 convertion

Former Member
0 Likes
759

Hi ,

i need to change date from 04/05/2009 to 0 4 0 5 2 0 0 9 .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
738

HI..

Use Offsets to pick date month year from your date field and pass to your required field.

eg:

concatenate date0(2) date2(2) date+4(4) INTO varaiable_field9ur field).

Hope this helps.

Praveen

Edited by: praveen parasiya on May 21, 2009 3:15 AM

6 REPLIES 6
Read only

Former Member
0 Likes
739

HI..

Use Offsets to pick date month year from your date field and pass to your required field.

eg:

concatenate date0(2) date2(2) date+4(4) INTO varaiable_field9ur field).

Hope this helps.

Praveen

Edited by: praveen parasiya on May 21, 2009 3:15 AM

Read only

0 Likes
738

can you give example how to do that ?

Read only

0 Likes
738

Hi Check the format of date in ur system.

Try like below.

data d_date type datum.

data output type string.

data sep type c.

d_date = sy-datum.

concatenate d_date0(4) d_date4(2) d_date+6(2) INTO output separated by

sep.

write output.

Praveen

Read only

0 Likes
738

thanx for answer praveen parasiya .point rewarded

Edited by: Dev__D on May 21, 2009 4:11 AM

Read only

Former Member
0 Likes
738

Hi,

You can write the following code:

DATA: lv_date(10) TYPE c,

lv_temp(10) TYPE c.

lv_date = '04/05/2009'.

lv_temp = '/'.

REPLACE ALL OCCURRENCES OF lv_temp IN lv_date WITH ' '.

Hope this may be usefull..

Regards,

Prashant

Read only

Former Member
0 Likes
738

hi,

if your this date 04/05/2009 is string format than you can achieve it as follows

data: olddate type string value '04/05/2009',
        newdate type string.

concatenate oldate0(1) oldate1(1) oldate3(1) oldate4(1) oldate6(1) oldate7(1) oldate8(1) oldate9(1) into newdate separated by space.

hope it helps