03-25-2008 12:46 PM
i need to convert the date.. want to convert from YYYYMMDD to DD.MM.YYYY
is there any functional module available for that?
03-25-2008 12:49 PM
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.
03-25-2008 12:49 PM
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.
03-25-2008 12:49 PM
Hi,
Try using FM CONVERSION_EXIT_PDATE_OUTPUT.
Thanks,
Sriram Ponna.
03-25-2008 12:51 PM
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.
03-25-2008 12:52 PM
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
03-25-2008 12:53 PM
03-25-2008 12:53 PM
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
03-25-2008 12:54 PM
03-25-2008 12:57 PM
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
03-25-2008 12:58 PM
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
03-25-2008 1:01 PM
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.