Show TOC

Function documentationService Mapping Tool (SMT)

 

The SMT is a program that enables you to fill target structures by using sets of source structures (in ABAP). It supports: simple mappings, mappings with field transformations, complex transformations and field checks. Possible applications of the tool include: preparation of data for further actions, conversions of Enterprise Service data to an SAP-internal format, and vice versa. The SMT supports specific requirements for service implementations, such as extended XML handling or field checks.

The SMT executes standard mappings before extensions. Any checks that you have activated for overwriting fields are never active for extensions.

Prerequisites

You must specify all mapping operations in Customizing. This ensures that semantic information is not hidden within ABAP code, but clearly specified in a repository.

For further information, see Customizing of SMT under Start of the navigation path Cross-Application Components Next navigation step Processes and Tools for Business Applications Next navigation step Enterprise Services Next navigation step Extended Enterprise Services Next navigation step Extended Mappings End of the navigation path and/or Start of the navigation path Cross-Application Components Next navigation step Processes and Tools for Business Applications Next navigation step Enterprise Services Next navigation step Develop Enterprise Services Next navigation step Extended Mappings Next navigation step Create and Edit Mappings End of the navigation path.

Features

The SMT includes the following functions for filling a target structure using multiple source structures:

  • Simple mappings: Copy the content of source fields into the target field. The relation between source and target fields is 1 : 1.

  • Simple mappings with field transformations: Mappings as for simple mappings, but the system converts the source values using a transformation method. The relation between source and target fields is 1 : 1.

  • Transformation methods: The system uses source fields as input parameters for a transformation method. The system maps the exporting parameters of this method to the target fields. The relation between source and target fields is m : n.

  • Conditions: Transformations may depend on a condition being met.

  • Field checks: Enable you to specify checks for initial- and fixed values. You can perform more complex field checks by calling check methods.

  • Extended XML handling: Most business object APIs make use of change structures to show which fields should be changed. Service implementations use field name tables to provide this information. The SMT is able to convert the table-based information into change structures.

Note Note

Constraints: The system fills only one target structure variable in each SMT call. If your input structure contains tables, your mapping program must read the source data line for line, and transfer it to the SMT.

End of the note.

Example

You want to write a program that creates a document consisting of a header and several items. Your source is a service structure. Suppose that the header of the target document depends only on the header of the source document, and that an item of the target document depends only on its predecessor item (and possibly on the header of the source document). In this case, you can configure the SMT as follows:

  • In Customizing, define a mapping step with the header structure of the follow-on document as target structure and with the header structure of the source document as source structure. Specify all operations that are required to fill the target structures.

  • Your ABAP program must call the SMT with source header and target header.

  • In Customizing, define a mapping step with the item structure of the follow-on document as target structure, and with the item and header structure of the source document as source. Specify all operations that are required to fill the target structures.

  • Your ABAP program must process all items of the source document. Within the loop, the program calls the SMT for each source item.