cancel
Showing results for 
Search instead for 
Did you mean: 

Generic Object Services (GOS) WbDynpro Abap XLSX

Former Member
0 Kudos

Hello Everyone

The Microsoft Office 2007 and 2010 brought new Escel extension (XLSX).

We've developed an WDA program allowing the WEB interface user to add attachment to the GOS of goods receipts.

That part is working fine.

Any attachment done from the web interface can be open without problem by R/3 users.

The problem is when we are trying to open the "XLSX" format from the web interface Excel respond with an error message:

Excel found unreadable contents in file. Do you wish to retrieve the content of the workbook.

If we agree, the fiel is openning without any lost.

If we try to open the same file from R/3 directly, we do not have that error message.

Here is the class and method used to open the file from webdynpro abap:

cl_wd_runtime_services=>attach_file_to_response(

i_filename = u201Cfile nameu201D

i_content = u201Cfile content in the XSTRING formatu201D

i_mime_type = u201CMIME TYPEu201D

i_in_new_window = u201COpen in new windowu201D

i_inplace = 'X'

).

All suggestion will be higly appreciated.

Regards

dstj

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The reason for this is that the GOS property for file extension is 3 characters. The last X in XLSX gets cutoff and the file type is XLS, but has a different mimetype..thus you get that warning.

I found the way to resolve this is to store the filetype in the header information when storing the file in the GoS. Then, when I retrieve the file, I read the header for the key I have saved and assign the mime type accordingly. Kind of a hack, but I looked into this rather deeply some months ago and it was the best solution I could come up with.

Former Member
0 Kudos

Here is a decent article I used when investigating the solution: http://friendlyabaper.blogspot.com/