Show TOC

Formatting Date Fields: SET DATE MASKLocate this document in the navigation structure

Use

To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed with the specified formatting.

/: SET DATE MASK = 'date mask'

In the date mask, you can use the following codes:

  • DD: day (two digits)

  • DDD: day name (abbreviated)

  • DDDD: day name (written out in full)

  • MM: month (two digits)

  • MMM: month name (abbreviated)

  • MMMM: month name (written out in full)

  • YY: year (two digits)

  • YYYY: year (four digits)

  • LD: day (formatted as for the L option)

  • LM: month (formatted as for the L option)

  • LY: year (formatted as for the L option)

Any other characters occurring in the mask are interpreted as simple text and are copied directly to the output.

Example

Assuming a current system date of March 1, 1996.

/: SET DATE MASK = 'Foster City, MM.DD.YY'

&DATE& -> Foster City, March 1, 1996

/: SET DATE MASK = 'MMMM DD, YYYY'

&DATE& -> March 1, 1996

The date mask may be reset to the default setting by using an empty string:

/: SET DATE MASK = ' '

The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:

  • %%SAPSCRIPT_DDD_dd: abbreviated day name

  • %%SAPSCRIPT_DDDD_dd: full form of day name

  • %%SAPSCRIPT_MMM_mm: abbreviated month name

  • %%SAPSCRIPT_MMMM_mm: full form of month name

    dd: day number 01 = Monday, ..., 07 = Sunday

    mm: month number 01 = January, ..., 12 = December