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

converting date into text.

Former Member
0 Likes
5,749

Hello,

Is there any SAP FM available which takes the date (DD.MM.YYY) and convert it sumthing like 'August 01 2006'

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,164

Hi shehryar,

1. we can use the fm

CONVERSION_EXIT_SDATE_OUTPUT

2. it will convert into

01-jan-2006 format.

regards,

amit m.

7 REPLIES 7
Read only

Former Member
0 Likes
3,165

Hi shehryar,

1. we can use the fm

CONVERSION_EXIT_SDATE_OUTPUT

2. it will convert into

01-jan-2006 format.

regards,

amit m.

Read only

0 Likes
3,164

hi,

There is a FM <b>CONVERSION_EXIT_SDATE_OUTPUT</b> 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
          .

Read only

0 Likes
3,164

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 ITAB-KTX DAY YEAR INTO FINAL SEPARATED BY '-'.

WRITE: FINAL.

Read only

Former Member
0 Likes
3,164

check out the table T247. You can convert months to text using this table.

Use function module DATE_COMPUTE_DAY for getting the day number.

Read only

3,164

Useful FM CONVERSION_EXIT_SDATE_OUTPUT

.. thanks:)

Read only

Former Member
0 Likes
3,164

you can use fm CONVERSION_EXIT_SDATE_OUTPUT for conversion of date to text. Hope this will solve your problem.

thanks

Edited by: Ankitesh on Nov 23, 2011 10:59 AM

Read only

0 Likes
3,164

Thanks. It worked