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 into text.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi shehryar,

1. we can use the fm

CONVERSION_EXIT_SDATE_OUTPUT

2. it will convert into

01-jan-2006 format.

regards,

amit m.

0 Kudos

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
          .

0 Kudos

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.

Former Member
0 Kudos

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.

Useful FM CONVERSION_EXIT_SDATE_OUTPUT

.. thanks:)

Former Member
0 Kudos

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

0 Kudos

Thanks. It worked