servicehanahana-xs

how to save string in HANA which contains percentage sign?


I have an XSJS service where I'm saving some strings in a HANA table like

oEntity.save(new oEntity(oUploadedData))

It is working fine but if there is some special character in the string like % it fails. Is there any way to escape the percentage sign and save it like that?


Solution

  • I've found a solution. The problem was not the percentage sign but the way i've sent data from the client to the server. If you are sending JSON string to the backend which contains percentage sign HANA xsjs gives an internal server error. Instead of just JSON.stringify(data) you should use ecodeURIComponent(JSON.stringify(data))