Skip to Content

SAP PI mapping : numbers don't have quotation mark in the XML request

Hi,

I have a mapping structure for 2 fields with type string.

The value in these fields are:

field1: hello

field2: 2

But when I execute the PI, and saw the log file, I noticed that the XML data turned out to be like this

"field1":"hello",

"field2":2 (the quotation marks disapeared)

Somehow there's a logic inside the soap adapter to strip the QuotationMarks from any field containing numbers.

The thing is that I need this quotation mark to stay intact, so I'm expecting the result to be:

"field1":"hello",

"field2":"2"

Here is what I have done.

Create an UDF to add quotation marks

var1 = "\""+var1+"\""; return var1.toString();

But the result in the XML Request became:

"field1":"hello",

"field2":\"2\""

Which triggered the invalid json format error.

Please help me how to fix this.

Thanks,

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 29, 2020 at 07:52 AM

    Hi!

    I guess Prefix should be set without colon.

    Regards, Evegniy.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 28, 2020 at 06:12 PM

    Hello Samuel,

    You need to update custom XML rules for changing xml to json.

    Below blog will help you further.

    https://blogs.sap.com/2016/01/13/rest-adapter-in-sap-pipo-enhanced-xmljson-conversion/

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.