Application Development 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: 

change date format from 20060828 to 8/28/2006

Former Member
0 Kudos

Hi all,

can any one tell how to change the date format from 20060828 to 8/28/2006

thanks

kajol

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The w_date should be of the data type D.

Ex..

data w_date type sydatum value '20060828'.

data w_char(10).

write w_date to w_char mm/dd/yyyy.

write: / w_char.

Thanks,

Naren

8 REPLIES 8

Former Member
0 Kudos

Hi

declare date1(10)

write date to date1 using edit mask '- -/- -/----'.

or separate month date year and concatenate

reward if useful

regards

Anji

Former Member
0 Kudos

hi,

Make use of CONVERT_DATE_TO_INTERN_FORMAT FM

or


 write itab-date to itab-date mm/dd/yyyy.

or


concatenate itab-date+4(2) '/' itab-date+6(2) '/'
itab-date+2(2) into itab-date.

Regards,

Santosh

Message was edited by:

Santosh Kumar Patha

Former Member
0 Kudos

do this way...

data: V1(2) type c,

V2(2) type c,

V3(4) type c,

V4(10) type c.

date = 20060828.

V1 = date+4(2).

V2 = date+6(2).

V3 = date+0(4).

concatenate V1 V2 V3 into date separated by '/'.

suresh_datti
Active Contributor
0 Kudos

data w_date(10) value '20060828'.

write w_date to w_date mm/dd/yyyy.

~Suresh

0 Kudos

Hi ,

This thing doesn't work

data w_date(10) type c value '20060828'.

write w_date to w_date mm/dd/yyyy.

is there any FM for this

Thanks

0 Kudos

DATA: v_dat1 TYPE d.

DATA: v_dat2(10).

v_dat1 = '20060828'.

START-OF-SELECTION.

IF v_dat1+4(1) = 0.

v_dat2(1) = v_dat1+5(1).

v_dat2+1(1) = '/'.

v_dat22(2) = v_dat16(2).

v_dat2+4(1) = '/'.

v_dat2+5(4) = v_dat1(4).

ENDIF.

IF v_dat1+4(1) = 1.

v_dat2+6(4) = v_dat1(4).

v_dat2+5(1) = '.'.

v_dat23(2) = v_dat14(2).

v_dat1+2(1) = '.'.

v_dat2(2) = v_dat1+6(2).

ENDIF.

END-OF-SELECTION.

WRITE:/ v_dat1, v_dat2.

Reward points if helpful.

regards,

Aabhas K Vishnoi

Former Member
0 Kudos

Hi,

The w_date should be of the data type D.

Ex..

data w_date type sydatum value '20060828'.

data w_char(10).

write w_date to w_char mm/dd/yyyy.

write: / w_char.

Thanks,

Naren

0 Kudos

Hi all,

I GOT IT RESOLVED USING CONVERSION_EXIT_PDATE_OUTPUT

I AWARDED POINTS TO ALL

tHANKS