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

WRITE MM/DD/YYYY not working

Former Member
0 Likes
1,489

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?

3 REPLIES 3
Read only

Former Member
0 Likes
905

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.

Read only

Former Member
0 Likes
905

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.

Read only

Former Member
0 Likes
905

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.