This blog is created to throw some lights on SAP CPI concepts, which experienced in my journey. Trying to explore more about HCI/Cloud platform integration/SCPI and sharing the contents to help you. Thanks for all Users your support. Please give your comments below ...
Tuesday, 8 August 2023
Remove some extra nodes from json format using groovy script
import com.sap.gateway.ip.core.customdev.util.Message;
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String
def jsonParser = new JsonSlurper()
def jsonObject = jsonParser.parseText(body)
message.setBody(JsonOutput.toJson(jsonObject["rows"]))
return message;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment