Skip to Content
avatar image
Former Member

Mapping lookups - RFC API

Hi

I have cr8ed rfc lookup in UDF,and I want to parse this xml and use only the value I need

I read in the forum that there are 2 ways of doing it :

DOM and SAX

any1 knows good weblogs/threads which ellaborates on how or explain how it should b done ?

thx,Shai

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 13, 2006 at 04:17 PM

    HI,

    For Mapping Lookups~

    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer

    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups

    Hope this helps,

    Moorthy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 13, 2006 at 04:24 PM

    Hi Shai,

    This blog and article deals with calling your RFC from your JAVA MAPPING / User Defined Function.

    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

    And now going to the next half of your question regarding SAX and DOM parsers....

    The user defined functions that you write in your Graphical Mapping has nothing to do with Java Mapping.

    In your Graphical Mapping, the parsing of source structure is handled interannly by XI.

    But, when you go for an explicit mapping technique like Java Mapping, you have to parse the source XML structure, so that you can write the logic for your mapping.

    Java Mapping will execute a method called Execute, that will take the source XML structure as the Input Stream and then, you have to parse the Input STream and to do this parsing, you use SAX or DOM parser.

    DOM processor loads the entire XML into the memory and is processor intenseive, SAX does it element by element and so is not processor intensive.

    If you are using SAX parser, there are 5 methods . They are:

    1) Start of the document(startDocument)

    2) start of the element(startElement)

    3) end of the element(endElement)

    4) end of the document(endDocument)

    5) chars()

    Also check with any java site about SAX events how it works etc.

    Java Mapping

    http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm

    DOM parser API

    http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html

    On how to create XML docs with SAX and DOM go thruugh these links:

    http://www.cafeconleche.org/books/xmljava/chapters/ch09.html

    http://www.cafeconleche.org/books/xmljava/chapters/ch06.html

    Also go through these Blogs....

    /people/prasad.ulagappan2/blog/2005/06/08/sax-parser

    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-i

    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-ii

    /people/prasad.ulagappan2/blog/2005/06/29/java-mapping-part-iii

    I hope this helps...

    Regards,

    Abhy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 14, 2006 at 07:56 AM

    Thx Abhy for your detailed answer

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Shai 😊

      You need to import the packages that contains the class you need to use. You also need to have the relevant jar files in you enviroment.

      Are you using the developer studio?