cancel
Showing results for 
Search instead for 
Did you mean: 

date format in Smart Form

Former Member
0 Kudos

Hi to all!

I would like to change the format of date fields in a smart form. How may I do this?

Thanks,

Istvan

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member188829
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi,

By default Smartforms will format the date for the recipient country of the form, based on the address. If you want to change this or use for example the month name rather than number you will need to declare a global variable for your formatted field and populate this in an ABAP node. There you can use regular ABAP to reformat the date.

Regards,

Nick

Former Member
0 Kudos

Hi,

I have declared a global variable for my date field, and I have tried the "write" statement to format the date. But it does not work.

May you tell me the regular abap statement, which are able to format the date?

Thanks,

Istvan

Former Member
0 Kudos

What is the destination format you need for your date field?

Former Member
0 Kudos

The destination format is: dd.mm.yyyy

Former Member
0 Kudos

Write your date field to a 10 character variable (say W_DATE).

WRITE: SY-DATUM to W_DATE.

then

REPLACE '/' with '.' into W_DATE.

Regards,

Nick

Former Member
0 Kudos

HI

Former Member
0 Kudos

using edit mask or write to statments

Former Member
0 Kudos

Ok, but how may I use an edit mask?

Former Member
0 Kudos

store ur date into one varible of type charecter whoose width equal to ur date width i.e 10 char .and format ur date as ur wish using offset and length.

data dat(10) type c value '22:11:2007'.

data day(2) type c .

data mon(2) type c.

data yea(4)type

day = +0(2)dat.

mon = +4(2)dat .

yea = +7(4)dat .

concatenate mon ':' day ':' year into dat .