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

Conversion of date format

Former Member
0 Likes
1,642

Dear all,

i have a date field which is YYYY/MM/DD format. how to convert this into DD/MM/YYYY format.

Regards

Venkat

13 REPLIES 13
Read only

Former Member
0 Likes
1,463

Hello

data: date1(10).

write sy-datum to date1 DD/MM/YYYY.

Read only

Former Member
0 Likes
1,463

split concatenate??

Read only

Former Member
0 Likes
1,463

Hi,

Use Function module 'CONVERT_DATE_TO_EXTERNAL'.

Make sure to pass the export and import parameters accordingly.

Use sy-datum for Exporting ---> date_internal.

Use ur date variable for Importing ---> date_external

Hope this helps.

Regards,

Darpana.

Read only

0 Likes
1,463

hi

You can also try using convert_calendar_date FM.

Regards,

Vishwa.

Read only

Former Member
0 Likes
1,463

YYYY/MM/DD format. how to convert this into DD/MM/YYYY

Hi

for this take another variable of type DATE

w_date - YYYY/MM/DD

w_new_date - DD/MM/YYYY

w_new_date0(2) = w_date8(2).

w_new_date3(2) = w_date5(2).

w_new_date6(4) = w_date0(4).

like this you can get that format.

Read only

Former Member
0 Likes
1,463

Hi,

you can try out this fution module also...Let c_form be the required format for date...

data : g_in_f type nlei-ibgdt,

g_out_f type m1datum-datex,

c_form type m1datum-format value 'DD/MM/YYYY'.

G_IN_F = DATE in old format.

call function 'FORMAT_DATE_4_OUTPUT

exporting

datin = g_in_f

format = c_form

importing

datex = g_out_f.

hence the date in new format is obtained in G_OUT_F.

Thanks & regards,

Ginni

Read only

Former Member
0 Likes
1,463

Hi,

use FM CONVERT_DATE_FORMAT.

Regards,

Raju.

Read only

Former Member
0 Likes
1,463

Hi,

Concatenate cu_date8(2) cu_date4(4) cu_date+0(4) into ch_date.

Regards,

Surinder

Read only

Former Member
0 Likes
1,463

go to system in the menu bar and go to user profile and then go to own data.a window is displayed and change date format according to u..then restart ur system..it wil work as per ur date format.

regards

deepika

Edited by: deepika reddy on Sep 22, 2008 12:04 PM

Read only

Former Member
0 Likes
1,463

Hi Venkata,

The FM CONVERT_DATE_FORMAT Converts date from yyyymmdd to ddmmyyyy format

Regards,

Salini.

Read only

Former Member
0 Likes
1,463

Use this function module

call function 'FORMAT_DATE_4_OUTPUT

exporting

datin = " give the date to be converted

format = "give the format such as DD/MM/YYYY

importing

datex = "get the output field in a character field

Read only

Former Member
0 Likes
1,463

Hi!

FM CONVERSION_EXIT_PDATE_OUTPUT

for example:

Import parameters Value

INPUT 20080923

Export parameters Value

OUTPUT 23.09.2008

hope this helps u!

Deepika

Read only

Former Member
0 Likes
1,463

Hi,

Try this function module DATE_STRING_CONVERT.

Pass parameters DATE_FORMAT = 4, DATE_STRING = '2008.09.23'

Then the RESULT_DATE would be 23.09.2008.

If you want to provide DATE_STRING as '2008/09/23' then DATE_FORMAT should be 5

If you want to provide DATE_STRING as '2008-09-23' then DATE_FORMAT should be 6

Regards,

Venkat