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: 

DATE

Former Member
0 Kudos

what is the process to change the date format,usually the date will be in which format by default

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

by default the date format is...

😧 Date format----


> YYYYMMDD.

the date format is different from country to country.........., the necessity to change the date format based on requirement...

<b>WRITE .... <f> <option>.</b>

WRITE DATE <option>.

Option Function

DD/MM/YY Separators as defined in user’s master record.

MM/DD/YY Separators as defined in user’s master record.

DD/MM/YYYY Separators as defined in user’s master record.

MM/DD/YYYY Separators as defined in user’s master record.

DDMMYY No separators.

MMDDYY No separators.

YYMMDD No separators.

<b>example:</b>

WRITE: sy-datum,

/ sy-datum yymmdd.

output:

27.06.1995

950627

you can also use these function modules to convert date..

CONVERT_DATE_TO_INTERNAL.

CONVERT_DATE_TO_EXTERNAL.

regards,

Ashok Reddy

2 REPLIES 2

Former Member
0 Kudos

hi,

by default the date format is...

😧 Date format----


> YYYYMMDD.

the date format is different from country to country.........., the necessity to change the date format based on requirement...

<b>WRITE .... <f> <option>.</b>

WRITE DATE <option>.

Option Function

DD/MM/YY Separators as defined in user’s master record.

MM/DD/YY Separators as defined in user’s master record.

DD/MM/YYYY Separators as defined in user’s master record.

MM/DD/YYYY Separators as defined in user’s master record.

DDMMYY No separators.

MMDDYY No separators.

YYMMDD No separators.

<b>example:</b>

WRITE: sy-datum,

/ sy-datum yymmdd.

output:

27.06.1995

950627

you can also use these function modules to convert date..

CONVERT_DATE_TO_INTERNAL.

CONVERT_DATE_TO_EXTERNAL.

regards,

Ashok Reddy

Former Member
0 Kudos

please refer to this sample code:

data : date type date.

data : date1 type d.

data: date2 type dats.

date = sy-datum.

date1 = sy-datum.

date2 = sy-datum.

write : date , date1, date2.

output: 20070619 19062007 19.06.2007