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

func that change date

Former Member
0 Likes
851

i have date like 01.09.2005

and i want to get it in this format---20050901

is there func that doing it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
833

Hi Liat,

1. User FM

CONVERT_DATE_TO_INTERN_FORMAT

2. In the paramaeter DTYPE

pass DATS

I hope it helps.

Regards,

Amit M.

7 REPLIES 7
Read only

Former Member
0 Likes
833

Hi Liat,

Check the function modules

<b>CONVERT_DATE</b>* .

May be one of the function modules gives you the

desired result.

Thanks&Regards,

Siri.

Read only

Former Member
0 Likes
833

try

CONVERT_DATE_TO_INTERN_FORMAT

Read only

0 Likes
833

what is the type you know?

Read only

Former Member
0 Likes
834

Hi Liat,

1. User FM

CONVERT_DATE_TO_INTERN_FORMAT

2. In the paramaeter DTYPE

pass DATS

I hope it helps.

Regards,

Amit M.

Read only

manuel_bassani
Contributor
0 Likes
833

you can also use a simple conversion like:


DATA: dat1(10),
      dat2(10).

write sy-datum to dat1.

concatenate dat1+6(4) dat1+3(2) dat1(2) into dat2.

Regards, Manuel

Read only

Former Member
0 Likes
833

if you are very sure of DATE format is like given below,

use the OFFSET .

ex :

data : v_date(10) type c value '10.12.2005',

v_datum type sy-datum.

concatenate v_date+6(4)

v_date+3(2)

v_date+0(2)

into v_datum

NOW v_datum will have 20051210.

regads,

srikanth

Read only

Former Member
0 Likes
833

Hi Liat,

There's a function called CONVERT_DATE_TO_INTERN_FORMAT

which will convert the date you entered to the system format of YYYYMMDD. For the parameter DTYPE use 'DATS'.

Also, the date must be in the format that is specified under Defaults of your user profile otherwise you'll get an exception of invalid date.