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: 

FM for converting 01012007 to Jan-07.

Former Member
0 Kudos

Can any one plz tell FM for converting date 01012007 to JAN-07 and so on.

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos

SELECT SINGLE kTX FROM T247

INTO MONTH_NAME

WHERE SPRAS = SY-LANGU

AND MNR = SY-DATUM+4(2).

CONCATENATE SY-DATUM+6(2) MONTH_NAME SY-DATUM(4)

INTO DATE_CHAR SEPARATED BY SPACE.

or FM

CONVERSION_EXIT_SDATE_OUT.

Regards,

Amit

Reward all helpful replies.

former_member200338
Active Contributor
0 Kudos

Hi,

I am not sure whether there is FM. But you can do it manually.

Use case statment for month and assingn the MONTH in charaters and then concatenate all.

example.

data: l_MM type char2,

l_date type sy-datum.

move l_date+2(2) to l_mm.

Case l_mm.

when '01'.

l_month = 'JAN'.

....

Reward points if useful,

Regards,

Niyaz

Former Member
0 Kudos

Hi,

There is a FM CONVERSION_EXIT_SDATE_OUTPUT to do that.. just check it.

data: date type sy-datum, text(20).

date = sy-datum.

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

INPUT = date

IMPORTING

OUTPUT = text

.

Regards,

Omkar.