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: 

Conversion of date format

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello

data: date1(10).

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

former_member181995
Active Contributor
0 Kudos

split concatenate??

Former Member
0 Kudos

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.

0 Kudos

hi

You can also try using convert_calendar_date FM.

Regards,

Vishwa.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

use FM CONVERT_DATE_FORMAT.

Regards,

Raju.

Former Member
0 Kudos

Hi,

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

Regards,

Surinder

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Venkata,

The FM CONVERT_DATE_FORMAT Converts date from yyyymmdd to ddmmyyyy format

Regards,

Salini.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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