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
502
  • SAP Managed Tags:

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.

3 REPLIES 3

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
416
  • SAP Managed Tags:

Why not accept that this field semantically is a Boolean?

0 Kudos
416
  • SAP Managed Tags:

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.

RalfHandl
Product and Topic Expert
Product and Topic Expert
0 Kudos
416
  • SAP Managed Tags:

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.