cancel
Showing results for 
Search instead for 
Did you mean: 

RFC lookup error in SAP PI 7.0

Former Member
0 Kudos

Hi Experts,

In SAP PI 7.0 I write a UDF for RFC lookup. In this function it is giving error as below:

cannot resolve symbol

symbol : method getTextContent () location: interface org.w3c.dom.Element returnValue = eElement.getTextContent();

When I use getNodeValue() it is returning null value.

the structure of the output rfc xml is simple:

<?xml version="1.0" encoding="UTF-8" ?>

     # <ns0:Z_R_RFCXIPO xmlns:ns0="urn:sap-com:document:sap:rfc:functions">

          <O_OUTPUT>12</O_OUTPUT>

        </ns0:Z_R_RFCXIPO>

The code which I have written is

Document docResponse = null;

String returnValue = null;

NodeList nList = null;

Node node = null;

try {

        docResponse = builder.parse(in);

        if (docResponse == null)

                trace.addWarning("docResponse is null");

        nList = docResponse.getElementsByTagName("O_OUTPUT");

    //    Element eElement = (Element) nList.item(0);

        node = nList.item(0);

        returnValue = node.getTextContent();

         trace.addInfo("output: "+ returnValue);

}catch (Exception e) {

        trace.addWarning("Error when parsing RFC Response - " + e.getMessage());

}

I am unable to understand why the error. When I run this in NWDS it is running fine.

What can be the error ? Any version problem?

Thanks,

Aniruddha

View Entire Topic
anupam_ghosh2
Active Contributor
0 Kudos

Hi Aniruddha,

                     Please check this blog

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3...

Author is using node.getNodeValue();  function to retrieve specific value. You need to do the same.

Regards

Anupam