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: 

changing date to ddmmyyyy format

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

my report writes in dd.mm.yyyy when it is writing a report.

in debugging it shows me in yyyymmdd.

it also downloads in yyyymmdd format in excel sheet.

the issue is want the ddmmyyyy format in the date column in excel sheet.

how can we do this thru abap code?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Shahid,

If you want always the date formate ddmmyyy in the excel sheet... then while moving the date value use like below

date10(2) = date6(2).

date12(2) = date4(2).

date14(4) = date0(4).

or if you want the user setting format then use the write while moving the data to excel.

Regards,

Satya.

12 REPLIES 12

Former Member
0 Kudos

you can use EDIT mask for the date in desired format.

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

edit mask?

Former Member
0 Kudos

Hi,

SAP stores date variables in yyyymmdd format internally. So, while debugging also it displayed in internal format only.

According to u r settings external date format is dd.mm.yyyy. So u r report output is in that format.

As ur downloading the internal data into excel sheet date field is downloading in internal format it self.,

Regards,

Sankar

Former Member
0 Kudos

Hi Shahid,

If you want always the date formate ddmmyyy in the excel sheet... then while moving the date value use like below

date10(2) = date6(2).

date12(2) = date4(2).

date14(4) = date0(4).

or if you want the user setting format then use the write while moving the data to excel.

Regards,

Satya.

Former Member
0 Kudos

Hi,

Write:/ wa_sdate -editmask yyyymmdd.

Rewards points if it is helpful

Former Member
0 Kudos

Hello,

Please check the following code

Consider

BLDAT = sy-datum = 20070823 (yyyymmdd)

With the following code you can convert it to (ddmmyyyy ) format

DATA : L_TEMP TYPE SY-DATUM.

L_TEMP0(2) = WA_DATA-BLDAT6(2). "passed date

L_TEMP2(2) = WA_DATA-BLDAT4(2). "passed Month

L_TEMP4(4) = WA_DATA-BLDAT0(4). "passed year

BLDAT = L_TEMP.

now BLDAT /L_temp contains date as 23082007 which can be passed to the table passing data to your excel sheet

Also with excel sheet..right click on any cell in an excel sheet and go to ->format cells -> number Tab -> click on date and you can see various types of date format..but this can be used after being downloaded as a formatting procedure manually

as an alternative use available function modules too

Go to SE37 and write Date / press F4 and see if some function modules are available for converting the format

Hope if gave some idea

Reward if useful

Regards

Byju

Former Member
0 Kudos

HI,

Try using the function module <b>'convershion_exit_pdate_output'</b> before you try down loading into Excell format.

Regards,

Murthy

Former Member
0 Kudos

use write to ........... using edit mast '__/__/____'

statement.

sameer

Former Member
0 Kudos

using edit mask

data : dat type sy-datum.

dat = '20070823'.

write 😕 dat using edit mask '__/__/____'.

Former Member
0 Kudos

hI SYED

LOOP AT ITAB.

date10(2) = ITAB-date6(2).

date12(2) = ITAB-date4(2).

date14(4) = ITAB-date0(4).

ITAB-DATE = DATE1.

MODIFY ITAB INDEX SY-TABIX.

ENDLOOP.

reward points to all helpful answers

kiran.M

Former Member
0 Kudos

Hi Syed,

U can ues the function module

<b>CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL</b>.

To change the date formate depends on the requirment.

If u have any doubt on this u can ask me.

<b>If helpfull reward</b>

If u want to change standard setting of date formate u can do wiht the following path

SAP easy excess... system-> User profile -> Own data-> Default tab -> Date formate.

Reward if helpfull.

Anees

9886358645

Message was edited by:

anees jawad

shahid
Product and Topic Expert
Product and Topic Expert
0 Kudos

thank u all