cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in sap script

Former Member
0 Kudos

Hi Experts,

I have a variable in which i have a date which is the output of a perform

&GV_BLDAT&, the date is in this format

20080424

I need this date to be printed in 24.04.2008

I have tried to use SET DATE MASK

the data type of this is Gv_BLDAT type likp-bldat,

can any one help me with the steps

Accepted Solutions (0)

Answers (3)

Answers (3)

amit_khare
Active Contributor
0 Kudos

data: w_date type char10.

concatenate gv_bldat6(2) '.' gv_bldat4(2) '.' gv_bldat+0(4) into w_date.

Former Member
0 Kudos

Hi,

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.

Syntax

/: SET DATE MASK = 'date_mask'

The following templates may be used in the date mask:

DD day (two digits)

DDD name of day (abbreviated)

DDDD name of day (written out in full)

MM month (two digits)

MMM name of month (abbreviated)

MMMM name of month (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)

Assuming a current system date of April 24th, 2008.

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

&DATE& -> 24.04.2008

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

&DATE& -> March 01, 1997

Hope this helps u...

Regards,

KK

Former Member
0 Kudos

I think you have to manually do the formatting if set date mask doesnt work.

Since you already got the date from a subroutine (perform), why not edit it there also.

you can use write statement for the format in the external subroutine.

reward if helpful.

thanks.

tyken