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 change

Former Member
0 Likes
877

Hi Experts,

Currently I have the date in the format of 2.009010100000000E+07 I need

to change it into 2009.01.01.

Please any one suggest me how we can do this.

Thnx,

Sam.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
830

write:/ date edit mask 'YYYY.MM.DD'.

regards

bhanu

6 REPLIES 6
Read only

Former Member
0 Likes
831

write:/ date edit mask 'YYYY.MM.DD'.

regards

bhanu

Read only

Former Member
0 Likes
830

Hello ,

Use EDIT MASK ..and input the format you want.

Re, Manas

Read only

Former Member
0 Likes
830

Hi,

Move the data to the char field and read the first 7 char into another varaible and replace the dot space and condense the variale.

Now you left with date value..move this to variable with Dats type.

Read only

Former Member
0 Likes
830

Hi Sam,

Use the below sample code.

DATA : VAR_DATE(10) TYPE C.

WRITE DATE TO VAR_DATE YYYY.MM.DD.

Read only

Former Member
0 Likes
830

Hi Sam,

try these below functiomodule it converts the datetimestamp to date and time..

then you can convert the date into user defined format..


FRE_CONVERT_TIMESTAMP_2_DATE

LXHME_TIMESTAMP_CONVERT_FROM

LTRM_TIMESTAMP_CONVERT_FROM

I hope this will work for you..

Regards,

Prabhudas

Read only

Former Member
0 Likes
830

Hi,

Try this

DATA
     : NO TYPE F VALUE '2.009010100000000E+07',
       OP TYPE CHAR30,
       DATE TYPE SY-DATUM.

CALL FUNCTION 'C14W_NUMBER_CHAR_CONVERSION'
 EXPORTING
   I_FLOAT              = NO
*   I_DEC                = 0
*   I_DECIMALS           = 0
 IMPORTING
    E_STRING             = OP
*   E_FLOAT              =
*   E_DEC                =
*   E_DECIMALS           =
* EXCEPTIONS
*   NUMBER_TOO_BIG       = 1
*   OTHERS               = 2
          .

REPLACE ALL OCCURRENCES OF ',' IN OP WITH SPACE.

DATE = OP+0(8).

WRITE DATE.

Regards