cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Date format.

senthil_kumar29
Participant
0 Kudos

Hi,

I would like to change date format to DD/MM/YYYY.

I used SET DATE MASK = 'DD/MM/YYYY'.

But still its not changing.

Cheers

Senthil

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Formatting Date Fields: SET DATE MASK

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 using the specified format.

Syntax:

/: 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)

All other characters found in a date mask are interpreted as simple text and are copied straight into the output.

Assuming the current system date is March 1st, 1997.

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

&DATE& -> Foster City, 03/01/97

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

&DATE& -> March 01, 1997

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

Regards,

SHIVA(reward if helpful).

Former Member
0 Kudos

Hi,

Take a variable date type char(8) in the global declaration.

create program lines in u r smart form.

input u r date output date

code :

date0(2) = p_date6(2).

date2(2) = pdate+4(2).

date4(4) = pdate+0(4).

if u need / also just take 10 length ,

it will work.

with regards,

kiran.G

Edited by: kiran gouni on Apr 18, 2008 11:43 AM

Former Member
0 Kudos

Hi,

Check this and code accordingly,

/: IF &REGUP-BURKS& EQ '2000' -> should be single quotation

/: SET DATE MASK = 'DD/MM/YYYY'

&REGUP-BLDAT&

/: ENDIF

Regards,

Raj.