Skip to Content
0
May 28, 2018 at 08:13 AM

SAP PO UDF not working Operation Mapping

62 Views

Dear Team,

I have written the UDF in SAP PO which is working in Message Mapping but not working in Operation Mapping. Any suggessions ?

boolean nodeFound = true;


try{


DocumentBuilderFactory dbFactory =
DocumentBuilderFactory.newInstance();


DocumentBuilder docBuilder =
dbFactory.newDocumentBuilder();


for(int i=0; i<var1.length;i++){


BufferedInputStream bis = new
BufferedInputStream(new ByteArrayInputStream(var1[i].getBytes()));


Document doc = docBuilder.parse(bis);


Element docRoot = doc.getDocumentElement();


 


NodeList childNodes =docRoot.getChildNodes();


container.getTrace().addInfo(String.valueOf(childNodes.getLength()));


nodeFound = true;


for(int j=0; j<childNodes.getLength(); j++){


Node child = childNodes.item(j);


if((child.getNodeType() == Node.ELEMENT_NODE)){


if(
(!child.getTextContent().trim().equals(""))){


nodeFound = true;


 


}else
if(child.getTextContent().trim().equals("")){


nodeFound = false;


break;


}


}


}  


if(nodeFound == false){


result.addSuppress();


}else{


result.addValue(" ");


}


 


}

Thanks