‎2008 Aug 18 12:25 PM
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
‎2008 Aug 18 12:29 PM
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.
‎2008 Aug 18 12:29 PM
‎2008 Aug 18 12:29 PM
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.
‎2008 Aug 18 12:30 PM
Hi,
Refer this FM : HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format.
Regards,
T.D.M.
‎2008 Aug 18 12:30 PM
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.
‎2008 Aug 18 12:30 PM
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
‎2008 Aug 18 12:36 PM
Hi,
Try these FM
CONVERT_DATE_TO_EXTERNAL
CONVERT_DATE_TO_INTERNAL
Regards,
Prashant
‎2008 Aug 18 12:37 PM
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.
‎2008 Aug 18 12:47 PM
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.