cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup Api returning HEX values

Former Member
0 Kudos

Hi Everyone,

We have a UDF where we make an RFC call using the Lookup API to SRM function module BBP_PD_PO_GETDETAIL.The call works great but the returned value is in HEX format. It looks like this "Snbgq6rtUm+912sMMb". When we test the function module in se37 and feed the PO Number it looks perfect. Is their a conversion we should be running on the returned results or can I not use this function module.

Cheers,

Joe

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

Check the belowlinks

Lookup - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm

/people/prasad.illapani/blog/2006/10/25/how-to-check-jdbc-sql-query-syntax-and-verify-the-query-results-inside-a-user-defined-function-of-the-lookup-api

Lookups - /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes

Lookups - /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

Lookups with XSLT - https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8e7daa90-0201-0010-9499-cd347ffb...

Regards

Chilla

prabhu_s2
Active Contributor
0 Kudos

did u try to use the same funtion in a stand alone java program and check the result?

Former Member
0 Kudos

I think the problem is related to my returned value. After digging through the code it looks like I am getting an error response. The error is as follows:

C:\usr\sap\DX2\DVEBMGS00\j2ee\cluster\server0\<?xml version="1.0" encoding="UTF-8"?><rfc:BBP_PD_PO_GETDETAIL.Response> (It then shows the entire XML structure of the returned function module, which has my values) It does output the XML results but about 3/4 of the way through the XML is stops outputting and says (The system cannot find the path specified).

Not sure what is causing this but it explains why my DOM searches where not working.

I even tried this simple code to see what happens.

import org.w3c.dom.Document;
import org.w3c.dom.Node;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.NodeList;

public class Test {

	public static void main (String[] args) {
			
		//String content = "";
		String tagValue = "";

		try{		
		
			String content = "<?xml version="1.0" encoding="UTF-8"?><PO><Number>FH78908</Number></PO>";
		
			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		
			// Create DOM structure 
			DocumentBuilder builder = factory.newDocumentBuilder();
			Document document = builder.parse(content);
		
			// Lets find my tag
			NodeList list = document.getElementsByTagName("Number");
			Node node = list.item(0);
		
			if (node != null) {
				node = node.getFirstChild();
			}
			if (node != null) {
				tagValue = node.getNodeValue();
			}
		
			System.out.println(tagValue);
	
		}catch(Exception e){
	
			System.out.println(e.getMessage());
	
		}

	}
}

This returns:

C:\Documents and Settings\localuser\Documents\SAP\workspace\RFC_Query\<?xml version="1.0" encoding="UTF-8"?><PO><Number>FH78908<\Number><\PO> (The filename, directory name, or volume label syntax is incorrect)

Any help would be appreciated. -Cheers

prabhu_s2
Active Contributor
0 Kudos

could u give much broader view on ur req and whats the error stoping the interface?

Former Member
0 Kudos

Hi Prabhu,

The basic idea is that we are receiving an XML document that has a PO number and we want to lookup the PO number in SRM and return the vendor that corresponds to the PO Number.

The function module BBP_PD_PO_GETDETAIL will allow this functionality. If you feed the PO value into the function module it returns a list of business partners under the node E_PARTNER. Under E_PARTNER we would look for the partner that has a PARTNER_FCT of 00000019 (this means vendor) and if found return the value of PARTNER_ID.

We planned on using the Lookup API from a UDF to call the function module and parse the returned value. We can make the call successfully but have been unable to parse the XML that is returned. I noticed that when I outputted the exception it shows the returned XML to a certain point and then stops and gives the message (The system cannot find the path specified). Might just be a problem with my DOM call so I simplified the code to the above syntax to see what I am doing wrong.

Any help would be appreciated.

Cheers

prabhu_s2
Active Contributor
0 Kudos

happen to see one of the thread which poses a similar issue. did u check with this blog:

<a href="/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer XI Lookup API: the Killerc</a>