09-13-2021 10:09 PM
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?
09-14-2021 1:55 AM
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
09-14-2021 5:55 AM
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.
09-14-2021 5:58 AM
09-14-2021 5:53 AM
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.
09-14-2021 8:24 AM
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?