When you convert a screen field from display format to SAP internal format and vice-versa, and output data using the ABAP statement WRITE or an assignment using WRITE TO, the type-specific conversion is executed automatically. To perform a non-standard conversion, you have to specify the name of a conversion routine (conversion exit) for the attributes of one of the fields in the Screen Painter or use the addition USING EDIT MASK in the WRITE statement. This kind of conversion routine is performed automatically if the field has a Dictionary reference and you have specified the conversion routine in its domain.
If you want to implement non-standard conversions from display format to SAP internal format and vice-versa,
you can implement special function modules. Two function modules are assigned to the conversion routine xxxxx.
These are:
The INPUT module converts from display format to internal format, while the OUTPUT module performs the reverse operation. You are recommended to program both modules for input and output conversion in a function group. The effect of the conversion should be described in the documentation. If necessary, you can introduce new conversions. The function modules you create for these must only satisfy the above name requirements and conform to the conventions listed below.
Both functions must have precisely two parameters (although other optional input parameters are also allowed). The names of the obligatory parameters are INPUT for the value to be converted and OUTPUT for the converted value. It is important that the INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion have no reference fields, since the screen or ABAP field assigned during the call can have a different length than expected.
The output conversion may include A messages. The input conversion can have A, E, and S messages (although S messages are of little use). E messages result in an error dialog. Exceptions are not detected when the function is called and lead to termination.
Any ABAP statements which interrupt the processing are not allowed in function modules. These include: