on 05-19-2016 6:03 AM
Hi all,
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 ?
Hello Shiva,
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.
Excel Support - SAP Gateway Foundation (SAP_GWFND) - SAP Library
Sample -
/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/FlightCollection?$format=xlsx
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Shiva,
In that case i see 2 possible ways :
1. Assuming UI layer already holding data from Backend and now on click of button you would like to download as excel - Then no GW involvement here as GW has given data to your application and now UI layer should have some logic/code to download the already available data as excel.
2. Assuming UI layer does not holding data from backend and now on click of button you would like to download as excel - Then you can call the service directly ( as i shared in previous response - excel support in GW ) which will give back the data as part of excel.
Excel Support - SAP Gateway Foundation (SAP_GWFND) - SAP Library
Sample -
/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/FlightCollection?$format=xlsx
Regards,
Ashwin
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.