Just like you can reuse data types in different message types, you can also save parts of message mappings as Mapping Templates and reuse them elsewhere. Once you have saved a mapping template it serves as a copy template that you can then load into other message mappings and modify to fit your requirements.
The same applies to the mapping templates themselves: You can save parts of mapping templates as mapping templates and reuse them in mapping templates or message mappings. To simplify the documentation, the text below does not mention explicitly that the statements made for message mappings are equally valid for mapping templates. However, you can replace message mapping with mapping template anywhere in this section, and the respective statement is still valid.
You can define mapping templates for structure mappings of the following structures:
· Data Types
· Complex types in IDocs and RFCs
· Complex types in external definitions
The types that you reference from mapping templates can be located in any software component version.
· You can create mapping templates again and load the structures as usual by using input help in the mapping editor.
· You can save mapping templates in a message mapping:
a. Select a type element in the source and target structure (the element must reference a non-built-in XSD data type).
b. Choose Save Mapping Template from either the target structure context menu or from the object toolbar.
c. Enter a name for the new mapping template and then create it.
Just saving the sub-structures of a message mapping as a mapping template in this way is not sufficient for the mapping editor to be able reference it (you would normally use the template in another message mapping). After you have saved the template you then need to load it into the message mapping (see below).
Apart from multi-mappings, you have all the functions of a normal message mapping available to you for a mapping template.
You can use mapping templates in message mappings from any software component version:
1. In the mapping editor, select a type element in the source and target structure (the element must reference a non-built-in XSD data type).
2. Choose Load Mapping Template from either the target structure context menu or from the object toolbar.
3. If mapping templates are available for the types in the source and target fields, you can select them in the dialog window that is then displayed.
To display all the mapping templates used in a particular message mapping, choose Message Mapping → Mapping Templates Used.