10-25-2007 11:32 AM
Hi,
I need to convert the date from this format ( 25.08.2007) to 20070825.
Can you please tell me the function module name for this conversion.
10-25-2007 11:37 AM
10-25-2007 11:35 AM
hi ,
There is no need of any fm for this.
do like this.
data: date1 type sy-datum,
date2(8) type c.
date1 = sy-datum. ' assume cur date 25.10.2007
move date1 to date2.
write:/ date1,
/ date2.
OUtput:
25.10.2007
20071025
10-25-2007 11:36 AM
<b>REPORT ZKUN_TEST .
data : a type string.
a = sy-datum.
WRITE: sy-datum .
skip.
write : / a.</b>
10-25-2007 11:37 AM
You pass your internal table date format dd.mm.yyyy to Function module <b>CONVERT_DATE_TO_INTERNAL</b>
to get the date format as yyyymmdd
10-25-2007 11:37 AM
10-25-2007 11:39 AM
10-25-2007 11:42 AM
HI,
use this..
<b>Data : c(8) type c.
c = sy-datum</b>
With Rgds,
S.Barani
10-25-2007 11:43 AM
write a sub routine like below:
form convert_date idate type sy-datum
edate type i.
edate3 = idate(0)+2.
edate2 = idate(3)+2.
edate1 = idate(6)+4.
concatenate edate1 edate2 edate3 to edate.
endform.
call this subroutine. this is just a sample program. might require minor changes.
10-25-2007 11:44 AM
if u are writing to screen or some file try this way.
write l_date using no edit mask.
10-25-2007 11:45 AM
<b><i><u>Converting the date</u></i></b> ****************
data: date type sy-datum,
date1(10) type c.
date = sy-datum. ' assume cur date 10.10.2007
move date to date1.
write:/ date,
/ date1.
OUtput:
10.10.2007
20071025