cancel
Showing results for 
Search instead for 
Did you mean: 

RFC lookup in pi7.o by Michael

Former Member
0 Kudos

Hi all ,

I followed Michaels Blog for RFC look up.

In test tab it shows sucess.The issue is in I get output as

<?xml version="1.0" encoding="UTF-8"?><rfc:ZSD_RFC_READ_TABLE.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><IT_ZSCLOC></IT_ZSCLOC><IT_ZXILOOKUP></IT_ZXILOOKUP></rfc:ZSD_RFC_READ_TABLE.Response>

I need only value from the table for the field ZSCLOC.

How can i do this.

Thanks,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Can you post the blog link,i will look in to that and let you knwo the code chnages required.

Small chnage required in code, like select one one filed in response, remove the code for other fields.

Regards,

Raj

Former Member
Former Member
0 Kudos

Hi

As per my understanding you want only the value of the "IT_ZSCLOC". You can use REGEX to parse/extract the response content.

In you UDF .. remove the last line "return content" with the below code,



String newContent;
String pattern = "(<IT_ZSCLOC>)(.*)(</IT_ZSCLOC>)"; 
// Create a Pattern object
Pattern d = Pattern.compile(pattern);
// Now create matcher object. 
Matcher m = d.matcher(content);
if (m.find( )) { 
 newContent = m.group(2);
} else { 
 newContent = "";
}

return newContent;

Imports --> java.util.regex.;*

Regards

Ramg

Edited by: Ramkumar Ganesh on May 17, 2010 7:14 PM

Edited by: Ramkumar Ganesh on May 17, 2010 7:15 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srinivasa,

can you once try executing the FM in Sap system and see if you are getting the desired output.

What i could notice is that you are getting a blank response.see in the ECC tables if the requested value has a value to be returned in the SAP tables.

I think you need to parse the message to get the desired value .

refer this

regards,

Srinivas

Edited by: Srinivas on May 17, 2010 10:33 PM