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

regarding date conversion

Former Member
0 Likes
1,031

i have a date in the format of 20070530

now i want the date to be int the format of 30/05/2007.

how can i do that.

thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,009

HI,

data: Date type Sy-datum,
        date1(10) type c.

Date = sy-datum.

Write Date to Date1.

write:/ date1.  " This will have the format which you asked

Regards

Sudheer

9 REPLIES 9
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,009

Hi

Use the Split and Concatenate mechanism.

g_date = sy-datum.

concatenate g_date0(4) '/' g_date4(2) '/' g_date+6(2) into g_date.

Regards,

Sree

Read only

Former Member
0 Likes
1,009

Use

WRITE date MM/DD/YYYY.

or use FM CONVERT_DATE_TO_EXTERNAL

Regards,

Atish

Read only

Former Member
0 Likes
1,010

HI,

data: Date type Sy-datum,
        date1(10) type c.

Date = sy-datum.

Write Date to Date1.

write:/ date1.  " This will have the format which you asked

Regards

Sudheer

Read only

Former Member
0 Likes
1,009

Hi

Do the offset for the date field by splitting into YEAR(first 4 char), Month(next 2 char) and DATE (last 2 char) and concatenate them into a string as per your requirement

or Use EDIT mask command for wrirting this format

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
1,009

Hi,

you can use offsets to change format what you want.

or use statemetn like "write: date1 to date2" converts date as per user settings.

Sudheer.A

Read only

Former Member
0 Likes
1,009

hi,

In the menu bar Goto->System->User Profile->Owndata->Defaults.

There u have the options and u can select the date format which u want.

Message was edited by:

Roja Velagapudi

Read only

Former Member
0 Likes
1,009

write : itab-date using edit mask '__/__/____'.

or

data : date(10).

concatenate sy-datum6(2) sy-datum4(2) sy-datum+0(4) into date separated by '/'.

write : date.

regards

shiba dutta

Read only

amit_khare
Active Contributor
0 Likes
1,009

Try FM - DATE_STRING_CONVERT

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
1,009

Hi

Do Like This........

Data:Date Type sy-datum,date1(2),month(2),year(4),final_date(10).

date1 = date+6(2).

month = date+4(2).

year = date+0(4).

concatenate date month year into final_date seperated by '/'.

Reward All Helpfull Answers..........