Message mapping RFC lookup

Hi.
I'm trying to do a RFC inside a message mapping with java code. I have to send a field (id) and return the vendor code (lifnr).
I'm searching michal Krawczyk's weblog to see how can i do that but the link is broken.
Does anybody has that document that can send me to [email protected]?
Regards.
Inigo.

hi Inigo,
please look at the following blogs,
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/michal.krawczyk2/blog/2005/09/15/xi-rfc-mapping-lookups-from-bc-to-xi
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/801376c6-0501-0010-af8c-cb69aa29941c
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
Regards
Sreeram.G.Reddy
Message was edited by:
        Sreeram Reddy

Similar Messages

  • SALERT_CREATE RFC in PI Mapping (RFC LookUps) to triggering Alerts:

    Hi
    I got a questions on using SALERT_CREATE RFC in PI Mapping (RFC LookUps) to triggering Alerts:
    1) Should I import RFC (SAP PI server) into SAP PI ESB?
    2) Should I maintain the details of SAP PI in the RFC receiver channel ?
    3) Can I use this RFC for RFC Lookups  like any other RFC (ECC)?
    I really appreciate for your help on this
    Thanks
    Vasu

    >>Should I import RFC (SAP PI server) into SAP PI ESB?
    No, this is not required, in your UDF, you just need to build the same structure as the RFC expects so to make it easier, you can import the RFC and see how its structure looks like but the real RFC is not used in RFC Lookup.
    >>Should I maintain the details of SAP PI in the RFC receiver channel ?
    In general,you need to maintain the details of the SAP system where the RFC is stored, it could be PI/ECC or any other system.
    Since you specify Alert information in this RFC lookup, the details will be of PI system.
    >>Can I use this RFC for RFC Lookups like any other RFC (ECC)?
    This RFC is used only to build the structure in UDF, it is not used in anything else.
    Note: Since you have mentioned writing UDF, i am assuming you are using PI 7.0. If you are on PI 7.1, you don't need to write UDF for it. There is  already a standard function for RFC Lookup.
    Thanks
    Aamir

  • XSLT Mapping : RFC Lookup using java helper class

    Hi All,
    I am doing RFC Lookup in xslt mapping using java helper class. I have found blog for the same (http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc8efd4ee14) However this blog is very advanced.
    Can anybody help me with step by step approach for the same?
    My basic questions are not answered in the blog as:
    1) where to add the jar file of the java class used in xslt mapping.
    I have added zip file of XSLT mapping in imported archived and using that in mapping.
    Thanks in advace.
    Regards,
    Rohan

    Hi,
    Can u please have look at this in detail , u can easily point out yourself the problem...
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/content.htm
    Please observe the line,
    xmlns:javamap="java:com.company.group.MappingClass
    in XSLT mapping..
    The packagename of class and class name and XSLT namespace should be matching...
    Babu
    Edited by: hlbabu123 on Sep 29, 2010 6:04 PM

  • Message Mapping RFC structure to deep XML structure

    Hello,
    I have a message mapping I am struggling with. The outbound interface is an RFC with structure like this:
    RFC_send_material
    -material (1..unbounded)
    --matnr
    --meins
    --brgew
    -description (1..unbounded)
    --matnr
    --vkorg
    --text
    The inbound interface should look like this:
    Materials_from_SAP
    -material (1..unbounded)
    --matnr
    --meins
    --brgew
    --description (0..unbounded)
    ---vkorg
    ---text
    My problem is to get all the description connected to the matnr together.
    Examples with data:
    Outbound rfc:
    <RFC_send_material>
       <material>
          <matnr>100</matnr>
          <meins>c1</code1>
          <brgew>c2</code2>
       </material>
       <material>
          <matnr>101</matnr>
          <meins>c1a</code1>
          <brgew>c2a</code2>
       </material>
       <material>
          <matnr>102</matnr>
          <meins>bv102</code1>
          <brgew>addd102</code2>
       </material>
       <description>
          <matnr>100</matnr>
          <vkorg>NO10</sales_org>
          <text>testing100</text>
       </description>
       <description>
          <matnr>102</matnr>
          <vkorg>SE10</sales_org>
          <text>testing102</text>
       </description>
       <description>
          <matnr>102</matnr>
          <vkorg>DK10</sales_org>
          <text>testing103</text>
       </description>
    </RFC_send_material>
    The inbound file structure should then look like this:
    <Materials_from_SAP>
       <material>
          <matnr>100</matnr>
          <meins>c1</meins>
          <brgew>c2</brgew>
          <description>
             <vkorg>NO10</vkorg>
             <text>testing100</text>
          </description>
       </material>
       <material>
          <matnr>101</matnr>
          <meins>c1a</meins>
          <brgew>c2a</brgew>
       </material>
       <material>
          <matnr>102</matnr>
          <meins>bv102</meins>
          <brgew>addd102</brgew>
          <description>
             <vkorg>SE10</vkorg>
             <text>testing102</text>
          </description>
          <description>
             <vkorg>DK10</sales_org>
             <text>testing103</text>
          </description>
       </material>
    </Materials_from_SAP>
    So as you see, my problem is to get the correct description belonging to the material. Hope anybody can help with doing this in Message Mapping.
    Regards,
    Per

    Hi PRW,
    As Michal said correctly, it is hard to describe in words, so here are some pictures which I think is the solution of your problem.
    Description mapping  : http://www.flickr.com/photos/23639237@N02/3220030016/sizes/o/
    VKORG mapping      : http://www.flickr.com/photos/23639237@N02/3219181675/sizes/o/
    Text  mapping           : http://www.flickr.com/photos/23639237@N02/3219182919/sizes/o/
    UDF  CODE             : http://www.flickr.com/photos/23639237@N02/3219184005/sizes/o/
    And the Final Reslut : http://www.flickr.com/photos/23639237@N02/3220035356/sizes/o/
    Regards,
    Sarvesh

  • Cannot resovle the Symbol error in UDF - Java mapping - RFC Lookup ?

    Hi Friends ,
    We are working on Java mapping  -  UDF for RFC Lookup . It is giving the Cannot resolve Symbol for all imported archive java class files even if we give again all imported files in import section of UDF we are still getting the same cannot resolve error  .
    We are using SP 12 of XI 3.0 . What could be the reason ?
    Thanks.,
    V.Rangarajan

    Hi,
    Can you try to open imported archive in IR and check if the path(folder structure like com.abc.xyz.etc) for classes is same as in import statement in UDF.Since we had experienced the same problem.
    Thanks.
    Regards,
    Shweta

  • Using of SALERT_CREATE in PI mapping (RFC LOOKUPs)

    I have a stupid question on using SALERT_CREATE rfc in SAP PI mapping, I am using RFC lookups in the mapping, how can I use this SALERT_CREATE RFC, Do I need to Import from PI server? do I need Communication Channel for this? How can I use to send Alerts to PI alert inbox from PI Mapping using SALERT_CREATE

    Thanks for reply Praveen, this is file to PI to File scenario, I am calling 3 RFC Lookups from Mapping, after every RFC Lookup call there are some validation checks to send alerts with out breaking the Mapping/business flow, so how can I use SALERT_CREATE rfc from mapping to send alerts

  • Message mapping: table lookup

    The requirement:
    Source message contains some keys and values, and target message has different keys. Values are simply mapped. no problem. but the mapping between source message keys and target message keys is a bit complicated so it is controlled in a seperate table. End users do maintainance jobs on the mapping table on a daily base.
    I checked some threads in this forum and I now understand that this kind of table lookup can be done using the combination of JCo, ABAP programs and ABAP tables, but what is the common way in dealing with such kind of requirement?

    You can use value mapping if you are not looking at picking up values from application system.It is just like SM30 transcation.You can get the info under SAP XI->Design and Configuration->Configuration->Value Mapping.
    If you are in SP13 you can use lookup API SAP XI->Design and Configuration->Design->Mapping look ups.

  • RFC Lookup's in message mapping fail with RuntimeException for no reason

    Hi guys,
    We have developed interfaces that execute a lot of RFC's from Message Mapping, by making use of RFC Lookup API.
    In ID, in the corresponding RFC Receiver Communication Channel we have set the number of maximum connections to 100.
    However, when a big number of Idocs with lots of items is sent to XI some messages fail in XI because mapping fails with a runtime exception that is not correct, since there is a return value found from the execution of the RFC function. And when I am testing the mapping in Test mode of XI IR, the mapping is executed successfully.
    Do you think that by increasing the maximum number of connections in Communication Channel, it will take effect?
    Evaggelos

    Hi Evaggelos,
    DECREASE, may be til 10.
    Regards,
    Udo

  • Graphical message mapping examples for JDBC and RFC lookup

    hi, can any body provide me graphical message mapping examples for the "JDBC Lookup" function and "RFC Lookup" function?
    I'm now studying the graphical message mapping and want to try those 2 functions. thank you.
    I expect the examples to be simple enoung, not need to set up much.

    >
    Madhu_1980 wrote:
    > can u check this link:
    >
    > PI 7.0 & 7.1 Mapping - Blogs,Articles,Wiki,Code Samples and Videos Collections https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=79955426  
    >
    > it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    May be I'm too foolish to follow those links, I got issues of each links.
    What I really want is an example from step0
    Swarup:
    Refer the Lookup document - Easy Lookup in Process Integration 7.1
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20befc9a-aa72-2b10-ae9b-b0988791d457
    The first step is "Create an RFC Enabled Function Module for look up", but where can I create the function module? Should I use ESB, IB? or use transaction 'SE11' ?
    Kulkarni:
    Very good links for RFC lookup with 7.0/3.0
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70d90a91-3cf4-2a10-d189-bfd37d9c3231&overridelayout=true
    At page6 "PI Development/Configuration", it saies "You are on the design maintenance screen in the Integration Builder.Expand the subnodes for the software component version for which you want to import interfaces".
    What is "design maintenance screen" ? My IB version is: Service Pack:08 Release:NW07_08_REL.
    When I open IB, it display a screen titled with "Configuration: Intergation Builder", I did not find "software component version" node on the left tree.
    Madhu_1980 :
    it contains a link : SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups /people/jin.shin/blog/2008/02/15/sap-pi-71-mapping-enhancements-series-graphical-support-for-jdbc-and-rfc-lookups
    The Prerequisites state:
    The JDBC channel to be used for the lookup must be configured and activated in the Integration Directory.
    The definition of the table used for the lookup must already be imported into the ES Repository as an external definition
    But I don't know how to create a JDBC channel and define the table.

  • Message-Mapping: Use same RFC lookup for different target fields

    Hello,
    I need to apply an RFC Lookup which delivers a boolean flag back (true or false). This RFC lookup should be used for different target fields.
    Is there a way to execute the RFC lookup just once and then store the result in an internediate variable that I can use for all futher checks for different target fields?
    If this is not possible and I have to apply the RFC lookup for all necessary target fields is it then executed for each target field ? This is exactly what I want to avoid in order not to slow down performance.
    The input parameter (=source field value) would be the same.
    Thank you for your advice!

    Exactly.
    Here is a UDF example I have that you could adapt to your needs.
    Set
    public String setCounter(String a,String b,Container container){
    /* Store values in global datacontainer
    a: mapping value and return valueparameter
    b: name for stored value parameter
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    Get
    public String getCounter(String a,Container container){
       //write your code here
    GlobalContainer gc = container.getGlobalContainer();
    if (gc.getParameter(a) != null) {
      return String.valueOf(gc.getParameter(a));
    } else {
    return "1";

  • RFC lookUp during Message mapping

    All
       I want to get soem values from SAP table during message mapping.After getting the values am going  to do 2:1 mapping by using BPM.
      Could you please let me know the basic and fundamental things about RFC look up during mapping and RFC settings in XI as well in R3?
    Please explain

    Hi Rajesh,
    Pl post this in XI Forums to get quick replies.
    Regards
    Ayyapparaj

  • RFC Lookup mapping error in PI 7.1

    Hi Experts,
    I´m getting mapping error when executing interface SOAP -> WS (SAP ECC) . The message mapping call RFC Lookup to SAP ECC.
    When test the message mapping in Integration Builder the interface calls communication channel by RFC Lookup and works fine.
    That interface was imported from QAS environment and was working fine, but in PRD it doesn´t works.
    I checked the Interface Determination and the parameter is filled correctly with communication channel. The same communication channel was used on message mapping test.
    The Interface Determination in SXI_CACHE has no value assigned to parameter in PRD environment, otherwise, the same interface determination in SXI_CACHE in QAS environment there is value (CC ID).
    The problem persists after Cache Refresh in SXI_CACHE and CPA Cache.
    Can anyone help me ?
    Thanks in advance,
    Regis Ferrato
    Bellow the trace of error ocurred:

    Hi Regis,
    Please check my reply in your other thread:
    Re: RFC Lookup error cache in PI 7.1
    Regards,
    ---Satish

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • RFC Lookup using Java Mapping program - Examples

    Dear Experts,
    I am working on a scenario which is using 1:N mapping. For deciding the target message I have to use RFC Lookup to call the backend ERP system and there are 2 ERP systems involved in this integration. As I am using Java Mapping and never did a RFC Lookup in Java. I kindly request you to give me some examples which I could use for my RFC calls in my Java Mapping. Simple example will do.
    Client is adamant to use Java mapping, I could achieve this easily using XSLT or Graphical Mapping.
    Advance Thanks,
    Pradeep

    Hello,
    why don't you use Extended Receiver Determination Defining Extended (Dynamic) Receiver Determination - Integration Directory - SAP Library?
    What you can do is create a Message Mapping between your source message and Receivers message type. In this message mapping you can use your RFC to generate the target message.
    For example, lets say we have the function ZFM_GET_INTERFACE_INFO used to generate the List of Receivers given a source message. You could create a Message Mapping as below:
    In this case, the RFCLookup box look as below:
    The receiver determination configuration would look as follows:
    Afterwards, you will need two specific message mappings for the two ERP systems.
    Summarizing, you'll need:
    1.- A Message Mapping: Source Message to Receivers Message Type (This one uses the RFC Lookup)
    2.- A Message Mapping: Source Message to Target Message for ERP 1
    3.- A Message Mapping: Source Message to Target Message for ERP 2
    In Integration Directory you'll have 1 Receiver Determination(Source system, Target System determined Dynamically) and 2 Interface Determinations (Source System to ERP1, Source System to ERP2), etc.
    I hope you find it useful.
    Regards!

  • RFC Call in Message Mapping

    Hi there
    I am trying to do a table lookup from XI in my message mapping by calling an remote RFC. The return values must return ALL the value for a specific column. The code I have here returns a blank value. Can someone see what my problem may be?
    My variables for my UDF is:
    public String UDF_RFC(String DBTABLE,String MATNR,String FIELDS,String businessSystem,String communicationChannel,Container container)
    And my Code:
    "My code appears to mess up my message structure, I will attach it in a responce..
    Thanks,
    Jan
    Edited by: Jan de Lange on Sep 16, 2009 11:09 AM
    Edited by: Jan de Lange on Sep 16, 2009 11:09 AM

    // declare parameters
    String returnValue = "";
    String rfcXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:ZINT_XI_GET_SITES xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><LT_SITES><item><WERKS></WERKS></item></LT_SITES></ns0:ZINT_XI_GET_SITES>";
    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      nodelist = document.getElementsByTagName("*");
    Node          node;
    Element       element;
    NamedNodeMap  nnm = null;
    String attrname;
    String attrval;
    int    i, len;
    len = nodelist.getLength();
    for (int j=0; j < len; j++) {
                element = (Element)nodelist.item(j);
                System.out.println(element.getTagName() + ":");
                nnm = element.getAttributes();
            if (nnm != null) {
                for (i=0; i<nnm.getLength(); i++) {
                    node = nnm.item(i);
                    attrname = node.getNodeName();
                    attrval  = node.getNodeValue();
                    returnValue += attrname + " = " + attrval + "##";
    // 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;

Maybe you are looking for

  • Dictation is not working on my iMac, Please help!

    Any help guys?, I have had my Intel i5 iMac (27") for just over a week now, I've just recently found out that my Mac actually has built in dictation software from Apple pre-installed and I thought this was great, but it has randomley just decided tha

  • Has anyone tried this? AutoMailMerge Plug-in for Adobe Acrobat

    Mail Merge in Acrobat 9 Professional? Hi, All! I have been told that I can perform a mail merge similar to MS Word from within Acrobat Pro 9. The main document (with merge type fields) needs to be an Acrobat .pdf. The data source can come from an ext

  • Installing AS Java in a multihomed server environment

    Hi SDNers, We are about to install a BI, EP and SCM Development environment and we're considering using a server network to handle the communications between the servers so that it doesn't 'hit' the client network. I read an old SAP Network Integrati

  • Aluminum Cordless Keyboard Loses Bluetooth Connectivity to iMac 24" 2.4ghz

    I sent my keyboard that came with my iMac back to  for a replacement it was a cordless Aluminum Keyboard it would lose it's connection with my iMac's BT or did the iMac lose it's Bluetooth ? I now have a new keyboard same type cordless Aluminum and

  • I have lost right click - auto open in new tab

    When I right click a link I used to get the page opened in a new tab automatically, this stopped several updates ago. I have been trying to fix it but have had no joy. There is a solved problem on the forum but I don't run any of the addons that seem