cancel
Showing results for 
Search instead for 
Did you mean: 

Why xslt mapping?

Former Member
0 Kudos

I just want to know in what kind of mapping requirements we can go with xslt mapping which is not supported in graphical mapping?

Please help me with few mapping requirements which is not supported in graphical mapping but we can achive using xslt mapping.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Usally we use graphical Mapping in rare cases like were the occurence of the Target is 0..1 and we want to repeat that target node as 0..unbounded then we have to go with XSLT mapping,U can say that we can use Node funtions for this but for perticular senarios were node funtions cant be used and we have to go for XSLT mapping.

In my project we have doen one interfaces using XSLT mapping were the requirement is Source node repeting 0 ..unbounded and target level the node is 0..1,there we have to use the XSLT mapping.

some links on XSLT mapping.

/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

Regards,

phani Reward points if Helpful

Former Member
0 Kudos

Hi serach in SDN you will get everything ,...

anyways refer these links

A few example in which an XSLT mapping can be used:-

When the required output is other than XML like Text, Html or XHTML (html displayed as XML)

When default namespace coming from graphical mapping is not required or is to be changed as per requirements.

When data is to be filtered based on certain fields (considering File as source)

When data is to be sorted based on certain field (considering File as source)

When data is to be grouped based on certain field (considering File as source)

Advantages of using XSLT mapping

XSLT program itself defines its own target structure.

XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.

XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.

File content conversion at receiver side can be avoided in case of text or html output.

Multiple occurrences of node within tree (source XML) can be handled easily.

XSLT can be used in combination with graphical mapping.

Multi-mapping is also possible using xslt.

XSLT can be used with ABAP and JAVA Extensions.

Disadvantages of using XSLT mapping

Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).

Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.

XSLT mapping requires more memory than mapping classes generated in Java.

XSLT program become lengthier as source structure fields grows in numbers.

XSLT program sometimes become complex to meet desired functionality.

Some XSL functions are dependent on version of browser.

Follow these links.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb9...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8...

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae...

Some scenarios

/people/sap.user72/blog/2005/03/15/using-xslt-mapping-in-a-ccbpm-scenario

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

The following links give u step-by-step solution for XSLT mapping:

Generic XSLT Mapping for SAP XI,Part I

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2e...

Generic XSLT Mapping for SAP XI,Part II

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923...

XSLT: Recursive Templates

/people/udo.martens/blog/2006/04/26/xslt-recursive-templates

Easy RFC lookup from XSLT mappings using a Java helper class

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/05a3d62e-0a01-0010-14bc-adc...

Regds

Abhishek

Former Member
0 Kudos

Hi Suresh,

It can be used to transform

• XML to XML - From one XML data format to another

• XML to Text

• XML to HTML/XHTML

• XML to PDF

How is XSLT mapping different from Graphical, Java and ABAP mapping?

Graphical mapping is a common approach followed by everyone for generating desired target structure. It involves simple drag-n-drop to correlate respective nodes (fields) from source and target structure. It hardly involves coding. (Exception – User defined functions). But sometimes with graphical mapping it is difficult to produce required output. For example … text/html output, namespace change, sorting or grouping of records etc. A person comfortable with Object Oriented ABAP can go for ABAP mapping instead. One can also think of Java mapping as another option but it is a bit complex and required knowledge of Java. In such cases, XSLT mapping can be the best approach to meet the requirements.

A few example cases in which an XSLT mapping can be used:-

&#61692;When the required output is other than XML like Text, Html or XHTML (html displayed as XML )

&#61692; When default namespace coming from graphical mapping is not required or is to be changed as per requirements.

&#61692; When data is to be filtered based on certain fields (considering File as source)

&#61692; When data is to be sorted based on certain field (considering File as source)

&#61692; When data is to be grouped based on certain field (considering File as source)

Advantages of using XSLT mapping

&#61692; XSLT program itself defines its own target structure.

&#61692; XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.

&#61692; XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.

&#61692; File content conversion at receiver side can be avoided in case of text or html output.

&#61692; Multiple occurrences of node within tree (source XML) can be handled easily.

&#61692; XSLT can be used in combination with graphical mapping.

&#61692; Multi-mapping is also possible using xslt.

&#61692; XSLT can be used with ABAP and JAVA Extensions.

Thnx

Chirag

Former Member
0 Kudos

Thanks for the information. It is really helpful.

Q1.Can you please explain the procedure how to filter or sort the data using xslt mapping which you have come across while creating any scenario and

Q2.what would be the general requirement of the client inorder to filter or sort the data.

Thanks in advance.

Suresh.