Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

want to change date format

laxman_sankhla3
Participant
0 Kudos
110

hi

i want to change date format i m getting date formate this <b>20070627.</b>

but i want this format in <b>27.06.2007</b>

please suggest me .

thanks in advanced.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
85

Hi,

Try this.

lv_date type sy-datum.

lv_formatdate(10) type c.

var1(4) type c,

var2(2) type c,

var3(2) type c.

lv_date = 20070627.

var1 = lv_date+(4).

var2 = lv_date+4(2)

var3 = lv_date+6(2).

contatenate var3 var2 var1 into lv_formatdate separated by '.'

Thanks,

Sandeep.

6 REPLIES 6

former_member491305
Active Contributor
0 Kudos
85

Hi,

try like this.

data:v_date(8) type c value '20070627',

v_date1(10).

Concatenate v_date6(2) '.' v_date4(2) '.' v_date+0(4) into v_date1.

Message was edited by:

Vigneswaran S

Former Member
0 Kudos
85

HEllo,

Use this.

Data: lv_datum.
write sy-datum to lv_datum.
write: lv_datum

Regards,

VAsanth

Former Member
0 Kudos
85

Hi ,

U can try write statement for this.

Take the date into a variable say date1.

Write date1 to date1 dd.mm.yyyy.

Former Member
0 Kudos
85

Hi,

Do this.

DATA: lv_dt(10) type c.

lv_dt = table1-f1( the field from which ur date is coming.)

concatenate lv_dt6(2) lv_dt4(2) lv_dt+0(4)

into lv_dt

separated by '.'

write:/ lv_dt.

This will sove ur problem

Regards:

Sapna

Do reward points if u find this helpful

Former Member
0 Kudos
86

Hi,

Try this.

lv_date type sy-datum.

lv_formatdate(10) type c.

var1(4) type c,

var2(2) type c,

var3(2) type c.

lv_date = 20070627.

var1 = lv_date+(4).

var2 = lv_date+4(2)

var3 = lv_date+6(2).

contatenate var3 var2 var1 into lv_formatdate separated by '.'

Thanks,

Sandeep.

Former Member
0 Kudos
85

Hi

Declare the variable type as sy-datum.

write sy-datum to l_date.

You will have to change your user settings to dd.mm.yyyy otherwise you will have to use concatenate with offsets separated by DOT.

Regards

Navneet