cancel
Showing results for 
Search instead for 
Did you mean: 

exceptions in mapping

Former Member
0 Kudos

hi friends,

pls help on this topic

How do u handle Exceptions in messagemapping

urs

ravi

Accepted Solutions (0)

Answers (2)

Answers (2)

aashish_sinha
Active Contributor
0 Kudos

Hi,

Exception in Message mapping :

- Depending on the standard function, the transferred values are converted to values applicable for the function using a data type conversion (a cast). If the value cannot be interpreted, the mapping runtime triggers a Java exception.

- If-clauses evaluate conditions that get Boolean values. Standard functions that return Boolean values return either a true or false string. Standard functions that expect Boolean values interpret the values”1” and ”true” (not case-sensitive) as true and all other values as false.

A message mapping refers to a mapping of messages; the procedure is supported by a graphical mapping editor. The editor enables you to design a structure mapping between any two XML structures and connect to a value mapping.

The mapping tool generates Java source code from the graphical mapping description, which is then compiled and packed in a JAR file that the Integration Engine executes at runtime.

The mapping editor can load the following schemas to the structure overview:

- A schema from the Integration Repository: (Fault) message types, IDocs, the request, response, or fault part of RFCs, and message structures from external definitions. The latter are message structures from WSDL, XSD, or DTD documents.

- XML schema definitions (XSD) or XML files from a local file

In the case of XSD files (the repository schemas also use this format); the mapping editor generates an XML representation for both the source structure and the target structure in each case. If the XSD file contains more than one global element, use a dialog box to select one global element as the root element.

If you want to load several XSD files that reference each other using the import and include XSD statements, you must first pack the files into a Zip file. If the file contains more than one global element, you must select one global element as the root element in this case as well.

You have the following options when defining a message mapping:

- The functions in the Object Toolbar relate to the entire mapping. For example, you can save your mapping or automatically assign fields with the same name to each other.

- When you create a new message mapping the Structure Overview in the mapping editor is initially empty. Here you must specify a repository schema for both the source structure and the target structure or import an XML or XSD file. The mapping editor imports the data and displays the XML representation for the mapping in the Structure Overview. In this screen area, the source structure is on the left and the target structure is on the right. Source structure fields then have to be mapped to target structure fields. You have various options for displaying the source and target structure (Tree View, Tabular Tree View, display as a text document, or display in the browser).

- The structure overview is closely linked to the Data-Flow Editor, which you use to describe the mapping of one or more source fields to one target field. This type of mapping is also referred to as a Target-Field Mapping. If a field in the target structure has already been mapped, you can navigate to the relevant mapping by double-clicking the corresponding target field in the structure overview.

Therefore, a message mapping comprises various target-field mappings. Once you have defined a mapping for each mandatory target field your message mapping is complete. To test your message mapping, navigate to the Test tab page.

Values of elements or attributes of the XML message (the payload) are technically speaking a string. Therefore, all standard functions that operate on field values expect string arguments and return a string value. Nevertheless, the transferred value can of course have a different data type semantically. This is the data type you specified when defining the schema for the payload for the field. The following is the standard procedure for standard functions:

· Depending on the standard function, the transferred values are converted to values applicable for the function using a data type conversion (a cast). If the value cannot be interpreted, the mapping runtime triggers a Java exception.

· If-clauses evaluate conditions that get Boolean values. Standard functions that return Boolean values return either a true or false string. Standard functions that expect Boolean values interpret the values”1” and ”true” (not case-sensitive) as true and all other values as false.

Please refer to this link to see exceptions and other possible functions.

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

Hope this will help you to understand Message Mapping and Also a bit of exceptions.

Regards

Aashish Sinha

PS : reward points if helpful

Former Member
0 Kudos

hi ravi,

in (graphical) mapping you can handle exceptions

a) in BPM. Insert a exception branch

b) using the alert framework. If a mapping throws an exception, an alert is triggert. You will be informed by the alert inbox

If you use JAVA-Mapping you can catch exceptions by surrounding a try-catch block. In this cases a special element in your target message should be given a value for e.g. ERROR. Now in receiver determination or interface determination configure a condition.

Regards Mario