remove anything from string cpi input string.

 

this blog useful for only string 

SAP Cloud Integration (CPI/HCI) || Writing Groovy Scripts _ With Basic Examples | SAP Blogs


import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message)
{
    def removal=message.getBody(java.lang.String) as String;
    removal=removal.replace(/<?xml version="1.0" encoding="UTF-8"?>/,"");
    message.setBody(removal);
    return message;
}

testing purpose

Groovy IDE


-----------------------------------------------------

import com.sap.gateway.ip.core.customdev.util.Message


def Message processData(Message message) {

    def removal = message.getBody(java.lang.String) as String

    removal = removal.replaceAll('xmlns:prx="urn:sap.com:proxy:RE1:/1SAI/TAS4E662B8C2E7563F4F897:740"', "")

    // Add more replacements if needed using removal.replaceAll()

    

    message.setBody(removal)

    return message

}


Popular posts from this blog

SAP CPI : camle expression in sap cpi , cm, router, filter and groovy script. format

SAP CPI camel conditions and xpath conditions

oauth call to cpi integraiton suite from sap apim