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: 

Converting date

Former Member
0 Kudos
136

Hi all.

I need to convert date type dd.mm.yyyy into dd month yyyy, e.g. 07.09.2000 into 7 september 2000

Is there any function module for this operation?

TIA, Nikolai

1 ACCEPTED SOLUTION

Former Member
0 Kudos
86

Use the FM : CONVERSION_EXIT_LDATE_OUTPUT

Usage:

DATA ldate(20).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

input = sy-datum

IMPORTING

OUTPUT = ldate.

Input : 20080208

output : 08.February2008

6 REPLIES 6

Former Member
0 Kudos
87

Use the FM : CONVERSION_EXIT_LDATE_OUTPUT

Usage:

DATA ldate(20).

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

input = sy-datum

IMPORTING

OUTPUT = ldate.

Input : 20080208

output : 08.February2008

Former Member
0 Kudos
86

Hi,

Try Function module CONVERSION_EXIT_IDATE_OUTPUT

Reward if helpful.

Regards,

Mandeep

Former Member
0 Kudos
86

TABLES t247.
DATA : l_date(10) VALUE '07.09.2000',
       v_date(40).


DATA : l_ltx TYPE FCLTX.

SELECT SINGLE ltx INTO l_ltx
       FROM t247
       WHERE  mnr EQ l_date+3(2) AND
              spras EQ sy-langu.

CONCATENATE l_date+0(2)
            l_ltx
            l_date+6(4)
            INTO v_date
            SEPARATED BY SPACE.

WRITE 😕 v_date.

Former Member
0 Kudos
86

Hi,

Use the following fn module, it will solve your problem.

CONVERSION_EXIT_IDATE_OUTPUT

In this, if you give 20070312 as import parameter, you will get 12MAR2007 as output.

Regards,

CS.

Note: Reward points if helpful.

Former Member
0 Kudos
86

Check this out ... hope it helps


DATA: int_datum LIKE sy-datum VALUE '20070705',
      ext_datum(11) TYPE c.


CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = int_datum
IMPORTING
output = ext_datum.

TRANSLATE ext_datum USING '.-'.
WRITE : ext_datum. 

.

Former Member
0 Kudos
86

another option.. Crude but it works.


DATA:
  out(30),
  month(15),
  it_month LIKE STANDARD TABLE OF month.
DATA ldate(20).

month = 'Janurary'. APPEND month TO it_month.
month = 'Feburary'. APPEND month TO it_month.
month = 'March'. APPEND month TO it_month.
month = 'April'. APPEND month TO it_month.
month = 'May'. APPEND month TO it_month.
month = 'June'. APPEND month TO it_month.
month = 'July'. APPEND month TO it_month.
month = 'August'. APPEND month TO it_month.
month = 'September'. APPEND month TO it_month.
month = 'October'. APPEND month TO it_month.
month = 'November'. APPEND month TO it_month.
month = 'December'. APPEND month TO it_month.


READ TABLE it_month INTO month INDEX sy-datum+4(2).

CONCATENATE sy-datum+6(2) month sy-datum(4) INTO out
  SEPARATED BY space.

WRITE:/ out.

*"   or

DATA:
  indate(10).

indate = '07.09.2000'.

READ TABLE it_month INTO month INDEX indate+0(2).

CONCATENATE indate+3(2) month indate+6(4) INTO out
  SEPARATED BY space.

WRITE:/ out.