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

convert date format in to / /

Former Member
0 Likes
1,550

currently my date format is 02122007 . i want to change that to 02/12/2007

regards

shankar

13 REPLIES 13
Read only

Former Member
0 Likes
1,520

use edit mask.

write time USING EDIT MASK '____/__/__'.

or use concatenate.

regds,

kiran

Read only

Former Member
0 Likes
1,520
data : v_date like sy-datum value '02122007',
         v_date1(10).

concatenate v_date+0(2) v_date+2(2) v_date+4(4) into v_date1 separated by '/'.
Read only

Former Member
0 Likes
1,520

Hi,

u can change this date format by using offset values,

Example:x = 02122007

d = x+0(2)

m = x+2(2)

y = x+4(4)

concatenate d m y into l_date sepearated by '/'.

now ur l_date consist of l_date = 02/12/2007.

Let me know if u have any doubts.

Regards,

Sreedhar

Read only

satykumar
Product and Topic Expert
Product and Topic Expert
0 Likes
1,520

Hi,

Try this

data y type d value '20071202'.

write (10) y using edit mask '__/__/____'.

write y.

Regards,

Satyendra

Read only

Former Member
0 Likes
1,520

HI,

DATA: month(2),

year(4),

date(2).

data: max_date type c.

move: date_field+0(2) = date.

move: date_field+2(4) = Month.

move: date_field+4(4) = year.

concatinate date month year into max_date separeted by '/'.

Read only

Former Member
0 Likes
1,520

Hi Shankar,

you can <b>concatenate seprated by ' / '</b> .

ex.

<b>concatenate i_date0(2) i_date2(2) i_date+4(4) into i_date1 separated by '/'.</b>

please reward if useful.

Read only

Former Member
0 Likes
1,520

check this.

data : date like sy-datum.
date = sy-datum.
write:/ date using edit mask '__/__/____'.

regards,

vijay

Read only

Former Member
0 Likes
1,520

Hi

data : f1 like sy-datum.

f1 = sy-datum.

write:/ f1 using edit mask '__/__/____'.

Reward points.

Regards

Chandrika.

Read only

Former Member
0 Likes
1,520

Hi Shankar,

data z(10) type c value '10082006'.

write /(10) z using edit mask '__/__/____'.

output will be 10/08/2006.

If you declare the variable as type sy-datum, u will get the output as 08/10/2006.

mark all helpful answers

Read only

Former Member
0 Likes
1,520

data: d_date(10).

parameters d_datum like sy-datum default sy-datum.

d_date0(2) = d_datum6(2).

d_date+2(1) = '/'.

d_date3(2) = d_datum4(2).

d_date+5(1) = '/'.

d_date6(4) = d_datum0(4).

write: d_date.

Read only

Former Member
0 Likes
1,520

Hi Shankar ,

I hope solves ur problem if problem is solved then

reward points and close the thraed.

Read only

Former Member
0 Likes
1,520

Hi,

use write (10) y using edit mask '__/__/____'.

i hope it solves ur prob.

Read only

Former Member
0 Likes
1,520

try with this if u wish

REPORT ZEXAMPLE.

DATA: V_DATE LIKE SY-DATUM,

V_DATE2(10).

CALL FUNCTION 'CONVERT_DATE_INPUT'

EXPORTING

INPUT = '21102002' "DD.MM.YYYY

PLAUSIBILITY_CHECK = 'X'

IMPORTING

OUTPUT = V_DATE "YYYY.MM.DD

EXCEPTIONS

PLAUSIBILITY_CHECK_FAILED = 1

WRONG_FORMAT_IN_INPUT = 2

OTHERS = 3.

V_DATE2 = V_DATE.

WRITE:/ V_DATE2.

rewards if helpful