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: 

Function Module for Date conversion

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use CONVERSION_EXIT_PDATE_INPUT

9 REPLIES 9

Former Member
0 Kudos

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

Former Member
0 Kudos

<b>REPORT ZKUN_TEST .

data : a type string.

a = sy-datum.

WRITE: sy-datum .

skip.

write : / a.</b>

Former Member
0 Kudos

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

Former Member
0 Kudos

Use CONVERSION_EXIT_PDATE_INPUT

former_member386202
Active Contributor
0 Kudos

Hi,

Use this FM "CONVERSION_EXIT_PDATE_INPUT".

Regards,

prrashant

Former Member
0 Kudos

HI,

use this..

<b>Data : c(8) type c.

c = sy-datum</b>

With Rgds,

S.Barani

Sathish
Employee
Employee
0 Kudos

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.

Former Member
0 Kudos

if u are writing to screen or some file try this way.

write l_date using no edit mask.

Former Member
0 Kudos
              • <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