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: 

Issue in displaying DATE field in Excel sheet

Former Member
0 Kudos

Hi All,

Kindly help me with the below issue:

A report program when exexuted fetches the data's from database tables and populates in to an itab and the same is then moved to a itab which is declared like this:

DATA: BEGIN OF t_downd OCCURS 0,

line(4096) TYPE c,

END OF t_downd.

This T_DOWND will have all the obtained records and the same is used to pass the entries to GUI_DOWNLOAD function module inorder to save the excel sheet in '.csv' format to the desktop.

The issue is the user wants the 'DATE' field to be displayed in 'DD-MM-YYYY' format in the excel sheet. So I have fetched the date based on the position(fdpos) and used the concatenate statement separated by '-'. Now when I run the program, some dates are not getting displayed in 'DD-MM-YYYY' format and some dates are getting displayed correctly as per the requirement.

While debugging also, I could find the date value in T_DOWND in the 'DD-MM-YYYY' format only. Not sure where it is actually getting changed and why.

Can some one please provide a soultion for this.

Thanks,

Deepa

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

In Function Module GUI_DOWNLOAD set the parameter 'filetype' to 'DAT', and give file name extension as 'XLS'.

I think it works.

Regards

Haritha

Edited by: Haritha Teegala on Jan 6, 2012 11:25 AM

3 REPLIES 3

Former Member
0 Kudos

date questions are not allowed as we have a lot of post for these. please search.

by the way just concatenate a ' before the DD and try

0 Kudos

Hi Soumya,

Thanks for the reply!

I declared a constant in the below format for the quotes:

constants : c_quotes type c value ''''. (i have put 4 quotes)

Now i have concatenated the above quotes to my date value.

But the output in the excel sheet is now getting displayed like this '30-02-2011

All the dates are getting displayed in the correct expected format, but the only issue is we are getting an extra quotes in front of the date.

Can you please suggest why this is happening.

Thanks,

Deepa

Edited by: Deeparani.D on Jan 9, 2012 11:53 AM

Edited by: Deeparani.D on Jan 9, 2012 11:54 AM

Former Member
0 Kudos

Hi,

In Function Module GUI_DOWNLOAD set the parameter 'filetype' to 'DAT', and give file name extension as 'XLS'.

I think it works.

Regards

Haritha

Edited by: Haritha Teegala on Jan 6, 2012 11:25 AM