I have requirement that i have to export the entries from internal table to excel through ODATA for this i created an FM ZTEST using GUI_DOWNLOAD in that , which is working fine when we run the FM ZTEST but when we through the Odata Service the FM ZTEST , GUI_DOWNLOAD is not getting triggered, it gives the sy-subrc = 6 which is an unknown error exception.Can you please suggest an alternative FM or help me get to the requirement ?
Not sure about what exactly is the scenario here as problem statement describes exporting data to excel through GW but you are also talking about using GUI_DOWNLOAD for uploading an excel as attachment. Being more specific on what is needed will help here.
I could not get if you want to upload an excel through GW, extract that data inside your ABAP code and use it further OR just download your internal table entries as an excel from GW.
However using GUI_DOWNLOAD will not work here for uploading. Its for SAP GUI only.
Below will give you some idea. Please have a look.
If at all, all you need is to simply download your internal table entries as excel through GW, then you just need to add ' $format=xlsx ' in your URI and GW itself will download the table entries as excel.