Show TOC

ABAP: Creating SMT ObjectsLocate this document in the navigation structure

Use

Your program must create an object of class CL_SMT_ENGINE so that you can use the Service Mapping Tool (SMT).

Prerequisites

You have completed the Mapping Customizing.

Procedure

The first step is to create the Service Mapping Tool object:

DATA: l_engine TYPE REF TO cl_smt_engine.
	CREATE OBJECT l_engine
		EXPORTING
			i_mapping               = 'SMT_TEST'
			i_mapping_step          = 'EXTENDED_XML'
			i_context               = l_context
			i_extended_xml_handling = abap_true

If you must transform lines of a table in a mapping step, then you should create the engine outside the source data loop. Otherwise the performance is impaired, since a network of mapping objects is created, if the engine constructor is called.

Table 1: Parameters of the Constructor

Parameter

Meaning

I_MAPPING

Name of the mapping from Customizing

I_MAPPING_STEP

One of the mapping steps from Customizing

I_CONTEXT

Optional parameter that you can use for client-specific transformations. The calling application must provide a context that is normally part of Customizing. One example is the Customizing of the document type that contains an attribute context. In this case the SMT selects the client-specific transformations corresponding to the document type. This way this parameter enables transformations dependent on the business context. The system supports different contexts only if they are switched on for a mapping. If you have not switched on the contexts, you may not set the parameters.

I_EXTENDED_XML_HANDLING

Extended XML handling is important for service implementations, especially for change services. The inbound messages from services are represented by deeply nested structures. These structures contain an internal table with the field name CONTROLLER at each level, that contains names of fields that have not been sent or are to be ignored. Since most SAP APIs demand change structures rather than change tables, a transformation of both representations is required. The SMT does this if the program transfers the value abap_true to the parameter I_EXTENDED_XML_HANDLING.

I_WITH_PREFETCH

If transformation methods or conditions of a mapping step demand a prefetch, then abap_true must be set for this parameter. If it is set, then the mode must be ended by call-up of the engine method PREFETCH_END before mappings are carried out.

I_DYNAMIC_MODE

The tool moves time-critical operations to generated code. If you set this optional indicator to abap_true, the system does not call the generated code. Instead, it uses dynamic commands.

I_SAP_MAPPINGS_LAST

If you set this indicator, the system performs standard mappings after enhancement mappings. This means that standard mappings cannot be overridden by enhancements.

I_SAP_CHECKS_LAST

If you set this indicator, the system performs standard checks after enhancement checks.