Application Development and Automation 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: 
Read only

date format

Former Member
0 Likes
710

date is in MM.DD.YYYY format i want to convert it in DD.MM.YYYY without using any FM, date could be '10.2.2000' or '1.2.2000'.. can anybody send me the code?

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
658

HI..,

data:

w_date1 type sy-datum,

w_date2(10) type c,

w_date3(10) type c,

w_dd(2) type c,

w_mm(2) type c,

w_yy(4) type c.

w_date1 = sy-datum.

write w_date1 to w_date2.

split w_date2 at '.' into w_mm w_dd w_yy.

concatenate w_dd '.' w_mm '.' w_yy into w_date3.

write w_date3.

reagrds,

sai ramesh

8 REPLIES 8
Read only

Former Member
0 Likes
658

Hi Anju

Try like this

data: var1(4) type c,
data: lv_formatdate(10) type c.
var2(2) type c,

var3(2) type c.

lv_date = sy-datum.
var1 = lv_date+(4).
var2 = lv_date+4(2).
var3 = lv_date+6(2).

concatenate var2 var3 var1 into lv_formatdate separated by '.'.

Reward all helpfull answers

Regards

Pavan

Message was edited by:

Pavan praveen

Read only

Former Member
0 Likes
658

Hi,

Use the addition Edit mask with write statement.

Reward if helpful

Read only

Former Member
0 Likes
658

Hi ,

normally date will be comign in before display in formay yyyymmdd.

normally you cna use date mask or you cna do string operation and cut this date field and arrange in the order u want and concatenate.

rewars if useful.

Regards,

Sasi

Read only

Former Member
0 Likes
658

Hi Anju,

lets say date1 is holding the current value.

data date2(8) type c.

concatenate date12(2) '.' date10(2) '.' date1+4(4) into date2.

Now you have required format in date2.

Award points if helpful,

Kiran

Read only

Former Member
0 Likes
659

HI..,

data:

w_date1 type sy-datum,

w_date2(10) type c,

w_date3(10) type c,

w_dd(2) type c,

w_mm(2) type c,

w_yy(4) type c.

w_date1 = sy-datum.

write w_date1 to w_date2.

split w_date2 at '.' into w_mm w_dd w_yy.

concatenate w_dd '.' w_mm '.' w_yy into w_date3.

write w_date3.

reagrds,

sai ramesh

Read only

Former Member
0 Likes
658

Hi,

use the code as under :

*MM.DD.YYYY format i want to convert it in DD.MM.YYYY

data: date type sy-datum,

date1(10) type c,

date2(10) type c,

day(2),

Month(2),

year(4).

date1 = '06.29.2007'.

day = date1+3(2).

month = date1+0(2).

year = date1+6(4).

concatenate day '.' month '.' year into date2.

write 😕 date1.

write 😕 date2.

Regards,

Sandeep Kaushik

Read only

abdul_hakim
Active Contributor
0 Likes
658

DATA DATE TYPE D VALUE '20070627'.

WRITE DATE DD/MM/YYYY

Read only

Clemenss
Active Contributor
0 Likes
658

Hi anju,

split date at '.' into month day year.
concatenate day month year into date separated by '.'.

Regards,

Clemens