Show TOC

Transformation MethodsLocate this document in the navigation structure

In some cases, it may not be possible to fill a target structure by simple mappings only. Examples of such tasks include conversions of currency amounts (such as 10 USD) from an ISO to an internal representation, and vice versa. To perform this type of operation, you can implement static transformation methods. Class and methods must meet the following conditions:

  • Transformation classes must implement the interface IF_SMT_TRANSFORMATION. Note that transformation methods are not part of the interface. The purpose of the interface is to indicate classes that are relevant for the SMT, and to provide the methods START_OF_PREFETCH and END_OF_PREFETCH. The system requires these methods for the Prefetch.

  • Transformation methods must be static and public.

  • Transformation methods contain import and export parameters only. Change and return parameters are not allowed.

  • Transformation methods must have an import parameter I_PREFETCH of type SMT_BOOLEAN. The parameter is used for displaying the Prefetch mode.

  • The method may contain the change parameter CH_CHANGE of the change structure category. If it is available, the system transfers the change structure to it.

  • If you cannot specify the target values, the transformation methods trigger the exception CX_SMT_UNSUCCESSFUL_TRANS.

  • If the mapping program terminates due to a grave error, the transformation methods trigger the exception CX_SMT_FATAL_METHOD_ERROR.

Import parameters are mapped to source fields, export parameters to target structure fields.

Differences between the triggering of CX_SMT_FATAL_METHOD_ERROR and CX_SMT_UNSUCCESSFUL_TRANS:

  • If a mapping operation fails, the system triggers the exception CX_SMT_UNSUCCESSFUL_TRANS. This exception contains a log object with messages that describe the problem. If this transformation is not part of a chain, the tool performs further transformations in order to collect further errors. At the end, the tool triggers the exception CX_SMT_TRANSFORMATION_ERROR. If the transformation is part of a chain, the system executes the next transformation in the chain. If part of the chain is successful, the system triggers no exception. This enables the system to repair the failure of a transformation by using another transformation following in the chain.

  • The exception CX_SMT_FATAL_METHOD_ERROR is reserved for errors that are connected to program errors or incorrect customizing settings. As with the case mentioned above, the system executes further transformations in order to collect error messages. At the end, the tool executes the exception CX_SMT_TRANSFORMATION_ERROR . You cannot repair this type of error by using the subsequent transformations.