Application Development and Automation 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: 
Read only

Date format conversion

Former Member
0 Likes
603

Hi,

I need to convert date format from one to another. e.g. I need to convert 01.06.2006 to 01 Jun 2006...can anyone provide me with function module for this.

Thanks

Riyaz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
560

Have you tried

WRITE SY-DATUM DD/MMM/YYYY.

?

There are various conversion exits you can use, search SE37 with 'CONVERSION_EXIT_DAT_OUTPUT'.

MattG.

4 REPLIES 4
Read only

Former Member
0 Likes
560

use table t247 with elect logic...

parameters: date like sy-datum.

data: begin of itab occurs 0,

SPRAS type SPRAS,

MNR LIKE T247-MNR,

KTX LIKE T247-KTX,

LTX LIKE T247-LTX,

end of itab.

DATA : month LIKE T247-MNR.

DATA: YEAR(4).

DATA: FINAL(18).

DATA: DAY(2).

DAY = DATE+6(2).

MONTH = DATE+4(2).

YEAR = DATE+0(4).

select SINGLE * from t247 into itab where mnr = month

AND SPRAS = 'E'.

APPEND ITAB.

CONCATENATE DAY ITAB-KTX YEAR INTO FINAL SEPARATED BY '-'.

WRITE: FINAL.

Read only

dani_mn
Active Contributor
0 Likes
560

IF you want to avoid SELECT statement.

You can write a little code to do this.

Like

CASE DATE+3(2).

WHEN '01'

CONCATENATE 'JAN' TO datefield.

WHEN '02'

CONCATENATE 'FEB' TO datefield.

So on....

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
560

hi,

Check this link which contains a list of FM related to date Convertions

http://www.geocities.com/victorav15/sapr3/abapfun.html

Regards,

Santosh

Read only

Former Member
0 Likes
561

Have you tried

WRITE SY-DATUM DD/MMM/YYYY.

?

There are various conversion exits you can use, search SE37 with 'CONVERSION_EXIT_DAT_OUTPUT'.

MattG.