cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced functions,UDF's and node function

Former Member
0 Kudos

Dear all,

Can you kindly let me know about Advanced functions,UDF's and node function.Differences and Uses.

Also Let me know about the advantages,Disadvantages of Graphical,XSLT,Java,ABAP and ABAP XSLT mappings.

Thanks,

Srini

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srinivas,

Can you kindly let me know about Advanced functions,UDF's and node function.Differences and Uses.

There are two types of UDF

1)Simple UDF

http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm

2)Advance UDF

http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/content.htm

Node functions:

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

/people/stefan.grube/blog/2006/01/09/the-use-of-suppress-in-the-xi-30-graphical-mapping-tool

Also Let me know about the advantages,Disadvantages of Graphical,XSLT,Java,ABAP and ABAP XSLT mappings

check here.. adavatage and performance of diffrent mappings

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

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.

Regards

Biplab

***Close the thread if u get ur answer******

Answers (1)

Answers (1)

aashish_sinha
Active Contributor
0 Kudos

Hi,

The term Mapping means:

1. The transformation process, and/or

2. The transformation rules.

Independently from XI, you can distinguish two different mappings

• Structure mappings transform entire message structures.

• Value mappings transform values within messages.

Mapping Programs to Map Messages :

Message Mapping

Designed by using the graphical mapping editor of Integration Builder

Result: Generated Java Code.

Imported Archives

Import externally defined mapping programs into repository

Java mapping:

Implemented by using a specific interface

XSLT mapping:

Runtime supports XSLT processor

Java methods can be called from within a Style Sheet

ABAP Mapping

You can execute mapping programs in a sequence

The exchange infrastructure supports three types of mappings:

Message mappings that can be designed using a graphical mapping editor in the Integration Builder. As a result, Java code is generated from the graphical representation that is compiled before it can be executed on the integration server.

You can implement your own Java mapping by implementing a specific interface of the mapping API.

You can implement an XSLT mapping

For the latter two, there is no tool support in XI. It is expected that they are developed using external development tools. To make them available for the integration server, they have to be imported into the integration repository as JAR

files before (JAR: Java Archives).

Developers can even decide to combine the different mapping technologies:

Message mappings, XSLT mappings and Java mappings can be combined in a sequence by means of an interface mapping.

XSLT mappings can use java functions

Message mappings support user-defined functions that can use imported java packages of the same namespace.

In SAP XI, there is 3 types of mappings. Namely

XSLT Mapping

Java Mapping

ABAP Mapping

Here is the details of each mapping.

XSLT Mappings (ABAP Engine)

Interface descriptions are in the form of XML documents. XSL Transformation (XSLT) is a member of the XML family of languages. It describes how an XML structure is transformed into another XML structure.

Customers can develop an XSLT mapping by using the Transformation Editor of the ABAP Workbench. Such XSLT mappings are executed at runtime on the ABAP Engine of the Integration Server.

To simplify matters, this section refers to XSLT mappings of the ABAP Engine as transformation programs to differentiate them from XSLT mappings from imported archives that are executed on the J2EE Engine.

Features

XPath and <xsl:include>

You can define mappings using XSLT together with XPath. XPath is also a specification of the XML family. Using XPath you can address any node in an XML document. XSLT implements XPath expressions to select substructures of an XML document. Using templates in XSLT you can define the mapping rules for the selected substructures.

You can use the XSLT tags <xsl:include> and <xsl:import> to include predefined templates for substructures in a complete mapping definition. In this way, you can reuse mappings for data types.

Java Mapping

You can implement mapping programs in Java. To process XML documents, use Java API for XML Processing (JAXP), for example. The JAXP supports the Document Object Model (DOM) and the Simple API for XML (SAX). This gives you great flexibility for mapping definitions with Java.

Implementation Considerations

Java mapping programs are not permitted to be stateful. You are therefore not permitted to perform actions such as writing data to a database table during a Java mapping. The Integration Server cannot track such side effects. Therefore, if an attempt is made to resend a message that has not been received by the receiver, the data may inadvertently be written to the database twice in a Java mapping.

If you use JRE classes in your Java mapping programs then the same program restrictions apply as for Enterprise Java Beans (EJBs). For a detailed description of these restrictions, see the relevant EJB specification. It is important that you also refer to the information under Scope of Functions in Runtime Environment (Java Mappings).

The runtime environment for Java mappings has an mapping API. To use Java mapping, you must define a Java class that implements the Java interface com.sap.aii.mapping.api.StreamTransformation. This interface has two methods:

&#9679; public void execute(java.io.InputStream in, java.io.OutputStream out)

At runtime, the Integration Engine calls this method to execute a mapping. This method contains an input stream for the source document and an output stream for the target document as parameters. These streams are usually XML documents. You can import the substructures to be converted from the input stream and output the converted target document in the output stream.

&#9679; public void setParameter(java.util.Map param)

The Integration Engine transfers parameters to the mapping program with this method. It evaluates these parameters at runtime in the method execute(). This enables you to control the process flow of the mapping.

The transferred object that implements the Java interface java.util.Map contains seven key/value pairs as parameters. These correspond to corresponding fields in the message header. Apart from the MAPPING_TRACE constant, the value objects are of type java.lang.String. The key objects are defined in the class com.sap.aii.mapping.api.StreamTransformationConstants

ABAP Mappings

ABAP mappings are mapping programs in ABAP objects that customers can implement using the ABAP Workbench.

Features

An ABAP mapping comprises an ABAP class that implements the interface IF_MAPPING in the package SAI_MAPPING.

Exception: CX_MAPPING_FAULT

Applications can decide themselves in the method EXECUTE how to import and change the source XML document. If you want to use the XSLT processor of SAP Web AS, you can use the ABAP Workbench to develop a stylesheet directly (see XSLT Mappings (ABAP Engine)) rather than using ABAP mappings.

Runtime Constants

In ABAP mapping you can read access message header fields. To do this, an object of type IF_MAPPING_PARAM is transferred to the EXECUTE method. The interface has constants for the names of the available parameters and a method GET, which returns the respective value for the parameter name. The constants are the same as in Java mappings, although the constant MAPPING_TRACE does not exist for ABAP mappings. Instead, the trace object is transferred directly using the parameter TRACE of the method IF_MAPPING~EXECUTE

Example: Accessing a Runtime Constant

Method IF_MAPPING~EXECUTE.

Get mapping constant SENDER_SERVICE

data: l_sender_service type string.

l_sender_service = param->get( IF_MAPPING_PARAM=>SENDER_SERVICE ).

ENDMETHOD.

These r excellent websites which contain PPT & PDF documents on mapping:

Excellent PDF Document on Mapping

http://help.sap.com/bp_bpmv130/Documentation/Operation/MappingXI30.pdf

Mapping Development with the ABAP Workbench

http://help.sap.com/saphelp_nw04/helpdata/en/10/5abb2d9df242f6a62e22e027a6c382/content.htm

ABAP Mappings

http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm

how to create a flat file out of an IDoc-XML by means of an ABAP mapping program and the J2EE File Adapter.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

How to Use ABAP Mapping in XI 3.0

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4...

Hope this will help you, and don't forget to close this thread.

Regards

Aashish Sinha

PS : reward points if helpful