Академический Документы
Профессиональный Документы
Культура Документы
This session will not show how to develop mapping programs. It is assumed that the audience already possesses the knowledge to develop mapping programs. This session will show the mapping service provided in XI, how to best develop mapping programs to minimize performance problems, and how to troubleshoot mapping programs.
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Receiver Determination
IS Pipeline
Repository Test
PCK
You can execute mappings in the Repository, PCK, Simulation Tool in the Directory, IS Pipeline, BPM, Dynamical Receiver Determination.
They all use the same Mapping Runtime Service
Receiver Determination
IS Pipeline
Repository Test
PCK
Remarks: You have to activate objects before you can test them in the Directory Simulation 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 can depend on the XML source document.) Dynamical Receiver Determination (SP 16): The Receiver Determination calls a mapping whose result XML contains the list of receivers.
Sender Interface
Receiver Interface
Mapping of Response
Mapping Objects
Directory Interface Determination
configuration: which mapping for which message?
These are the objects that are relevant for the pipeline services to work. They are copied into the runtime cache at activation time. The implementation of the Mapping Runtime is divided into two parts on the ABAP and Java stack of the Integration Server. The cache is also devided into an ABAP and Java part. Interface Determinations and Interface Mappings are in the ABAP cache. Message Mappings and Imported Archives are in the Java cache.
SAP AG 2005, XI Mapping Troubleshooting - 8
Message Mapping
definition of the mapping, and generated Java code
Mapping Archive
contains the implementation of self-written Java and XSLT mappings
JCO
ABAP Stack
Sender Interface
Receiver Interface
The Interface Determination looks up the receiver interface in the 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 of this Interface Mapping in the ABAP cache:
mapping type (XSLT / Java / ...) program name
The Java Mapping Runtime loads the program from the Java Cache and executes it.
Sender Interface
Receiver Interface
JCO
Sender Interface
Receiver Interface
No Mapping Configured
Java Cache
Programs from Message Mappings and Mapping Archives It is not an error if there is no Interface Determination for a message the message is processed without changing the interface name, and without mapping. Trace entry: no mapping configured.
JCO
Sender Interface
Receiver Interface
RELATION NOT UNIQUE Old cache entries were not deleted. Cache contains old and new entries simultaneously. The select of the Interface Determination has no unique result. OSS message 81662 2006, Note 923068
JCO
Sender Interface
Receiver Interface
The cache refresh for a single object can also be triggered on the Administration page > Cache Overview > Select the object type Interface Mapping Message Mapping Imported Archive MAPPING XI_TRAFO TRAFO_JAR
> Enter object ID and the ID of the software component version > Refresh Object
SAP AG 2005, XI Mapping Troubleshooting - 16
... or in the Repository: 1. Open the Interface Mapping > Info button > Object ID, 2. Open the SWCV > key tab > GUID
SAP AG 2005, XI Mapping Troubleshooting - 17
Planned Improvements
It is possible that mappings are not found temorarily around the time a cache refresh is done. The cache refreshes the mapping program 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 each message. The Java classloaders and XSLT transformer are used. This should prevent this error. Planned improvements: Minimize time between delete and insert during the exchange of the mapping program. Do not cache more objects than necessary. (After an import of an SWCV, the objects of overlying SWCVs are unnecessarily cached.)
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Pipeline infrastructure. Mapping step is executed via JCo from R/3 system.
Java VM
- Mapping program is loaded from java archive. - It also can use other archives from the same SWCV
Source payload
Result payload
To execute a mapping program the source payload and the header parameters map are necessary. This map also contains an instance of AbstractTrace object which can be used to write application logs. This logs can be found in the message monitor (sxmb_moni transaction) afterwards.
Source payload
Result payload
If the scenario uses several steps mapping, these mappings are executed in one JCo call and the intermediate payload is not persisted. You cant find it in sxmb_moni transaction.
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Even well tested mappings might fail at runtime Main reason: message instance not compliant with xml schema definition Use testing mode of the graphical mapping editor to examine the problem
Why?
To isolating the problem from other components influence Avoid customer system connection problems Usually SAPs capabilities to debug the scenario are much better then at the customer site. We are not always able to play around with the customer systems. If the scenario executed at SAP doesnt work the same way as on the customer system it means that it is SP or configuration problem.
Export to file
- Export button exports the mapping, source and target structures, byte code and java source code to *.xim file which can be saved to a file system. - Import button is available only for newly created message mapping objects and imports source 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 new message mapping, import the *.XIM file and replace source and target structures with original ones.
To save a payload to a file system go to XML Messages menu and choose Download window 2
If the original message was retrieved based on some search criteria like time stamps or XI message processing status, please attach the exact XI message ID to the customer message to exclude misunderstandings. Sometimes the same scenario was processed several times with different payloads and the exact message is needed to detect the problem.
Open the Integration Builder Search for the same Interface-Mapping name.
In the interface mapping you can navigate to the used mapping by double clicking the mapping name
The next difference is that in the test mode the mapping is executed on the J2EE server running repository and not a runtime server. In most cases the result is the same. The difference can occur if the mapping program uses ValueMapping, self defined functions that access database, RFC calls, use system specific data or custom deployed J2EE libraries.
The probability that the mapping uses sender or receiver function is quite low. Value Mapping is used much more intensively.
If the import statement contains com.sap.mw.jco.* it shows that the mapping uses JCo calls that can also cause performance problems if this function is executed too many times.
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Performance bottlenecks
Common reasons
Value mapping Sorting fields in user defined functions DB lookups in user defined functions RFC lookups in user defined functions
File size doesnt cause a performance problem for the Message Mapping itself (it might be a problem for XSLT or Java mapping). The processing time for 20 Mb source file is less than 40 sec for standard desktop hardware. Large files may cause problems for the whole infrastructure but message mapping processing time is not a bottleneck in this case. According to our customer feedback XI can process files of 120Mb including message mapping without problems within minutes.
Excluding the ValueMapping one can safely refer the performance problem as a consulting issue ( Consulting: Question on product or function/User error/Customizing)
Memory consumption
Keywords
java.lang.OutOfMemoryError this line always indicates that there is a memory consumption problem in the scenario.
Common reasons
Source payload size Target payload size User errors, imported archives
Usually when the message size is only 10Mb and still gets OutOfMemoryError. Then, in such cases the scenario might include the module processor that converts plain file into XML structure during AdapterEngine processing. After conversion the payload can grow up to 1020 times.
Memory consumption
Simple example
Plain text file:
Name;Firstname;Address;City;Country;Tel;Properties;Email Name;Firstname;Address;City;Country;Tel;Properties;Email Clooney;George;AnyStreet Clooney;George;AnyStreet 1;;USA;+01/23451/89876;;George.Clooney@emergency.room 1;;USA;+01/23451/89876;;George.Clooney@emergency.room Graham;Heather;;;;; Graham;Heather;;;;; Picard;Jean-Luc;Room next to the bridge of the USS Enterprise;;;;"He's the Picard;Jean-Luc;Room next to the bridge of the USS Enterprise;;;;"He's the Captain ofCaptain Enterprise !!!";Jean-Luc.Picard@enterprise.uss the USS of the USS Enterprise !!!";Jean-Luc.Picard@enterprise.uss
XML representation:
Memory consumption
Target payload size
Although 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 cant be processed successfully the message should be redirected to SAP support.
Memory consumption
Perform the same operations with the target tree. Now you can compare the source and target file sizes
Problem types
Consulting Keywords:
how to mapping produces wrong result Cannot produce element exception result is empty mathematical/arithmetical operation errors StreamTransformationException
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.
If the problem is reproducible with a different XI system this message should be forwarded to SAP support including all these data. If it is not reproducible with a different XI system it might be SP or client configuration problem.
Consulting messages
Consulting messages checklist Problem description If the problem concerns the mapping itself (how to map something or mapping produces wrong result or cannot produce element problem) Export existing mapping.xim file Source payload for testing desirable result description
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.
Replace context string, srcSchema, dstSchema, srcAgency and dstAgency with those one used in the ValueMapping function Add com.sap.aii.mapping.value.api.* import statement Replace ValueMapping function with this newly created one
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
Big IDOCs
The problem:
If the IDOC structure is large enough the Mapping needs up to 10-30 seconds to load it depending on the hardware.
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 consume several times more memory than the structure itself)
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.
Arithmetic operations
The problem: When using standard functions for adding, subtracting or multiplying values, the result is usually truncated. As the mapping runtime uses float java type for built in arithmetic functions, and this is a restriction of the java platform. The workaround: To make precise calculations, a user-defined function needs to be created which will use a BigDecimal 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(); }
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Mapping Overview and Service Mapping during Runtime Mapping Troubleshooting Common Problems XSLT vs. Message Mapping Multi Mapping
Message Splits
There are different ways to do message splits: You can configure more than one inbound interface in the Interface Determination. In this case, there is no multi mapping involved. 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.
Outbound
Mapping 1
Inbound 1
Outbound
Mapping 2
Inbound 2
Outbound
Mapping 3
Inbound 3
Split Mapping S
Split Mapping S
Split Mapping
Determines a split mapping, but no receiver interfaces. The receiver interface is set to a constant (InterfaceCollection).
Inbound 2
The result messages of the split mapping are bundled into a socalled bulk message. Therefore all these messages must be sent to the same adapter engine, and there are restrictions regarding the adapter type.
Bulk message
Interface B
Even the bulk mesage has a message header and therefore an interface name. As the child messages can have different interfaces, there is no canonical candidate for the interface of the bulk message. Therefore, bulk messages always have a constant interface name (InterfaceCollection).
Interface C
In case of only one result message, we create an ordinary message, not a bulk with only one child message.
Known Issue: Note 878943 The name of the receiver interface is wrong if the split mapping produces only one result message.
BPM Trace
Transaction SWI1
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 was growing. The issue is solved in note
930354.
XI part
application part
Mapping
IS Pipeline / BPE
Mapping Runtime
Create Multi XML Split Multi XML Multi XML multi multi
Mapping
Application Mapping
multi
Mapping Runtime
Create Multi XML Split Multi XML
XI message with normal payload expected, but the source XML is already in multi XML format.
multi multi
Mapping
Application Mapping
Mapping Runtime
Create Multi XML Split Multi XML
multi
Mapping
Multi XML expected, but the customer mapping produced ordinary XML. Afterwards, the split failed.
Application Mapping
IS Pipeline / BPE
Multi Mappings consisting of a sequence of steps did not work. Solved in note 842070. Only the first step of the sequence was executed.
Mapping Runtime
Create Multi XML Split Multi XML
multi
multi
Mapping
Application Mapping
Your Turn!
Q&A
William Li
william.li@sap.com