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

Date Format in output

Former Member
0 Likes
3,455

Hi All,

I have a problem with Date Format while downloading to Excel. I have tried Set Mask as well as Concatenation Method to convert the Internal Date to DD.MM.YYYY format. I am storing the new formatted date into a Variable ( type Char length 10) . Now when I am downloading this to Excel and sorting it. It is sorted taking them as characters not date.

I am using the link to download List -> Export -> Spreadsheet -> Table -> Microsoft Excel. Please suggest me any solution through this link.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,259

Hi,

Try to download with function module GUI_DOWNLOAD

Try populating the paramter DAT_MODE with 'X'.It should work.

8 REPLIES 8
Read only

Former Member
0 Likes
2,260

Hi,

Try to download with function module GUI_DOWNLOAD

Try populating the paramter DAT_MODE with 'X'.It should work.

Read only

Former Member
0 Likes
2,259

Have tried setting the cell format to date in excel?

Read only

0 Likes
2,259

Yes, I have tried to format the cell in Excel. Problem still persists.

Read only

Former Member
0 Likes
2,259

Hi,

Try to use the Function Module CONVERSION_EXIT_SDATE_OUTPUT to convert the date in the required format.

Thanks,

saipriya

Read only

Former Member
0 Likes
2,259

Use following call:

call function 'GUI_DOWNLOAD'

exporting

filename = fullpath

filetype = 'ASC'

tables

data_tab = asc_file[]

exceptions

file_write_error = 01

no_batch = 04

unknown_error = 05

others = 99.

where ASC_FILE will be flat table having concatenated table column values separated by horizontal tab.

Thanks

Amol Lohade

Read only

0 Likes
2,259

Hi,

After Downloading the output into spread sheet select that perticular column as the date type field and then sort it.

To change as date type select the column and press right click u will be getting an option as formmat

press on it in that numbers-> select date and arrange as ur format.

if u want to download as such not change these things every time u need to use the ole_excel properties to it.

check in ABAPLOVERS.BLOGSPOT.COM for the excel properties for automaictcally changes to the excel properties.

Regards,

Naresh

Read only

Former Member
0 Likes
2,259

Hi,

Use offset to get the correct format and concatenate the field with the separators(. or / ) to display in the date format.

Hope this give you a clue.

Best Wishes

Read only

Former Member
0 Likes
2,259

Hi Nibha,

you have not posted in what format you need your final date to be.

howvere suppose if you want your date to be DD/MM/YYYY,

1. get date in internal format.

2. write below logic:

SAP Internal fomet always irrespective of user format : YYYYMMDD

*Posting date

CONCATENATE wa_regup-budat+6(2)

wa_regup-budat+4(2)

wa_regup-budat+0(4) INTO wa_final-budat SEPARATED BY '/'.

here you will get date as DD/MM/YYYY.

to convert the user format date to internal format: use FM Convert_date_to_internal.

then pass the date to excel , it will remain as a date.

hope this helps.