Skip to Content
avatar image
Former Member

RFC lookup in pi7.o by Michael

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 17, 2010 at 04:36 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    May 17, 2010 at 04:56 PM

    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 Mapping lookups - RFC API

    regards,

    Srinivas

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

    Add comment
    10|10000 characters needed characters exceeded