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 a string into date format

Amey-Mogare
Contributor
0 Likes
693

Hiiiii,

I have a string (char length 10) in 08.03.2008 ie dd.mm.yyyy format.

Now i wan to convert this into a date field sy-datum.

How can i do it?

regards,

Amey

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
667

Hi,

you can use the function CONVERT_DATE_TO_INTERNAL.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = L_VAR1

IMPORTING

DATE_INTERNAL = L_VAR2

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

5 REPLIES 5
Read only

Former Member
0 Likes
668

Hi,

you can use the function CONVERT_DATE_TO_INTERNAL.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = L_VAR1

IMPORTING

DATE_INTERNAL = L_VAR2

EXCEPTIONS

DATE_EXTERNAL_IS_INVALID = 1

OTHERS = 2.

Read only

abapdeveloper20
Contributor
0 Likes
667

Hi,

Check the same FM in se37

*CONVERT_DATE_TO_INTERNAL*

it solvees ur query.

Reward if useful.

~Lakshmiraj~

Edited by: LAKSHMIRAJ on Mar 28, 2008 4:57 AM

Read only

Former Member
0 Likes
667

CONVERT_DATE_TO_INTERNAL this function module sove ur problem...

Regards

Sugumar G

Read only

Former Member
0 Likes
667

Hi,

Try this FM CONVERT_DATE_TO_INTERNAL

Read only

0 Likes
667

Thank so much to u all !!!

problem solved !!!

regards,

Amey