2008 Apr 22 4:20 PM
I'm having the following issue:
When I try to use the statements:
WRITE p0002-gbdat TO w_hire-gbdat DD/MM/YYYY.
OR
WRITE p0002-gbdat DD/MM/YYYY to w_hire-gbdat.
I always get a date formatted as MM/DD/YYYY in w_hire-gbdat.
I tried changing my date parameter and the result was still the same.
p0002 is type dats 8 and
w_hire-gbdat is type char 10.
Any thoughts?
I'm having the following issue:
When I try to use the statements:
WRITE p0002-gbdat TO w_hire-gbdat DD/MM/YYYY.
OR
WRITE p0002-gbdat DD/MM/YYYY to w_hire-gbdat.
I always get a date formatted as MM/DD/YYYY in w_hire-gbdat.
I tried changing my date parameter and the result was still the same.
p0002 is type dats 8 and
w_hire-gbdat is type char 10.
Any thoughts?
2008 Apr 22 4:24 PM
Have you tried looking at your settings on your user id ? (Go on the menu path to System ->User profile-> Own data). Under the defaults tab there is a date format setting. Check that that is not set to MM/DD/YYYY.
2008 Apr 22 4:25 PM
parameters: date1(8) type c default sy-datum .
data : dat1(4) type c,
dat2(2) type c,
dat3(2) type c,
out(10) type c .
dat1 = date1+0(4) .
dat2 = date1+4(2).
dat3 = date1+6(2).
concatenate dat3 dat2 dat1 into out separated by '/'.
write:/ out .
regards,
venkat.
2008 Apr 22 4:33 PM
From the documentation
Option
... DD/MM/YYYY
Option
... MM/DD/YYYY
Effect
If f is a date field (type D), the date is output with a 4-character year as specified in the user's master record. Both of these formatting options have the same value.