cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PO added "\" to payload after convert to JSON

0 Kudos

Hi Expert,

I have trouble when using REST receiver. After SAP PO convert my XML to JSON there is a backward slash added to my payload. For example my XML payload: ABC/12/H. After SAP PO convert to Json the payload become: ABC\/12\/H. Please, any suggestion to remove the bacward slash ?

I know there is some threat with the same issue, but no clear guidance to solve it. I use SAP PO 7.5

Regards

former_member30
Community Manager
Community Manager
0 Kudos

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members.

For example, you can outline what steps you took to find answers (and why they weren't helpful) and share screenshots of what you've seen/done. The more details you provide, the more likely it is that members will be able to assist you. Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).

Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.

Cheers,
Julia
SAP Community Moderator

Accepted Solutions (0)

Answers (1)

Answers (1)

r_herrmann
Active Contributor
0 Kudos

Hi Candara,

this is (unfortunately) the standard behaviour of the REST adapter. (Btw. the JSON standard says that escaping of / by \ is valid but optional. So at least it isn't wrong - just unwanted...)

To solve your problem you have two options:

  1. Add a Java-Mapping to do the JSON conversion
  2. Use Eng Swee's JSON converter bean to do the XML/JSON conversion: https://blogs.sap.com/2015/03/18/jsontransformbean-part-2-converting-xml-to-json-content/

By only using the REST adapter's conversion feature you won't be able to solve your request.