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

Convert Date

former_member386202
Active Contributor
0 Likes
1,007

Hi friends,

Is there any function module using which we can convert

date into string.

for ex. 05.07.2007 to 05-July-2007

Thankx,

Prashant Patil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
922
************************
  data: gd_date(8).  "field to store output date

* Converts date from 20010901 to 01SEP2001
  gd_date   = sy-datum.
  CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
    EXPORTING
      input         = gd_date
    IMPORTING
      OUTPUT        = gd_date.

reward points if it is usefull ...

Girish

8 REPLIES 8
Read only

Former Member
0 Likes
922

Hi Prashant ,

U can use write statement for this,

Try following,

Write date to date1 dd-mmm-yyyy.

Reward points if useful.

Read only

Former Member
0 Likes
922

Hi,

Use FM DAY_ATTRIBUTES_GET.

Regards,

Raju chitale

Read only

Former Member
0 Likes
922

Hi

Check the fun modules

CONVERT_DATE_TO_INTERNAL and CONVERT_DATE_TO_EXTERNAL

or split the given date to YEAR,MONTH and DATE

and fetch the month description from the table T247

and concatenate the Date,month text and year into a string and use

Reward points for useful Answers

Regards

Anji

Read only

Former Member
0 Likes
922

Hi

Convert the date into INternal format by using Exit_internal

Use this Fm

CONVERSION_EXIT_SDATE_OUTPUT

and pass the below values

Import parameters Value

INPUT 20070704

Export parameters Value

OUTPUT 04.JUL.2007

regards

Shiva

Read only

Former Member
0 Likes
922
REPORT ychatest.

DATA:  int_datum     LIKE sy-datum VALUE '20070705',
       ext_datum(11) TYPE c.



CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
  EXPORTING
    input  = int_datum
  IMPORTING
    output = ext_datum.

TRANSLATE ext_datum USING '.-'.
WRITE : ext_datum.
Read only

Former Member
0 Likes
922

Hi,

Use spell_date as u use speel_amount function module.

pls reward points.

Regards,

Ameet

Read only

Former Member
0 Likes
922

dear Prashant,

This will help you

dat = sy-datum.

str = dat+4(2).

SELECT SINGLE ktx FROM t247 INTO str WHERE spras = 1 AND mnr = str.

CONCATENATE dat+6(2) ' ' str ' ' dat(4) INTO str.

Regards

Sarath

Read only

Former Member
0 Likes
923
************************
  data: gd_date(8).  "field to store output date

* Converts date from 20010901 to 01SEP2001
  gd_date   = sy-datum.
  CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
    EXPORTING
      input         = gd_date
    IMPORTING
      OUTPUT        = gd_date.

reward points if it is usefull ...

Girish