Editing JSON embedded in ABAP strings
SAP Credit Management
SEPTEMBER 16, 2023
I have many unit tests which takes JSON as input, however editing JSON embedded in a ABAP string is a mess. And no, ecatt test data containers is not an option, never use it for anything in unit tests, but its a different story. One option is to use string templates, DATA(json) = |{n| && | "hello": 2n| && |}|. It does require escaping the squiggly brackets, so I tend to do the following instead, DATA(json) = `{` && |n| && ` "hello": 2` && |n| && `}
Let's personalize your content