on 01-05-2006 8:54 PM
Hi ,
I am using RFC LookUp to get UUID by calling SYSTEM_UUID_CREATE. The user defined function is as follows...
The response I am getting is not the UUID but i think in encrpted form...
uuid coming is g53edmlgikawgikvkahibg== which is not the UUID from R/3
Can anyone please help me ..
String ret = "";
MappingTrace importanttrace;
importanttrace = container.getTrace();
// filling the string with our RFC-XML (with values)
String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><p2:SYSTEM_UUID_CREATE xmlns:p2=\"urn:sap-com:document:sap:rfc:functions\"></p2:SYSTEM_UUID_CREATE>";
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
try
{
// 1. Determine a channel (Business system, Communication channel)
Channel channel = LookupService.getChannel("XID","diCarta_Receiver_XID_CC");
// 2. Get a RFC accessor for a channel.
accessor = LookupService.getRfcAccessor(channel);
// 3. Create a xml input stream representing the function module request message.
InputStream inputStream = new ByteArrayInputStream(m.getBytes());
// 4. Create xml payload
XmlPayload payload = LookupService.getXmlPayload(inputStream);
// 5. Execute lookup.
Payload output = accessor.call(payload);
InputStream in = output.getContent();
out = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
out.write(buffer, 0, read);
}
ret = out.toString();
}
catch(LookupException e)
{
importanttrace.addWarning("Error while lookup " + e.getMessage() );
}
catch(IOException e)
{
importanttrace.addWarning("Error " + e.getMessage() );
}
finally
{
if (out!=null) {
try {
out.close();
} catch (IOException e) {
importanttrace.addWarning("Error while closing stream " + e.getMessage() );
}
}
// 7. close the accessor in order to free resources.
if (accessor!=null) {
try {
accessor.close();
} catch (LookupException e) {
importanttrace.addWarning("Error while closing accessor " + e.getMessage() );
}
}
}
//returning the result RFC-XML.response
ret = ret.toLowerCase();
String value =
ret.substring( ret.indexOf("<uuid>")+6, ret.indexOf("</uuid>"));
result.addValue(value);
}
}
Thanks in advance
Hi Raju,
Pls use the FM - SYSTEM_UUID_C_CREATE ...
the one you are using returns the value in hex format...may be the conversion is causing the issue you are having....
SYSTEM_UUID_C_CREATE gives the output in character format...
Thanks,
Renjith
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.