Application Development 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: 

OData response payload not sending SPACE as field value

akimol
Explorer
0 Kudos

Hello,

I have created a oData service from cds view on standard table e.g. SKA1.

The flag type of fields were going out as Boolean so I have added case statement and sending X or Space as character string. But in browser or consuming application that space value does not come through and it's an empty string. What setting in oData API or gateway can be enabled to stop this and send actual space as value .e.g xloev : " "

Thanks,

Amit.

  • SAP Managed Tags:
3 REPLIES 3

RalfHandl
Advisor
Advisor
0 Kudos

Why not accept that this field semantically is a Boolean?

  • SAP Managed Tags:

0 Kudos

Sigh!

Its been uphill battle to convince non-SAP application to change their code which is more than a dozen year old. Currently they use Oracle to Oracle direct database connection to read tables and we want to remove that and convert them to access via API (since SAP server is moving to cloud and on HANA) .

Its been hard to convince them to switch and Boolean type field will be major rewrite on their side, so single character field it is for now. Only this space issue is pending so they can get Space from oData API as they get Space with direct table read.

  • SAP Managed Tags:

RalfHandl
Advisor
Advisor
0 Kudos

Sigh! Unfortunately I don't know how to preserve "trailing" spaces when converting ABAP-CHAR to OData-String values. Removing trailing spaces is usually exactly what you want with CHAR data.

  • SAP Managed Tags: