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 field format MM.DD.YYYY. data element

0 Kudos

I am creating a Z table. The date field should be in the format MM.DD.YYYY. For this format I haven't found any data element.Should I create a Z data element?

5 REPLIES 5

tom_wan
Contributor

Hi kk

You can just use "Built-In Type" DATS if you like.

Also there are many data elements with type DATS, like DATS(same name), but I suggest create your own data elements and use type DATS(Because UPGRADE may change/delete standard objects).

For DATS field, yyyymmdd is stored in database. The display format of DATS is controlled by user master setting and can also be influenced by country specific settings:

Note 2322096 - Change the Decimal Point or Date format for a Country or User

Note 2414334 - Unexpected number format / time format / date format after "WRITE TO" or "WRITE" statement.

Or

Do you mean you need a CHAR field to store MM.DD.YYYY? (I really don't recommend this way)

In this case you'd better create your own data element even there are similar standard ones. (Because UPGRADE may change/delete standard objects)

Regards

Tom

matt
Active Contributor

I really think that creating a CHAR field to store MM.DD.YYYY is a massively bad design choice. About the only scenario I can think of where it might make sense is if the database table is being read directly by some other software that's so badly written it needs a fixed date format.

0 Kudos

matthew.billingham

Thanks for the reminder. Let me add this.

matt
Active Contributor

No. The date field should not be in the format MM.DD.YYYY. It should be in the DATS format.

You convert it from the DATS format only when you output the value - to a file or to the screen. If you do anything else, you will cause yourself difficulties later on. What if you, e.g. you need to send/display the data in a country with a standard format of DD.MM.YYYY or DD/MM/YYYY etc.

raymond_giuseppi
Active Contributor

Why do you have such a requirement, usually in SAP we use a date (DATS) field and its formatting is done in the reports according to the date format of the user profile or the customer or supplier recipient. What is the actual requirement behind this request?