on 03-12-2009 10:52 AM
Hi there
I have 3 Software components in my Integration Builder, I created a UDF that calls an RFC and in all the Iu2019m using the exact same UDF but in 1 of the 3 it does not return any results. If I display queue on it, it says successful but with no results.
What might be the most logical reason for this?
Thanks,
Jan
Edited by: Jan de Lange on Mar 12, 2009 11:53 AM
Hi
I found the problem, one of the segments in IDOC structure had no mapping. This was confusing cause according to me the Display queue should work regardless of the mapping.
Thanx again,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I found the problem, one of the segments in IDOC structure had no mapping. This was confusing cause according to me the Display queue should work regardless of the mapping.
Thanx again,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you provide the elements in import and export RFC structure??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please check if the RFC is imported in the SWC in which it is not working.
If there delete and try to re - import again
rgds
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again
I see that ist actually not a RFC, the UDF calls data from a R/3 table, the java code is:
// declare parameters
String returnValue = "";
String WHERE_CLAUSE = fieldYouGiveName + " = " + fieldYouGiveValue;
String rfcXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ns0:RFC_READ_TABLE xmlns:ns0=\"urn:sap-com:document:sap:rfcfunctions\"><QUERY_TABLE>ZMAPPING_TABLE</QUERY_TABLE><DATA></DATA><FIELDS></FIELDS><OPTIONS><item><TEXT>"fieldYouGiveName" = '" + fieldYouGiveValue +"'</TEXT></item></OPTIONS></ns0:RFC_READ_TABLE>";
AbstractTrace trace = container.getTrace();
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
try
{
// 1. Determine a communication channel (Business system + Communication channel)
Channel channel = LookupService.getChannel(businessSystem,communicationChannel);
// 2. Get a RFC accessor for the channel.
accessor = LookupService.getRfcAccessor(channel);
// 3. Create an XML input stream that represents the RFC request message.
InputStream inputStream = new ByteArrayInputStream(rfcXML.getBytes());
// 4. Create the XML Payload
XmlPayload payload = LookupService.getXmlPayload(inputStream);
// 5. Execute the lookup.
Payload result = null;
result = accessor.call(payload);
InputStream in = result.getContent();
// 6. Create a DOM structure from the input XML
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(in);
NodeList list = document.getElementsByTagName("WA"); // The lookupValue is available as WA tag in the response
Node node = list.item(0);
if (node != null) {
node = node.getFirstChild();
if (node != null) {
returnValue = node.getNodeValue();
}
}
// 7. To free resources, close the accessor..
if (accessor!=null) {
try {
accessor.close();
} catch (LookupException e) {
trace.addWarning("Error while closing accessor " + e.getMessage() );
}
}
} catch (Exception e) {
trace.addWarning("Error" + e);
}
// 8. return a single id value to the message mapping
return returnValue;
Still, it only works in 2 of the 3 SWC.
Regards,
Jan
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.