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: 

how to convert mmddyyyy date format to sap date format

Former Member
0 Kudos

how to convert mmddyyyy date format to sap date format

7 REPLIES 7

Former Member
0 Kudos

Hi,

You can use Below FM :

CONVERT_DATE_TO_INTERNAL

This FM will convert date as internal format,i mean depends on user profile.

Regards,

Omkaram.

Former Member
0 Kudos

If date is in this format better use CONCATENATE.

Regards,

Atish

Former Member
0 Kudos

how to convert mmddyyyy date format to sap date format with out using FM.

0 Kudos

CONCATENATE field+4(4) field(4) INTO l_date_internal.

Regards,

Atish

Former Member
0 Kudos

DATA: date(8) TYPE c.

ur field <date1>is in mmddyyyy format.

concatenate date14(2) date10(2) date1+2(2) into date.

write date to necessary variable.

Former Member
0 Kudos

hi use this,

parameters:p_date type d.

data: v_date1 type d.

.

CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'

EXPORTING

DATE_EXTERNAL = p_date

IMPORTING

DATE_INTERNAL = v_date1.

write:/ v_date1.

reward points if useful,

venkat.

Former Member
0 Kudos

Hi,

just copy paste and run this code.

DATA:V_DATE1(10),

V_DATE(10).

V_DATE = '03032008'. "-----> format of mmddyyyy

concatenate V_DATE4(4) '.' V_DATE2(2)'.' V_DATE+0(2) into V_DATE1.

Write:V_DATE1. "-------> will be of the format yyyy.mm.dd

Hope this helps.