Get Example source ABAP code based on a different SAP table
ABAP_DDIC - Date Fields, Time Fields, and Time Stamp Fields The following data types in ABAP Dictionary describe date fields, time fields, and time stamp fields: ITOC
Date Types, Time Types, and Time Stamp Types The following built-in data types in ABAP Dictionary represent real date types, time types, and time stamp types in a database:
DATN>> for date fields in the database.
TIMN>> for time fields in the database.
UTCLONG>> for time stamp fields in the database. Database fields with these types generally contain only valid values for dates, times, and time stamps in the internal representation of the database. These types are currently only supported by SAP HANA databases>.
Latest notes:
The dictionary types DATN> and TIMN> are mapped to the character-like ABAP date type and time type d>> or t>>. The built-in ABAP type utclong>>, on the other hand, provides a real time stamp type for UTCLONG>.
The types DATN> and TIMN> are recommended for saving individual dates and times. Access to dates and times in the corresponding functions and expressions is optimized for these types. In the case of the dictionary types DATS> and TIMS> , such access may not be possible at all or they may need to be converted to real date and time types. NON_V5_HINTS
The output formats for fields on dynpros and Web dynpros and in the statements WRITE>> or WRITE TO>> can be predefined for the types DATN>, TIMN >, and UTCLONG> specific to each user in the user master record>. The output length required for formatted output is usually greater than the number of places in ABAP Dictionary. ABAP_HINT_END
Character-Like Date Fields and Time Fields Instances of the following data types in ABAP Dictionary are created on the database using character-like fields:
DATS>> for date fields> From a technical perspective, the built-in data type DATS> describes objects of the type CHAR> with a length of 8 characters. It is intended to be used for a calendar date> with the format YYYYMMDD>. However, there is no validity check when writing to or reading from database fields of this type. BEGIN_SECTION VERSION 5 OUT Automatic checks are only made for dynpro fields typed with reference to DATS>. In ABAP, DATS> is assigned to the special type d>> and the associated rules apply. END_SECTION VERSION 5 OUT
TIMS>> for time fields> From a technical perspective, the built-in data type TIMS> describes objects of the type CHAR> with a length of 6 characters. It is intended to be used for a time> with the format HHMMSS>. However, there is no validity check when writing to or reading from database fields of this type. BEGIN_SECTION VERSION 5 OUT Automatic checks are only made for dynpro fields typed with reference to TIMS>. In ABAP, TIMS> is assigned to the special type t>> and the associated rules apply. END_SECTION VERSION 5 OUT
ACCP>> for posting periods From a technical perspective, the built-in data type ACCP> describes objects of the type CHAR> with a length of 6 characters. It is intended to be used for a posting period with the format YYYYMM>. This is not checked however when writing to or reading from database fields of this type. BEGIN_SECTION VERSION 5 OUT Automatic checks are only made for dynpro fields typed with reference to ACCP>. END_SECTION VERSION 5 OUT
Latest notes:
If possible, the types DATN> and TIMN> should be used. NON_V5_HINTS
The output formats for fields on dynpros and Web Dynpros and in the statements WRITE>> or WRITE TO>> can be predefined for the types DATS> and TIMS> specific to each user in the user master record>. The output length required for formatted output is usually greater than the number of places in ABAP Dictionary. If the output length is too short, any formatting characters are suppressed.
When a dynpro field> is represented with reference to the type ACCP> (but not in the statements WRITE>> or WRITE TO>> ) and there is enough output length, a point is inserted between the year YYYY> and the month MM>. ABAP_HINT_END