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 format

Former Member
0 Likes
1,068

Hi all,

i want to change the date format suppose system format is yyyymmdd and i want to convert into mmddyyyy how to acheive this plz help me out.

Thanks & Regards

Ashu Singh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
930

Hi ashu,

1. One way is using offset.

data : dt type sy-datum.

data : newdate type sy-datum.

concatenate dt4(2) dt6(2) dt+0(4)

into newdate.

regards,

amit m.

8 REPLIES 8
Read only

Former Member
0 Likes
930

Hi Ashu,

go thru above link

Regards,

Syf

Edited by: syfulla shaik on Aug 18, 2008 5:01 PM

Read only

Former Member
0 Likes
931

Hi ashu,

1. One way is using offset.

data : dt type sy-datum.

data : newdate type sy-datum.

concatenate dt4(2) dt6(2) dt+0(4)

into newdate.

regards,

amit m.

Read only

Former Member
0 Likes
930

Hi,

Refer this FM : HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format.

Regards,

T.D.M.

Read only

rainer_hbenthal
Active Contributor
0 Likes
930

Always use yyyymmdd as date format. Let the user decide on how the date is shown for him, he can do that via own data. If you need to convert the date due to interface conversion, you can do that using normal char/string manipulating.

Read only

Former Member
0 Likes
930

hi

go to tcode SU01 thr u cah change the formate according to u. if u want user specific. otherwise u can us function module as well.

just go through this link https://www.sdn.sap.com/irj/sdn/forums

thanks

Read only

former_member386202
Active Contributor
0 Likes
930

Hi,

Try these FM

CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL

Regards,

Prashant

Read only

Former Member
0 Likes
930

Hi,

data:
  w_date type sy-datum value '20080818',
  w_date2 type d,
  w_date1 type char8.

  w_date2+0(2) = w_date+4(2).
  w_date2+2(2) = w_date+6(2).
  w_date2+4(4) = w_date+0(4).

  w_date1 = w_date2.
  write w_date1.

Hope it solves your problem.

Thanks,

Phani Diwakar.

Read only

Former Member
0 Likes
930

Hi,

the following is an example to change date formate.

write:

sy-datum mm/dd/yyyy.

where if you write only sy-datum alone then it write in system formate. if we add formating options then the output will be in that formate.

Regards,

Aswini.