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

Converting OData output to csv

h3n
Participant
0 Likes
4,502

Hi there

Is there a way to change the OData output to csv? In my idea I change the $format to CSV like this “$format=CSV” and I get a file with csv. Is there a way to program an exit to change the format of the response and to convert the response to a mime file?

Regards
Henning

3 REPLIES 3
Read only

maheshpalavalli
Active Contributor
0 Likes
3,092

from the URL directly it is not possible I believe. But u can read the data and parse as shown below.

https://ui5.sap.com/#/topic/f1ee7a8b2102415bb0d34268046cd3ea

Read only

0 Likes
3,092

Thanks for the info but I am not firm with ui5. If I am not wrong, I need a client for parsing the JavaScript. In my destination Environment, it should be as simple as possible. Most of the work should be done in ABAP.

Read only

CarlosRoggan
Product and Topic Expert
Product and Topic Expert
0 Likes
3,092

Hi Henning,

the OData spec allows additional formats:
http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-...

However, I'm not aware of any additional formats or extension points
The old SAP Gateway had an option to specify excel for $format, but I don't know if this is supported in RAP
As such, like the real expert and great community member Mahesh has pointed out, you would need to request JSON format, ideally with filters and selects, to make the payload smaller, and then parse it on client side