mapping runtime

84
SAP NetWeaver Exchange Infrastructure Mapping Troubleshooting William Li SAP NetWeaver RIG Americas

Upload: durga-gidugu

Post on 12-Oct-2014

149 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Mapping Runtime

SAP NetWeaver ExchangeInfrastructure MappingTroubleshootingWilliam Li

SAP NetWeaver RIG Americas

Page 2: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 2

XI Mapping Troubleshooting – Goals of the Session

At the end of this session:Understand the mapping architecture withinExchange Infrastructure.Be able to determine the best practice duringmapping development.Resolve possible mapping problems duringdevelopment and runtime.

Page 3: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 3

XI Mapping Troubleshooting – A Brief Introduction

This session will not show how to develop mapping programs. Itis assumed that the audience already possesses the knowledgeto develop mapping programs.

This session will show the mapping service provided in XI, how tobest develop mapping programs to minimize performanceproblems, and how to troubleshoot mapping programs.

Page 4: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 4

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 5: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 5

Places where mappings can run

ccBPMTransformation

Step

ReceiverDetermination

DirectorySimulation Tool Repository

TestPCK

Mapping Runtime Service

IS Pipeline

Mappings can run not only in the pipeline of the Integration Server...

You can execute mappings in the

Repository,

PCK,

Simulation Tool in the Directory,

IS Pipeline,

BPM,

Dynamical Receiver Determination.

They all use the same MappingRuntime Service

Page 6: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 6

Places where mappings can run

ccBPMTransformation

Step

ReceiverDetermination

DirectorySimulation Tool Repository

TestPCK

Mapping Runtime Service

IS Pipeline

Remarks:

You have to activate objects before you can test them in the DirectorySimulation Tool. Otherwise, the objects are not in the runtime cache.

If a mapping test is successful in the Repository, but fails at runtime:usually the XML documents are different. (Whether or not a mapping fails candepend on the XML source document.)

Dynamical Receiver Determination (SP 16): The Receiver Determination calls amapping whose result XML contains the list of receivers.

Page 7: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 7

Pipeline Services on the IS (synchronous message)

SenderInterface Receiver

Interface

InterfaceDetermination

Mappingof Request

Mappingof Response

Executes requestmapping steps

Executes responsemapping steps

DeterminesReceiver Interface and

Interface Mapping

Page 8: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 8

RepositoryDirectory

Mapping Objects

Interface Determination

configuration: which mappingfor which message?

Interface Mapping

bundles mapping stepsof request and response

Message Mapping

definition of the mapping,and generated Java code

Mapping Archive

contains the implementation ofself-written Java and XSLT mappings

request

response

These are the objects that are relevant for thepipeline services to work.

They are copied into the runtime cache atactivation time.

The implementation of the Mapping Runtime isdivided into two parts on the ABAP and Javastack of the Integration Server. The cache isalso devided into an ABAP and Java part.

Interface Determinations and InterfaceMappings are in the ABAP cache.

Message Mappings and Imported Archives arein the Java cache.

Page 9: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 9

Runtime and Cache (a)

SenderInterface Receiver

Interface

InterfaceDetermination

Service

MappingRuntime Service

ABAP Stack

MappingRuntime Service

Java Stack

Java Cache

Programs fromMessage Mappings

and Mapping Archives

ABAP Cache

Interface DeterminationsInterface Mappings

JCO

12

3

Page 10: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 10

Runtime and Cache (b)

The Interface Determination looks up the receiver interface inthe ABAP cache. It also determines:

the ID of the Interface Mapping,the SWCV (software component version) of the Interface Mapping.

The ABAP Mapping Runtime looks up the mapping steps ofthis Interface Mapping in the ABAP cache:

mapping type (XSLT / Java / ...)program name

The Java Mapping Runtime loads the program from the JavaCache and executes it.

1

2

3

Page 11: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 11

Mapping Program Missing in the Java Cache

SenderInterface Receiver

Interface

InterfaceDetermination

Service

MappingRuntime Service

ABAP Stack

MappingRuntime Service

Java Stack

Java Cache

Programs fromMessage Mappings

and Mapping Archives

ABAP Cache

Interface DeterminationsInterface Mappings

JCO

RESOURCE NOT FOUND

Page 12: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 12

Interface Mapping is missing in the ABAP Cache

SenderInterface Receiver

Interface

InterfaceDetermination

Service

MappingRuntime Service

ABAP Stack

MappingRuntime Service

Java Stack

Java Cache

Programs fromMessage Mappings

and Mapping Archives

ABAP Cache

Interface DeterminationsInterface Mappings

JCO

NO MAPPING PROGRAM FOUND

Page 13: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 13

No Mapping Configured

SenderInterface Receiver

Interface

InterfaceDetermination

Service

MappingRuntime Service

ABAP Stack

MappingRuntime Service

Java Stack

Java Cache

Programs fromMessage Mappings

and Mapping Archives

ABAP Cache

Interface DeterminationsInterface Mappings

JCO

It is not an error if there is no InterfaceDetermination for a message – the message isprocessed without changing the interface name,and without mapping.Trace entry: „no mapping configured“.

Page 14: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 14

Interface Determination „not unique“

SenderInterface Receiver

Interface

InterfaceDetermination

Service

MappingRuntime Service

ABAP Stack

MappingRuntime Service

Java Stack

Java Cache

Programs fromMessage Mappings

and Mapping Archives

ABAP Cache

Interface DeterminationsInterface Mappings

JCO

RELATION NOT UNIQUE

Old cache entries were not deleted. Cachecontains old and new entries simultaneously.The select of the Interface Determination has nounique result.

OSS message 81662 2006, Note 923068

Page 15: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 15

Page 16: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 16

Cache of a single object (b)

The cache refresh for a single object can also be triggered on theAdministration page

> Cache Overview

> Select the object typeInterface Mapping MAPPINGMessage Mapping XI_TRAFOImported Archive TRAFO_JAR

> Enter object ID and the ID of the software component version

> Refresh Object

Page 17: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 17

Cache of a single object (c)

Object ID and SWCV ID of the Interface Mapping are in the runtime trace:

... or in the Repository:1. Open the Interface Mapping > Info button > Object ID,2. Open the SWCV > key tab > GUID

Page 18: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 18

Planned Improvements

It is possible that mappings are not found temorarily around thetime a cache refresh is done. The cache refreshes the mappingprogram at the same time when they should be read by the runtime.The consequence is a „resource not found“ exception.

The mappings in the runtime are not re-loaded each time for eachmessage. The Java classloaders and XSLT transformer are used.This should prevent this error.

Planned improvements:

Minimize time between delete and insert during the exchange ofthe mapping program.

Do not cache more objects than necessary. (After an import of anSWCV, the objects of overlying SWCVs are unnecessarily cached.)

Page 19: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 19

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 20: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 20

Overview of the message mapping runtime

Pipeline infrastructure.Mapping step is executed via JCo from R/3 system.

Page 21: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 21

Overview of the message mapping runtime

Java VM

Mapping programMapping program

- Mapping program is loaded from java archive.- It also can use other archives from the same SWCV

Page 22: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 22

Overview of the message mapping runtime

Mapping programMapping programSource payload Result payload

To execute a mapping program the source payload and the header parameters map arenecessary. This map also contains an instance of AbstractTrace object which can be used towrite application logs. This logs can be found in the message monitor (sxmb_moni transaction)afterwards.

Page 23: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 23

Overview of the message mapping runtime

Mapping programMapping programSource payload Result payload

If the scenario uses several steps mapping, these mappings are executed in one JCo call andthe intermediate payload is not persisted. You can’t find it in sxmb_moni transaction.

Mapping programMapping program

JavaVM

Page 24: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 24

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 25: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 25

Troubleshooting for Message Mapping

Even well tested mappings might fail at runtime

Main reason: message instance not compliant withxml schema definition

Use testing mode of the graphical mapping editor toexamine the problem

Page 26: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 26

What to do, if a Well Tested Mapping Fails at Runtime?

1. Download message payload from the Integration EngineMonitor (TA sxmb_moni)

2. Upload payload in the “Testing” tab of the concerned MessageMapping

3. When executing the test, you should get the same error asdisplayed in the Integration Engine Monitor (TA sxmb_moni)*

4. “Debug” your Message Mapping (display queue)

*) There might be slight differences as shown on the followingslides

Page 27: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 27

In test mode the mapping is executed on the J2EE serverrunning the repository (i.e. not the runtime server)

Message metadata is not filled automatically in the IntegrationBuilder, but can be set manually

Value mappings and look-ups are runtime specific

Difference of IB Test Mode and Runtime Execution

Page 28: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 28

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Import/export the message mapping using file systemUsing sxmb_moni transaction to get a real payloadDifference between IB test mode and real runtimeValueMapping, imported archives issues

Page 29: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 29

Import/export message mappings via file system

When we need help from SAP to resolve the problem, we must:

Objective1 get the export file for the message mapping

2 get a source payload used in the scenario

3 get a result payload after the mapping

Why?To “isolating” the problem from other components influence

Avoid customer system connection problems

Usually SAP’s capabilities to debug the scenario are much better then at the customer site. We are notalways able to play around with the customer systems.

If the scenario executed at SAP doesn’t work the same way as on the customer system it means that itis SP or configuration problem.

Page 30: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 30

Import/export message mappings via file system

1 Open the message mapping

2 put the cursor to “description” field

3 press CTRL+SHIFT+0 to open the “Technical info dialog”

4 This dialog also contains buttons to export/import the message mapping to/from the filesystem.

Export

to file

Page 31: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 31

Import/export message mappings via file system

- Export button exports the mapping, source and target structures, byte code and javasource code to *.xim file which can be saved to a file system.

- Import button is available only for newly created message mapping objects and importssource message, target message and mapping definition.

- If you exported and modified the mapping then you need to use the third button for import.This button loads only mapping definition leaving source and target structure intact.

- For lower support packages where the third button is not available one can create a newmessage mapping, import the *.XIM file and replace source and target structures withoriginal ones.

Page 32: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 32

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Import/export the message mapping using file systemUsing sxmb_moni transaction to get a real payloadDifference between IB test mode and real runtimeValueMapping, imported archives issues

Page 33: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 33

SXMB_MONI message monitor

Log in to the ABAP stack of XI.

Select sxmb_moni transaction.

Select “Monitor for Processed XML Messages”

Find a message using time stamp, message id

or processing status

Page 34: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 34

SXMB_MONI message monitor

Double click on the message to open a message processing log.

To save a payload to a file system go to “XML Messages” menu and choose “Download window 2”

Page 35: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 35

SXMB_MONI message monitor

You can copy the message ID to clipboard by setting the cursor at the “XML-Message” node andpressing CTRL+C

If the original message was retrieved based on some search criteria like time stamps or XI messageprocessing status, please attach the exact XI message ID to the customer message to excludemisunderstandings. Sometimes the same scenario was processed several times with differentpayloads and the exact message is needed to detect the problem.

Page 36: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 36

SXMB_MONI message monitor

How to find the mapping program from the trace

Go to the message processing monitor

Choose “Request Message Mapping” node

Choose “SOAP header/Trace” item

In the lower pane search for “Interface-Mapping” string (usually the last occurrence is valid)

Open the Integration Builder

Search for the same Interface-Mapping name.

Page 37: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 37

SXMB_MONI message monitor

Open the Integration Builder

Search for the Interface-Mapping.

In the interface mapping you can navigate to the used mapping by double clicking the mappingname

Page 38: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 38

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Import/export the message mapping using file systemUsing sxmb_moni transaction to get a real payloadDifference between IB test mode and real runtimeValueMapping, imported archives issues

Page 39: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 39

The main difference is the “Header parameters” map that is passed to the mapping program. Indesign time this map is filled with default values and to reproduce a runtime behavior one have toenter correct values into this map.

The next difference is that in the test mode the mapping is executed on the J2EE server runningrepository and not a runtime server. In most cases the result is the same. The difference can occur ifthe mapping program uses ValueMapping, self defined functions that access database, RFC calls,use system specific data or custom deployed J2EE libraries.

Difference of IB test mode and runtime execution

Page 40: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 40

By default header parameters are used only in several built-in functions such as “Sender”, “Receiver”and “Value Mapping”.

You can check if these functions are used using “where used” functionality

The probability that the mapping uses “sender” or “receiver” function is quite low. “Value Mapping” isused much more intensively.

Difference of IB test mode and runtime execution

Page 41: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 41

To send mapping problems to SAP, it is important to send the following information:

mapping.xim file

source payload

target payload (if exist)

XI message id that reveals this problem

problem description

Difference of IB test mode and runtime execution

Page 42: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 42

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Import/export the message mapping using file systemUsing sxmb_moni transaction to get a real payloadDifference between IB test mode and real runtimeValueMapping, imported archives issues

Page 43: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 43

ValueMapping, imported archives issues

If the mapping uses imported archives or ValueMapping usually it will be difficult to reproduce it at SAP forresolution. (Still it makes sense to provide as much information as possible because the problem may not berelated with them)

In case of performance problems, memory consumption issues or other questions, please send the sourcecode for imported archive, unless it is some standard library like apache or jdbc driver one.

To detect if the message mapping uses imported archives or special J2EE services one have to browseuser-defined functions and check import sections. If the import section contains an import statement thatdoes not start with “com.sap…” or “java…” – that’s a sign that the message mapping uses some third partycoding which can cause the problem.

If the import statement contains “com.sap.mw.jco.*” it shows that the mapping uses JCo calls that can alsocause performance problems if this function is executed too many times.

Page 44: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 44

ValueMapping, imported archives issues

ValueMapping usually cause only performance issues.

To detect if the ValueMapping is used in the mapping one can use WhereUsed functionality.

(just right click on the ValueMapping function)

Page 45: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 45

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 46: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 46

Performance bottlenecks

Common reasonsValue mapping

Sorting fields in user defined functions

DB lookups in user defined functions

RFC lookups in user defined functions

File size doesn’t cause a performance problem for the Message Mapping itself (it might be aproblem for XSLT or Java mapping). The processing time for 20 Mb source file is less than 40sec for standard desktop hardware. Large files may cause problems for the wholeinfrastructure but message mapping processing time is not a bottleneck in this case.According to our customer feedback XI can process files of 120Mb including messagemapping without problems within minutes.

Excluding the ValueMapping one can safely refer the performance problem as a consultingissue ( Consulting: Question on product or function/User error/Customizing)

Page 47: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 47

Memory consumption

“Keywords”

java.lang.OutOfMemoryError – this line always indicates that there is a memoryconsumption problem in the scenario.

Common reasonsSource payload size

Target payload size

User errors, imported archives

Usually when the message size is only 10Mb and still gets OutOfMemoryError. Then, in suchcases the scenario might include the module processor that converts plain file into XMLstructure during AdapterEngine processing. After conversion the payload can grow up to 10-20 times.

Page 48: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 48

Simple examplePlain text file: XML representation:

Memory consumption

Name;Firstname;Address;City;Country;Tel;Properties;EmailClooney;George;AnyStreet1;;USA;+01/23451/89876;;[email protected];Heather;;;;;Picard;Jean-Luc;Room next to the bridge of the USS Enterprise;;;;"He's theCaptainof the USS Enterprise !!!";[email protected]

Name;Firstname;Address;City;Country;Tel;Properties;EmailClooney;George;AnyStreet1;;USA;+01/23451/89876;;[email protected];Heather;;;;;Picard;Jean-Luc;Room next to the bridge of the USS Enterprise;;;;"He's theCaptainof the USS Enterprise !!!";[email protected]

Page 49: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 49

Memory consumption

Target payload sizeAlthough the source payload can be relatively small, but the output file can be much larger.

If the problem is occasional (sometimes the processing is successful and sometimes it fails)then it is necessary to check the “input size/output size” ratio based on successful mappings.

If the scenario can’t be processed successfully the message should be redirected to SAPsupport.

Page 50: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 50

Memory consumption

Calculating the input/output file size ratioGo to the test mode

Upload the source payload as a test instance

Run the mapping

Holding CTRL+SHIFT keys right click on the source structure andchoose “Tree info” menu item.

Perform the same operations with the target tree.

Now you can compare the source and target file sizes

Page 51: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 51

Problem types

Consulting

Keywords:

“how to”

“mapping produces wrongresult”

“Cannot produce element”exception

“result is empty”

mathematical/arithmeticaloperation errors

StreamTransformationException

Design time problems

Keywords:

“integration builderhangs/doesn’t respond”

<something> doesn’t work

Design time Internal error

“OutOfMemory” problem

“<something> to slow”

Runtime problems

Keywords:

mapping is too slow

OutOfMemory problem

ClassNotFound exception

Page 52: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 52

Runtime problems

Runtime problems checklist when sending problem to SAP

Problem description

XI SP number

Mapping reference (SWC, SWCV, name, namespace)

Exported mapping.xim file

Source payload

Target payload if the mapping produces wrong result

ValueMapping, RFC, JCo calls being used. Include the source for the imported archives.

After including these information, the message should be forwarded to the SAP support.

Page 53: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 53

Design time problems

Design time problems checklist when sending problem to SAP

Problem description

XI SP number

Mapping reference (SWC, SWCV, name, namespace)

Exported mapping.xim file

If the problem is reproducible with a different XI system – this message should be forwarded to SAPsupport including all these data.

If it is not reproducible with a different XI system – it might be SP or client configuration problem.

Page 54: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 54

Consulting messages

Consulting messages checklist

Problem description

If the problem concerns the mapping itself (how to map something or “mapping produces wrongresult” or “cannot produce element” problem)

Export existing mapping.xim file

Source payload for testing

desirable result description

Page 55: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 55

Known issues

ValueMapping performance problem

Changing the mapping type from 1:1 to split and merge mapping

Copying message types namespace issue

Big IDOCs design time performance problem

Split&Merge mappings – detecting a mapping problem

Arithmetic operations errors.

Page 56: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 56

ValueMapping performance problem

Workaround

Create a user-defined function that caches ValueMapping results

This is a simple function with one input argument

Replace “context” string, “srcSchema”, “dstSchema”, “srcAgency” and “dstAgency” with those one used in the ValueMappingfunction

Add com.sap.aii.mapping.value.api.* import statement

Replace ValueMapping function with this newly created one

Map map = (Map) container.getParameter("cache");if (map==null){map = new HashMap();container.setParameter("cache", map);}String res = (String) map.get(a);if (res!=null) return res;final String context = “http://sap.com/xi/XI”;final IFIdentifier src = XIVMFactory.newIdentifier(context, "srcAgency", "srcSchema");final IFIdentifier dst = XIVMFactory.newIdentifier(context, "dstAgency", "dstSchema");try {

res = XIVMService.executeMapping(src, dst, a);map.put(a, res);return res;

} catch (ValueMappingException e) {container.getTrace().addWarning("no ValueMapping found for ["+a+"]");map.put(a, a); //reuse value if nothing found

}return a;

Page 57: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 57

Changing the mapping type from 1:1 to N:M mapping

Changing messages types on the Messages tab causes loosing of all previously defined mapping. Ifone changes occurrences of the source or target message this message is wrapped with specialpredefined fields and after that the mapping is lost.

Workaround

Create a new mapping template based on mapping roots

Change the message mapping signature

Apply template mapping to your new structures

Page 58: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 58

Copying message type namespace issue

The problem:

After copying scenario to another namespace the mapping uses old namespace in its structure.

It is designed behavior and not a bug.

After copying of the message type the namespace of the new message type is inherited from the old object.You need manually to change the namespace of the new object.

Before copying After copying

Change this namespace to the new one.

Page 59: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 59

Big IDOCs

The problem:

If the IDOC structure is large enough the Mapping needs up to 10-30 seconds to load it depending on thehardware.

The solution:

Since SP12 there is a new function “export reduced IDOC structure”

If the big IDOC causes a problem in design time you can use reduced IDOC schema.

Export the IDOC to the file system

Use this IDOC as source or structure for the message mapping

(this function only removes documentation from schema. Sometimes the documentation can consumeseveral times more memory than the structure itself)

Page 60: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 60

Split and Merge mappings.

The problem:

During merge mapping the mapping runtime uses self-created new structure which contains specialtags like “Message1”, “Message2”, etc.

This merged payload is not displayed in the message monitor and if the customer has severalhundreds of messages as a source and the mapping runtime throws an exception – there is no wayto validate the merged payload and one have to validate each message one by one.

The most sensible solution is to install the latest support package.

Since SP16 mapping tool shows the full path of the field that causes a problem in the runtime.

Using this information it is more or less obvious in which source payload the problem occurred.

Page 61: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 61

Arithmetic operations

The problem:

When using standard functions for adding, subtracting or multiplying values, the result is usuallytruncated.

As the mapping runtime uses “float” java type for built in arithmetic functions, and this is a restrictionof the java platform.

The workaround:

To make precise calculations, a user-defined function needs to be created which will use aBigDecimal class.

For instance the “add” function can look this way: SP18 (Note 958486)

public String add(String a, String b){BigDecimal first = new BigDecimal(a);BigDecimal second = new BigDecimal(b);//first.subtract(second).toString();//first.multiply(second).toString();return first.add(second).toString();

}

Page 62: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 62

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 63: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 63

XSLT vs. Message Mapping

There is no official data regarding this issue because the message mapping tool is not a competitorfor the XSLT engine. Although it maps XMLs the idea is completely different. Message mappingneeds a target structure in design time and always produces valid XML. XSLT can transform XMLinto other formats, e.g. plain text file.

Still we have unofficial data from our customers who made some researches in this area. Similarmessage mapping and XSL stylesheet were used for testing.

The results are:The message mapping is comparable in performance to XSLT engine for small files.The message mapping processing time is linearly dependent on the file size.The XSLT mapping processing time progressively grows with the file size.For “structure lookup” in mapping, XSLT offers XPath expressions which are easy to use but for

large files it causes big performance problems. Message Mapping uses other paradigm with queuesand therefore it forces user to write mappings in “efficient” way)

For “1 to 1 copy” mapping, message mapping is 5-10% slower than XSLT, depending on thestructure.

For the mapping with some processing (field names are changed, functions are used, etc.), innormal scenarios, message mapping is 5-10% faster then XSLT for file sizes up to severalmegabytes.

Depending on the use case, message mapping is either faster or comparable to XSLT engine.

Page 64: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 64

XSLT vs. Message Mapping

The average processing time for the customer scenario graph:

Page 65: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 65

XSLT vs. Message Mapping

Memory consumption

• XSLT mappings – up to 40MB files are processed successfully• XI Message Mappings – 120MB was processed successfully. Then the Adapter Engine (file adapter)encountered a problem with the message size.

For XI Mappings the memory consumption also depends on the usage of “Context to Context” and “Queueto Queue” functions. If such functions are used then the whole source structure must be parsed beforestarting the mapping. Otherwise the message mapping works in “streaming” mode (record to record) whichneeds only up to 10-20 megabytes of memory.

Still the recommendation is to not use files larger than 20 MBs. If the source payload is larger, then it isbetter to use the message split scenario. It might be that there are some other jobs processing in the sameJ2EE engine and it is a bad practice to load the engine completely with one scenario.

Page 66: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 66

SAP XI Mapping Troubleshooting

Mapping Overview and Service

Mapping during Runtime

Mapping Troubleshooting

Common Problems

XSLT vs. Message Mapping

Multi Mapping

Page 67: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 67

Message Splits

There are different ways to do message splits:

You can configure more than one inbound interface in theInterface Determination. In this case, there is no multi mappinginvolved.

You can use a transform step in the BPE to split (or merge)messages.

Multi-mappings can be used to split messages in the pipeline.

Page 68: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 68

Several Inbound Interfaces – Configuration

Page 69: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 69

Several Inbound Interfaces – Runtime

OutboundInterfaceDetermination

Inbound 1

Inbound 2

Inbound 3

Mapping 1

Mapping 2

Mapping 3

MessageSplit

Outbound

Outbound

Outbound

Page 70: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 70

Split mapping in pipeline – Configuration (SP 14)

Page 71: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 71

Split mapping in pipeline – Runtime (SP 14)

SplitMapping S

InterfaceDetermination

Inbound 1

SplitMapping

NoMessage

Split

Inbound 2

SplitMapping S

Determines a split mapping,but no receiver interfaces.The receiver interface is set to aconstant („InterfaceCollection“).

Bulk messageThe result messages of the splitmapping are bundled into a so-called „bulk message“. Thereforeall these messages must be sentto the same adapter engine, andthere are restrictions regarding theadapter type.

Page 72: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 72

Split mapping in pipeline – Interface names

Known Issue: Note 878943

The name of the receiver interface is wrong if the split mapping produces only oneresult message.

Bulk message „InterfaceCollection“

Interface A

Interface B

Interface C

Even the bulk mesage has a message header andtherefore an interface name. As the childmessages can have different interfaces, there is nocanonical candidate for the interface of the bulkmessage. Therefore, bulk messages always have aconstant interface name („InterfaceCollection“).

In case of only one result message, we create anordinary message, not a bulk with only one childmessage.

Page 73: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 73

BPM Trace

Transaction SWI1

Page 74: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 74

BPM Trace – continued

Page 75: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 75

BPM Trace

OSS Message 184279 2006: Table SMPPXLOG is growing...

Mapping traces in the BPM are stored in table SMPPXLOG.

An event to delete these traces was not fired. As a consequence, the table wasgrowing.

The issue is solved in note 930354.

Page 76: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 76

Multi XML Format

Page 77: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 77

Multi XML Format

XI part

application part

Page 78: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 78

Split mapping internally

Mapping

CreateMulti XML

SplitMulti XML

Page 79: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 79

Split mapping internally

IS Pipeline / BPE

Mapping Runtime

Application Mapping

CreateMulti XML

Mapping

SplitMulti XML

XI message with normal payload

Multi XMLmulti multi

Page 80: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 80

OSS Message 944218 2005

IS Pipeline / BPE

Mapping Runtime

Application Mapping

CreateMulti XML

Mapping

SplitMulti XML

XI message with normal payloadexpected, but the source XML is

already in multi XML format.

multimulti

multi

Payload of XI message is already in multi XML format.

Page 81: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 81

OSS Message 1686867 2005

BPE

Mapping Runtime

Application Mapping

CreateMulti XML

Mapping

SplitMulti XML

multi

Multi XML expected, but the customer mappingproduced ordinary XML. Afterwards, the splitfailed.

BPM: Transformation step and N:1 XSLT mapping does not work

Page 82: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 82

Multi Mapping Sequences

Multi Mappings consisting of asequence of steps did not work.Solved in note 842070.

Only the first step of the sequencewas executed.

IS Pipeline / BPE

Mapping Runtime

Application Mapping

CreateMulti XML

SplitMulti XML

multi multi

Mapping

Page 83: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 83

[email protected]

William Li

Q&A

Your Turn!

Page 84: Mapping Runtime

SAP AG 2005, XI Mapping Troubleshooting - 84

No part of this publication may be reproduced or transmitted in any form or for any purpose without the expresspermission of SAP AG. The information contained herein may be changed without prior notice.Some software products marketed by SAP AG and its distributors contain proprietary software components of othersoftware vendors.Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries,pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks orregistered trademarks of IBM Corporation in the United States and/or other countries.Oracle is a registered trademark of Oracle Corporation.UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registeredtrademarks of Citrix Systems, Inc.HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium,Massachusetts Institute of Technology.Java is a registered trademark of Sun Microsystems, Inc.JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented andimplemented by Netscape.MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver and other SAP products and services mentioned hereinas well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several othercountries all over the world. All other product and service names mentioned are the trademarks of their respectivecompanies. Data contained in this document serves informational purposes only. National product specifications may vary.These materials are subject to change without notice. These materials are provided by SAP AG and its affiliatedcompanies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Groupshall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products andservices are those that are set forth in the express warranty statements accompanying such products and services, if any.Nothing herein should be construed as constituting an additional warranty.

Copyright 2005 SAP AG. All Rights Reserved