Quantcast
Channel: SCN : Popular Discussions - SAP NetWeaver Gateway Developer Center
Viewing all articles
Browse latest Browse all 1657

OData Excel Upload by 'Add File' button in GW_CLIENT gives junk characters

$
0
0


Dear Folks,

 

Greetings !!

I request your guidance in resolving the "well known" excel upload problem using GUI_UPLOAD in ABAP. I understand that there are large number of threads dealing with the excel upload issue, however I have a psecific question to ask.

I have created an OData service to upload an excel file (Entity type = Media). For testing the same, I am uploading a test MS excel file in the GW_CLIENT using the 'Add File' button. The file gets uploaded but appears as junk characters in the request body. Please refere to the image attached herewith.

I debugged the 'Add File' button and understand that the SAP standard code uses method GUI_UPLOAD of the GUI frontend services class, with Filetype = 'BIN' (hardcoded) to upload the file. The BINARY data received after the GUI_UPLOAD is also correct since I tested this by downloading the same BINARY contents and this creates the same excel file after download. This means that the excel is read correctly by GUI_UPLOAD.

 

On more debugging and searching in the SCN forums, I stumbled upon an answer by Thomas Jung in a post (Re: Upload a file excel with web dynpro) stating that the characters uploaded are not JUNK but they are the Native Binary Excel Format which is a propriatery Microsoft format. Therefore when I try to convert the XSTRING of this binary to STRING, the contents are not the excel text contents, instead it is these junk characters.

 

So, my question is - Is there any way (FM, BAPI, custom code) in ABAP to convert the native binary excel format into readable text?

 

Any pointers are highly appreciated.

 

Thank you.

 

Regards,

Sud


Viewing all articles
Browse latest Browse all 1657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>