cancel
Showing results for 
Search instead for 
Did you mean: 

Sending a table to remote RFC in Java UDF

Former Member
0 Kudos

Hello,

<br><br>

We use the API "com.sap.aii.mapping.lookup" often to make RFC calls from a UDF and return data. We typically create an import parameter in the Function Module and pass the value into the RFC. We now need to send in an unlimited number of values so we understand that instead of the import paramter we need to use a table. The problem is we get an error when we build the XML in our UDF and try to call the RFC. We tried wrapping the values in item nodes and several other approaches but we are not sure if we can populate a table via XML and make the RFC call.

<br><br>

Example of what we tried:

<br><br>

String sRfcxml = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;&lt;ns0:ZCAE_MX_CONTRACT_ROUTING xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"&gt;&lt;E_ZCAE_COCODE&gt;&lt;item&gt;0445&lt;/item&gt;&lt;/E_ZCAE_COCODE&gt;&lt;/ns0:ZCAE_MX_CONTRACT_ROUTING&gt;";

<br><br>

Regardless of what we try we get the following error during the call:

<br><br>

error of "RuntimeException in Message-Mapping transformation: Exception:[java.lang.RuntimeException: com.sap.aii.mapping.lookup.LookupException: Exception during processing the payload.Problem when calling an adapter by using communication channel RFC_RCV_ORGDATA (Party: , Service: ValidateXIData_BusiServ, Object ID: d5401e52ad1039df96f02bde53b23c06) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not convert request from XML to RFC:com.sap.mw.jco.JCO$Exception: (130) JCO_ERROR_XML_PARSER: Expecting a tag to begin with '<' instead of '0', in "ODE><item>0965</item"'. Cause Exception: 'error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not convert request from XML to RFC:com.sap.mw.jco.JCO$Exception: (130) JCO_ERROR_XML_PARSER: Expecting a tag to begin with '<' instead of '0', in "ODE><item>0965</item"'. com.sap.aii.mapping.lookup.LookupException: Problem when calling an adapter by using communication channel RFC_RCV_ORGDATA (Party: , Service: ValidateXIData_BusiServ, Object ID: d5401e52ad1039df96f02bde53b23c06) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.af.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not convert request from XML to RFC:com.sap.mw.jco.JCO$Exception: (130) JCO_ERROR_XML_PARSER: Expecting a tag to begin with '<' instead of '0', in "ODE><item>0444</item"'. Cause Exception: 'error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not convert request from XML to RFC:com.sap.mw.jco.JCO$Exception: (130) JCO_ERROR_XML_PARSER: Expecting a tag to begin with '<' instead of '0', in "ODE><item>0444</item"'."

<br><br>

Now if we do not pass any data or use an import versus table parameter in the function module it works just fine.

<br><br>

We know we can work around this by using an import parameter and stringing the values together with a delimiter and then breaking this apart in ABAP but we are looking for a cleaner solution.

<br><br>

Any thoughts?

<br><br>

Joe

Edited by: Joe Wright on Nov 16, 2009 10:45 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hey , you have to use dirty things (string option...)

Answers (1)

Answers (1)

Former Member
0 Kudos

Not sure what's wrong, but are you sure your "stringed" XML document matches the expected RFC structure ? Btw, I'd replace (though it could be considered as a cosmetic change) to replace "ns0" with "rfc" in your namespaces declaration, it's what you'll see in all imported RFC objects in XI/PI

Rgds

Chris