In this section you define mappings of source fields to target fields. You can edit the following attributes (for example):
Target field: Name of target field
Source structure (outbound structure): One of the source structures that you specified for this mapping step.
Source field: Source structure field that supplies the source value
Fixed value: If you enter a non-initial value here, the system enters a fixed value into the target field. In this case, you must not enter any values for the source structure and the source field.
Field transformation: Name for a class that implements the interface IF_SMT_CONVERSION. The class converts a source value, before the system copies it to the target field.
You want to copy a document number from one source field into a target field. The document number was entered without initial zeros. Enter the structure, which contains the document number, as a source structure, and enter the field of the document number as source field. Select the field, which you want to contain the number, as target field. To acquire the initial zeros, enter the field transformation CL_SMT_CONVERSION_ALPHA_IN.
Field Transformations
Field transformations are implementations of the interface IF_SMT_CONVERSION. This interface contains the method CONVERT only. It has the following signature:
I_SOURCE: Import parameter that contains the source value
I_SOURCE_STRUCTURE: Import parameter that contains the name of the source structure
I_SOURCE_FIELD: Import parameter that contains the name of the source field
I_TARGET_STRUCTURE: Import parameter that contains the name of the target structure
I_TARGET_FIELD: Import parameter that contains the name of the target field
E_TARGET: Export parameter that contains the converted value
The important parameters for the field value before and after the conversion are I_SOURCE and E_TARGET. The parameters I_SOURCE_STRUCTURE, I_SOURCE_FIELD, I_TARGET_STRUCTURE and I_TARGET_FIELD are required for creating user-friendly error messages. To inform the tool of an error, the conversion method must trigger a type CX_SMT_TRANSFORMATION_ERROR exception. This exception contains a log for storing multiple error messages. If only one message is required, you can use the following template to trigger the exception:
DATA: "... l_protocol TYPE REF TO cl_smt_protocol, "... l_protocol = cl_smt_protocol=>create_protocol_for_message( i_msgid = l_msgid i_msgty = l_msgty i_msgno = l_msgno i_msgv1 = l_msgv1 i_msgv2 = l_msgv2 i_msgv3 = l_msgv3 i_msgv4 = l_msgv4 ). RAISE EXCEPTION TYPE cx_smt_transformation_error EXPORTING a_protocol = l_protocol.