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: 

regarding date conversion

Former Member
0 Kudos
157

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

Former Member
0 Kudos
135

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

sreeramkumar_madisetty
Active Contributor
0 Kudos
135

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

Former Member
0 Kudos
135

Use

WRITE date MM/DD/YYYY.

or use FM CONVERT_DATE_TO_EXTERNAL

Regards,

Atish

Former Member
0 Kudos
136

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

Former Member
0 Kudos
135

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

Former Member
0 Kudos
135

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

Former Member
0 Kudos
135

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

Former Member
0 Kudos
135

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

amit_khare
Active Contributor
0 Kudos
135

Try FM - DATE_STRING_CONVERT

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos
135

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..........