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

Unable to open excel that was output via ABAP program

0 Likes
4,142

Hi Experts,

I am facing issue while opening the excel via that i have generated via one of my custom report.

The excel throws error " Unable to open excel"

However when i open the same file using EXCEL -> OPEN - <navigating to file > ., it opens fine and appropriate data is available.

Please advise.

code.pngexcel-error.pngworking-fine.png

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
3,175

Putting an xlsx extension doesn't make a file Excel. What you've got there is a text file. Save as .txt

7 REPLIES 7
Read only

Abinathsiva
Active Contributor
0 Likes
3,175

Hi,

Check the office version and SAP GUI version, Load in different available format once other than ASC..

Read only

matt
Active Contributor
3,176

Putting an xlsx extension doesn't make a file Excel. What you've got there is a text file. Save as .txt

Read only

Sandra_Rossi
Active Contributor
3,175

dheeraj.bulchandani and use code page 4103 (UTF-16LE) instead of 4102 (UTF-16BE), it's much better supported by Microsoft suite, and you should write the BOM.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    ...
    WRITE_BOM = abap_true
    ...

NB: the function module GUI_DOWNLOAD is obsolete, use the method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD instead.

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,175

Please embed the screenshots like this (and resize the screenshots too). Thank you!

code.png (21.3 kB)

excel-error.png (12.0 kB)

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,175

working-fine.png (54.1 kB)

Read only

0 Likes
3,175

Changes the file format to .XLS instead of .XLSX and it worked fine. Thankyou!

Read only

0 Likes
3,175

Changed* the file format to .XLS instead of .XLSX and it worked fine