Get Example source ABAP code based on a different SAP table
Date Formats The date format is determined by column DATFM> in the database table T005X>>, where mm>, dd>, and yyyy> stand for day, month, and year. The following country-specific formats are available: <(>DATFM<)>>Date Format> 1>dd.mm.yyyy> 2>mm/dd/yyyy> 3>mm-dd-yyyy> 4>yyyy.mm.dd> 5>yyyy/mm/dd> 6>yyyy-mm-dd> 7>ggyy.mm.dd>, Japanese date 8>ggyy/mm/dd>, Japanese date 9>ggyy-mm-dd>, Japanese date A>yyyy/mm/dd>, Islamic date 1 B>yyyy/mm/dd>, Islamic date 2 C>yyyy/mm/dd>, Iranian date
In the Japanese formats for the values 7>, 8>, and 9>, the first two characters gg> of a four-digit year are formatted as a Japanese Unicode character for the current Japanese Emperor. The last two characters yy> signify the year of his reign.
In the Islamic formats for the values A> and B>, the date is formatted according to the Islamic moon calendar, which calculates time since <(>16th<)> July 622, which is the date on which Mohammed left Mecca (Hijra). Since this calculation can be different in different Islamic countries, two formats are offered, each of which can be set individually. The corresponding settings are in the database table TISLCAL>, and can be changed using the program I18N_MAINTAIN_TISLCAL>>.
The Iranian format for value C> is based on an Islamic sun calendar, which calculates the time in sun years since the Hijra. The setting for the date format also affects the formatting of time stamps in time stamp fields>.
Latest notes:
The class CL_ABAP_DATFM>> contains helper methods for dealing with date formats.
The values for DATFM> are defined by the fixed values of domain XUDATFM>>. ABAP_HINT_END
Example ABAP Coding
Output of a date and time stamps with different date formats. ABEXA 00989 ABAP_EXAMPLE_END
ABAP_EXAMPLES_ABEXA
String Templates, Date Formats>
String Templates, Time Stamp Templates> ABAP_EXAMPLE_END