Input and Output Conversions

Depending on the data type of the field, conversion takes place when a screen field is transferred from display format to SAP-internal format or vice-versa and when a screen field is output with the ABAP command WRITE.

Conversion Exit

Non-standard conversions from display format to SAP-internal format and vice versa are implemented with so-called conversion routines. Conversion routines are identified by a five-position name and are stored as a group of two ABAP function modules. The function modules have a fixed naming convention. The following ABAP function modules are assigned to the conversion xxxxx:

CONVERSION_EXIT_xxxxx_INPUT
CONVERSION_EXIT_xxxxx_OUTPUT

The INPUT module carries out the conversion from display format to internal format, while the OUTPUT module converts from internal format to display format. If required, new conversion routines can be added. However, the corresponding function modules must adhere to the above naming conventions and to the conventions defined below. We recommend that the two modules be combined to form a function group for input and output conversions.

When is a Conversion Exit Executed?

If a screen field refers to a domain with a conversion exit, this conversion exit is executed automatically each time an entry is made in this screen field or when values are displayed in this screen field.

A conversion routine can also be triggered automatically directly in the program by specifying its five-place name in the attributes of a field in the Screen Painter or by adding "USING EDIT MASK'==<Name of the conversion exit>' " in the WRITE command.

Parameters

The two function modules of a conversion routine must have precisely two parameters with the names INPUT and OUTPUT for the value to be converted and the converted value.

In particular, the INPUT parameter in the INPUT conversion and the OUTPUT parameter in the OUTPUT conversion should not have any reference field because the screen or ABAP field assigned in the call could have a different length than that expected because a matchcode input is expected, for example.

Messages

During output conversion, only A messages are meaningful, but during input conversion, A, E and S messages can be triggered (although S messages are not very meaningful here). E messages result in an error message. Exceptions are not intercepted in the call.

ABAP Statements

All ABAP statements that result in an interrupt are not permitted in conversion routines. These are the following statements:

Further Comments