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 issue

Former Member
0 Likes
739

Can any body tell me how to change the sap internal date format to charformat.

ex: 20061231 -> 31 Dec 2006

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
699

Hi pavan,

1. we can use the FM CONVERSION_EXIT_SDATE_OUTPUT

2. it will output the date in

dd-mon-yyyy format only.

regards,

amit m.

6 REPLIES 6
Read only

Former Member
0 Likes
700

Hi pavan,

1. we can use the FM CONVERSION_EXIT_SDATE_OUTPUT

2. it will output the date in

dd-mon-yyyy format only.

regards,

amit m.

Read only

dani_mn
Active Contributor
0 Likes
699

HI,

this is FM to do it.

<b>
 data: out(20).
 data: date type sy-datum value '20061231'.


      CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
        EXPORTING
          INPUT         = date
        IMPORTING
         OUTPUT        = out.</b>

output will be 31 Dec 2006

Regards,

Wasim Ahmed

Message was edited by: Wasim Ahmed

Read only

Former Member
0 Likes
699

hi,

Use Fm <b>'CONVERSION_EXIT_SDATE_OUTPUT'</b>

data: date type sy-datum, text(20).
 
date = sy-datum.
 
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
  EXPORTING
    INPUT         = date
 IMPORTING
   OUTPUT        = text
          .

Read only

Former Member
0 Likes
699

Try with FM MONTH_NAMES_GET.

Regards,

Prakash

Read only

0 Likes
699

1)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.

2)WRITE SY-DATUM DDMMMYYYY.

?

<b>There are various conversion exits you can use, search SE37 with 'CONVERSION_EXIT_DAT_OUTPUT'.</b>

Read only

naimesh_patel
Active Contributor
0 Likes
699

hello,

Use FM: MONTH_NAMES_GET

then do the concatenate.

regards,

Naimesh