cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA Mapping

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Frnds,

Can anyone explain when we will go for JAVA Mapping.

??

Regards,

Raja Sekhar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

Usually Java mapping is preferred when the target structure is relatively complex and the transformation cannot be accomplished by simple graphical mapping.

For e.g. consider a simple File->IDoc scenarion where the source file is a simple XML file, whereas the target file is an IDoc with more than one hierarchy level e.g FINSTA01. Content conversion in XI can only create a single level hierarchy, so in this scenario a Java mapping would come in handy.

See these:

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

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10dd67dd-a42b-2a10-2785-91c40ee5...

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

/people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs

Thanks,

Vijaya

Answers (7)

Answers (7)

rajasekhar_reddy14
Active Contributor
0 Kudos

thank you guys..

Former Member
0 Kudos

Hi,

Graphical Mapping are perdefined functions, when we are not able to reach out the functionality with the avaliable functions then we will going for java mapping to built our own functionallity

Regards

Noel

Former Member
0 Kudos

Hi,

For an overview:

http://help.sap.com/saphelp_nw04/helpdata/en/d2/58cd3b11571962e10000000a11402f/frameset.htm

To know which mapping is to be used:

Please Refer the following blogs also.

/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/mapping%2btechniques

Reward points if it is helpful.

Thanks,

Radhika.

Former Member
0 Kudos

Hi Raja Sekhar,

Java mapping can be used when you have complex mapping structures.

Java Mapping

1)Flexiblity of Java programing language

2) java mapping program is responsible for parsing/rendering XML

We can do most of the times for our requirements through Graphical mapping. When the structures are very complex to build you can go for SAX (Simple API for XML) or DOM (Document Object Model) parsers.

Chk out the links below for details:

Message mapping internally generates DOM parser.

Java Mapping in XI

https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=java+mapping&adv=false&sortby=cm_rn...

SAP Network Blog: Implementing a Java Mapping in SAP PI

/people/carlosivan.prietorubio/blog/2007/12/21/implementing-a-java-mapping-in-sap-pi

Java Mapping (SAP Library - Partner Connectivity Kit)

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

SAP Network Blog: XI Java Mapping Helper (DOM)

/people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom

SAP Network Blog: Testing and Debugging Java Mapping

/people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio

Binary Conversion in XI - Java Mapping - Code Gallery - Wiki

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava...

SAP Network Blog: "JAVA MAPPING", an alternate way of reading a CSV file

/people/rahul.nawale2/blog/2006/07/18/java-mapping-an-alternate-way-of-reading-a-csv-file

Kanan

Former Member
0 Kudos

HI

We go for JAVA Mapping when ever the Scenario is very Complex and Very Complicated.

The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming, from desktop applications to Java EE applications.

For e.g.

SAX and DOM parsers for Java Mapping.

SAX: Simple API for XML(API:Application Programming Interface)

DOM:Document Object Model

We use SAX and DOM parsers for reading and building the file.

Just have a look at these links:

For JAVA mapping:

cheers

Edited by: vemuganti naga phalguna on Jun 19, 2008 11:53 AM

Former Member
0 Kudos

Hi Raja shekhar,

Java mapping is used when the functionality offered by graphical mapping does not suffice the requirement.

U would use a Document object module (DOM) parser SAX parser (Simple API for XML) where ur output xml that is the message after mapping is to be generated .

For simplicity consider graphical mapping where for every target xml structure a source is mapped based on certain condition,but in java mapping u will be able to generate the target structure without checkin the src structure..

Hope it helps

Former Member
0 Kudos

Hi,

When to use Java mapping

*******************************

1) Java mapping are used when graphical mapping cannot help you.

Advantages of Java Mapping

*********************************

1)you can use Java APIs and Classes in it.

2) file look up or a DB lookup is possible

3) DOM is easier to use with lots of classes to help you create nodes and elements.

Java mapping can be used when you have complex mapping structures.

We can do most of the times for our requirements through Graphical mapping.

When the structures are very complex to build you can go for SAX (Simple API for XML) or DOM (Document Object Model) parsers.

Message mapping internally generates DOM parser.

We can find some help form the following links

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

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

As far as I know when you use the XI API (com.sap.aii.mapping.api, etc...) for Java mapping, you are implicitly using the internal XML parser used by XI. i.e. SAX.

However, if you choose to write your own custom Java mapping classes, then you are free to define which XML parser you want to employ.

Regarding when to use which parser; I always use the following rule of thumb:

If your XML implementation requires to navigate the XML document back and forward and performs extensive searching/matching routines, then I go for DOM. Simply because it is more flexible for this kind of operations and allows you to keep data in memory and if necessary replace/update data in your XML source.

SAX works differently, actually it does not keep your XML tree data in memory. Because of this difference SAX is much more efficient and faster than DOM, but you are not able to freely navigate your XML structure or change the XML source as is in DOM. Of course there are workarounds that allows you to perform this things in SAX, however the API is not written for this purpose.

Thanks,

RamuV