Show TOC

Date MaskLocate this document in the navigation structure

Definition

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

/: SET DATE MASK = 'date mask'

The following templates may be used in the date mask:

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, 1994.

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

&DATE& -> Foster City, 03.01.94

&DATE(Z)& -> Foster City, 3.1.94

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

&DATE& -> March 1, 1994

You can revert to the standard setting by using the SET DATE MASK command again with an empty string in place of the date mask:

/: SET DATE MASK = ' '