on 2021 May 06 11:46 AM
Dear community,
I am currently developing an interface in SAP PI which should proivde an ABAP Proxy to consume a JSON REST service. I made all the configuration and setup in PI and now have following issue.
The REST JSON Service returns a JSON with a fieldname called "_LINKS". In the REST Adapter I configured that the JSON Format should be converted to XML and I get following result:
Now, as I prepared my datatype for the ABAP Proxy, I get the error that the fieldname is not allowed to have a "_" as first character:
Question now, is it possible to remove the "_" from the XML to be able to map it to a valid fieldname in the datatype?
I found following option in the REST Adapter und Parameters > Data Formats > Response:
"Escape invalid name start character":
But I don't know how to use it. I started to provide the character "_" in the Escape Sequence, but the result is that for every fieldname which start with the character "_" it adds another "_" character to it:
At first I was confused why it added the character, so I thought I need to enter a character which should be allowed as a valid first character. But entering characters like "a" or "z" did nothing and where not added. I only found out that when I added "s" that the fieldname "self" was added another "s" character:
So I don't know if I use this option properly. This SAP Support Note metions this option as new feature but does not provide a documentation on how to use this option properly:
2083009 - NF: JSON to XML conversion enhancements
Is there any otherway to be able to use the field "_links" or to map it properly?
Thanks for everyone for reading and for any help.
BR,
Andreas
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Evgeniy,
thank you so much for your time and help.
I feel absolutely stupid as I found this option "Convert JSON Name To XML Name" but I didn't saw that this mapping table was displayed at the end so I had to scroll. With that maintained I could remove the _ from the request:
Thanks you so much.
BR,
Andreas
User | Count |
---|---|
73 | |
21 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.