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: 

date conversion

Former Member
0 Kudos

i need to convert the date.. want to convert from YYYYMMDD to DD.MM.YYYY

is there any functional module available for that?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I am not sure that there is any function modules. But use the following code as.

data : date like sy-datum,

var(10).

concatenate date6(2) '.' date4(2) '.' date+0(4) into var.

write : /1 var.

Regards,

Sankar.

10 REPLIES 10

Former Member
0 Kudos

Hi,

I am not sure that there is any function modules. But use the following code as.

data : date like sy-datum,

var(10).

concatenate date6(2) '.' date4(2) '.' date+0(4) into var.

write : /1 var.

Regards,

Sankar.

Former Member
0 Kudos

Hi,

Try using FM CONVERSION_EXIT_PDATE_OUTPUT.

Thanks,

Sriram Ponna.

Former Member
0 Kudos

Hi,

Use Write statement using EDIT MASK .you can achieve the result.

WRITE .... EDIT MASK .....

ex:

data : ldate type sy-datum,

wdate type char10.

ldate = sy-datum.

write ldate TO wdate USING EDIT MASK '__.__.____'.

WRITE : / wdate.

Former Member
0 Kudos

Hi Suresh,

you have FM's to convert the date in the system format to internal format.

But you can achieve the same with simple statements.

data l_date(10) type c.

concatenate <yourdate_variable>6(2) '.' <yourdate_variable>4(2) '.' <yourdate_variable>+0(4) into l_date.

then you shall be left with l_date which holds date in your required format.

Reward points if this helps,

Kiran

Former Member
0 Kudos

HI,

use FM CONVERSION_EXIT_PDATE_OUTPUT

Regards,

S.Nehru.

Former Member
0 Kudos

Hi,

Lets say

DAT1 is in format YYYYMMDD

and you want DAT2 should be in DD.MM.YYYY

You can use concatenate statement like below.

CONCATENATE DAT16(2) '.' DAT14(2) '.' DAT1+0(4) TO DAT2.

Regards,

Mayank

former_member708410
Contributor
0 Kudos

hi,

CONVERSION_EXIT_PDATE_OUTPUT

Former Member
0 Kudos

Data : gv_datum type sy-datum value sy-datum,

gv_date(10) type c.

constant : gc_dot type c value '.'.

concatenate gv_datum6(2) gc_dot gv_datum4(2) gc_dot gv_datum+0(4)

into gv_date.

write gv_date.

Regards

Sagar

Former Member
0 Kudos

hi use this ...

parameters: p_dat(10) .

data: dat1(4),

dat2(2),

dat3(2),

date(10).

dat1 = p_dat+0(4).

dat2 = p_dat+4(2).

dat3 = p_dat+6(2).

concatenate dat3 dat2 dat1 into date separated by '.'.

write:/ date.

regards,

venkat

Former Member
0 Kudos

Instead of FM using one string concatenation u can do the same functionality.

concatenate date6(2) '.' date4(2) '.' date(4) into date1

Reward pts for useful answers.